Ed Maste c9504239e8 elfcopy: delete filter_reloc, it is broken and unnecessary
elfcopy contained logic to filter individual relocations in STRIP_ALL
mode.  However, this is not valid; relocations emitted by the linker are
required, unless they apply to an entire section being removed (which is
handled by other logic in elfcopy).

Note that filter_reloc was also buggy: for RELA relocation sections it
operated on uninitialized rel.r_info resulting in invalid operation.

The logic most likely needs to be inverted: instead of removing
relocations because their associated symbols are being removed, we must
keep symbols referenced by relocations.  That said, in practice we do
not encounter this code path today: objects being stripped are either
dynamically linked binaries which retain .dynsym, or static binaries
with no relocations.

Just remove filter_reloc.  This fixes certain cases including statically
linked binaries containing ifuncs.  Stripping binaries with relocations
referencing removed symbols was already broken, and after this change
may still be broken in a different way.

PR:		232176
Reviewed by:	kaiw, kib, markj
Approved by:	re (rgrimes)
MFC after:	1 month
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D17519
2018-10-13 21:26:07 +00:00
..
2018-09-19 06:39:10 +00:00
2018-09-19 06:42:05 +00:00
2018-08-08 01:33:36 +00:00
2018-02-19 05:10:22 +00:00
2018-09-20 11:44:36 +00:00
2018-05-31 09:11:21 +00:00
2018-05-23 01:20:31 +00:00
2018-08-14 18:58:01 +00:00
2018-09-20 10:58:52 +00:00
2018-08-21 02:38:07 +00:00
2018-10-05 17:53:47 +00:00
2018-01-28 03:16:54 +00:00
2017-06-28 09:22:45 +00:00
2018-05-08 04:52:52 +00:00
2018-09-19 07:01:22 +00:00
2018-05-04 10:17:27 +00:00
2018-05-18 06:10:16 +00:00
2017-09-10 01:25:15 +00:00