summaryrefslogtreecommitdiffstats
path: root/toolchain/binutils/patches/2.22
diff options
context:
space:
mode:
Diffstat (limited to 'toolchain/binutils/patches/2.22')
-rw-r--r--toolchain/binutils/patches/2.22/200-musl.patch10
-rw-r--r--toolchain/binutils/patches/2.22/400-fix_arm_gc_sections.patch12
-rw-r--r--toolchain/binutils/patches/2.22/500-arm_ld_assert_fix.patch26
3 files changed, 48 insertions, 0 deletions
diff --git a/toolchain/binutils/patches/2.22/200-musl.patch b/toolchain/binutils/patches/2.22/200-musl.patch
new file mode 100644
index 000000000..40fe76d34
--- /dev/null
+++ b/toolchain/binutils/patches/2.22/200-musl.patch
@@ -0,0 +1,10 @@
+--- a/config.sub
++++ b/config.sub
+@@ -125,6 +125,7 @@ esac
+ maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
+ case $maybe_os in
+ nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc | linux-newlib* | \
++ linux-musl* | \
+ linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \
+ knetbsd*-gnu* | netbsd*-gnu* | \
+ kopensolaris*-gnu* | \
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
index 000000000..04badab62
--- /dev/null
+++ b/toolchain/binutils/patches/2.22/400-fix_arm_gc_sections.patch
@@ -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++;
diff --git a/toolchain/binutils/patches/2.22/500-arm_ld_assert_fix.patch b/toolchain/binutils/patches/2.22/500-arm_ld_assert_fix.patch
new file mode 100644
index 000000000..e011c4b11
--- /dev/null
+++ b/toolchain/binutils/patches/2.22/500-arm_ld_assert_fix.patch
@@ -0,0 +1,26 @@
+See http://sourceware.org/bugzilla/show_bug.cgi?id=13990 for details.
+---
+--- a/bfd/elf32-arm.c
++++ b/bfd/elf32-arm.c
+@@ -12046,8 +12046,19 @@ elf32_arm_gc_sweep_hook (bfd *
+ if (may_need_local_target_p
+ && elf32_arm_get_plt_info (abfd, eh, r_symndx, &root_plt, &arm_plt))
+ {
+- BFD_ASSERT (root_plt->refcount > 0);
+- root_plt->refcount -= 1;
++ /* If PLT refcount book-keeping is wrong and too low, we'll
++ see a zero value (going to -1) for the root PLT reference
++ count. */
++ if (root_plt->refcount >= 0)
++ {
++ BFD_ASSERT (root_plt->refcount != 0);
++ root_plt->refcount -= 1;
++ }
++ else
++ /* A value of -1 means the symbol has become local, forced
++ or seeing a hidden definition. Any other negative value
++ is an error. */
++ BFD_ASSERT (root_plt->refcount == -1);
+
+ if (!call_reloc_p)
+ arm_plt->noncall_refcount--;