binutils: backport ld patch to fix ARM specific issues with --gc-sections
authorFelix Fietkau <nbd@openwrt.org>
Wed, 19 Sep 2012 06:33:07 +0000 (06:33 +0000)
committerFelix Fietkau <nbd@openwrt.org>
Wed, 19 Sep 2012 06:33:07 +0000 (06:33 +0000)
SVN-Revision: 33461

toolchain/binutils/patches/2.22/400-fix_arm_gc_sections.patch [new file with mode: 0644]

diff --git a/toolchain/binutils/patches/2.22/400-fix_arm_gc_sections.patch b/toolchain/binutils/patches/2.22/400-fix_arm_gc_sections.patch
new file mode 100644 (file)
index 0000000..04badab
--- /dev/null
@@ -0,0 +1,12 @@
+--- a/bfd/elf32-arm.c
++++ b/bfd/elf32-arm.c
+@@ -12408,7 +12408,8 @@ elf32_arm_check_relocs (bfd *abfd, struc
+         /* If the symbol is a function that doesn't bind locally,
+            this relocation will need a PLT entry.  */
+-        root_plt->refcount += 1;
++        if (root_plt->refcount != -1)
++          root_plt->refcount += 1;
+         if (!call_reloc_p)
+           arm_plt->noncall_refcount++;