Correct elftoolchain strip(1) memory size calculation
authoremaste <emaste@FreeBSD.org>
Mon, 15 Dec 2014 18:18:57 +0000 (18:18 +0000)
committeremaste <emaste@FreeBSD.org>
Mon, 15 Dec 2014 18:18:57 +0000 (18:18 +0000)
commit50872743f93c1edaa918140eed44a7300d41beb8
tree8f2868f6525916d5920d47b72dd956c7fdfc020e
parent93ef12f5869abbc3948befe430bb97291c1b1379
Correct elftoolchain strip(1) memory size calculation

Calculate the segment's memory size (p_memsz) using the virtual
addresses, not the file offsets. Otherwise padding preceeding SHT_NOBITS
sections may be excluded from the calculation, resulting in a segment
that is too small.

PR: 195653
Sponsored by: The FreeBSD Foundation
contrib/elftoolchain/elfcopy/segments.c