]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
MFC r339451: objcopy: restore behaviour required by GCC's build
authoremaste <emaste@FreeBSD.org>
Thu, 25 Oct 2018 15:18:54 +0000 (15:18 +0000)
committeremaste <emaste@FreeBSD.org>
Thu, 25 Oct 2018 15:18:54 +0000 (15:18 +0000)
commit2ca681f7db3a022b03d4bfaee789f4b0ed6bd9d7
treef0c1bc98f95c43495c06f38379b3894c6561616e
parent8c726143c0e1462d22065c01bcffa784e9255a00
MFC r339451: objcopy: restore behaviour required by GCC's build

In r339350 filter_reloc() was removed, to fix the case of stripping
statically linked binaries with relocations (which may come from ifunc
use, for example).  As a side effect this changed the behaviour when
stripping object files - the output was broken both before and after
r339350, in different ways.  Unfortunately GCC's build process relies
on the previous behaviour, so:

- Revert r339350, restoring filter_reloc().
- Fix an unitialized variable use (commited as r3638 in ELF Tool Chain).
- Change filter_reloc() to omit relocations referencing removed
  symbols, while retaining relocations with no symbol reference.
- Retain the entire relocation section if it references the dynamic
  symbol table (fix from kaiw in D17596).

PR: 232176
Approved by: re (gjb, kib)
Sponsored by: The FreeBSD Foundation
contrib/elftoolchain/elfcopy/sections.c