kumquat-buildroot/package/binutils/2.22
Max Filippov 384c919321 binutils: fix xtensa ld bug triggered by --gc-sections
elf_xtensa_gc_sweep_hook doesn't correctly unreference symbols that were
made local, that results in link failure with the following message:

  BFD (GNU Binutils) 2.24 internal error, aborting at elf32-xtensa.c line
  3372 in elf_xtensa_finish_dynamic_sections

elf_xtensa_gc_sweep_hook determines symbol reference type (PLT or GOT) by
relocation type. Relocation types are not changed when symbol becomes
local, but its PLT references are added to GOT references and
plt.refcount is set to 0. Such symbol cannot be unreferences in the
elf_xtensa_gc_sweep_hook and its extra references make calculated GOT
relocations section size not match number of GOT relocations.

Fix it by treating PLT reference as GOT reference when plt.refcount is
not positive.

Fixes:
  http://autobuild.buildroot.net/results/3e2e24f697e26c93d4d95782b1cb7799fa620a7a/
  http://autobuild.buildroot.org/results/97d4c96d6f6cdc1ed4007456f4ab70be9dfa41b5/

Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2015-05-16 18:28:06 +02:00
..
120-sh-conf.patch
300-001_ld_makefile_patch.patch
300-012_check_ldrunpath_length.patch
500-sysroot.patch
600-poison-system-directories.patch binutils/2.22: add patch to warn about unsafe library paths 2014-12-11 00:05:52 +01:00
900-xtensa-trampolines.patch
901-xtensa-gas-first-frag-alignment.patch
902-xtensa-gas-ld-diff-relocation-signed.patch
903-xtensa-fix-ld-segfault-when-linking-linux-modules.patch
904-Fix-call8-call-target-out-of-range-xtensa-ld-relaxation.patch
905-Fix-trampolines-search-code-for-conditional-branches.patch
911-xtensa-fix-localized-symbol-refcounting-with-gc-sect.patch binutils: fix xtensa ld bug triggered by --gc-sections 2015-05-16 18:28:06 +02:00
999-ppc-textrels.patch