summaryrefslogtreecommitdiff
path: root/toolchain
diff options
context:
space:
mode:
authorWaldemar Brodkorb <mail@waldemar-brodkorb.de>2013-09-14 12:54:03 +0200
committerWaldemar Brodkorb <mail@waldemar-brodkorb.de>2013-09-14 12:54:03 +0200
commite1181316ee91884de9fd972a05d6276052407ad0 (patch)
treebe2b51acf663a8f598bed95e54176d7bba5bffd4 /toolchain
parentfa3fca864f55483f07c9310053394ed81bee20c3 (diff)
add binutils patch from musl-cross @ https://bitbucket.org/GregorR/musl-cross/src
Diffstat (limited to 'toolchain')
-rw-r--r--toolchain/binutils/patches/2.22/musl-cross.patch81
-rw-r--r--toolchain/binutils/patches/2.22/musl.patch20
2 files changed, 81 insertions, 20 deletions
diff --git a/toolchain/binutils/patches/2.22/musl-cross.patch b/toolchain/binutils/patches/2.22/musl-cross.patch
new file mode 100644
index 000000000..47af7bbb8
--- /dev/null
+++ b/toolchain/binutils/patches/2.22/musl-cross.patch
@@ -0,0 +1,81 @@
+diff -Nur binutils-2.22.orig/bfd/elf32-ppc.c binutils-2.22/bfd/elf32-ppc.c
+--- binutils-2.22.orig/bfd/elf32-ppc.c 2011-11-21 10:29:21.000000000 +0100
++++ binutils-2.22/bfd/elf32-ppc.c 2013-09-14 12:51:24.000000000 +0200
+@@ -2987,10 +2987,6 @@
+ edir->elf.needs_plt |= eind->elf.needs_plt;
+ edir->elf.pointer_equality_needed |= eind->elf.pointer_equality_needed;
+
+- /* If we were called to copy over info for a weak sym, that's all. */
+- if (eind->elf.root.type != bfd_link_hash_indirect)
+- return;
+-
+ if (eind->dyn_relocs != NULL)
+ {
+ if (edir->dyn_relocs != NULL)
+@@ -3022,6 +3018,16 @@
+ eind->dyn_relocs = NULL;
+ }
+
++ /* If we were called to copy over info for a weak sym, that's all.
++ You might think dyn_relocs need not be copied over; After all,
++ both syms will be dynamic or both non-dynamic so we're just
++ moving reloc accounting around. However, ELIMINATE_COPY_RELOCS
++ code in ppc_elf_adjust_dynamic_symbol needs to check for
++ dyn_relocs in read-only sections, and it does so on what is the
++ DIR sym here. */
++ if (eind->elf.root.type != bfd_link_hash_indirect)
++ return;
++
+ /* Copy over the GOT refcount entries that we may have already seen to
+ the symbol which just became indirect. */
+ edir->elf.got.refcount += eind->elf.got.refcount;
+diff -Nur binutils-2.22.orig/bfd/elf64-ppc.c binutils-2.22/bfd/elf64-ppc.c
+--- binutils-2.22.orig/bfd/elf64-ppc.c 2011-11-21 10:29:24.000000000 +0100
++++ binutils-2.22/bfd/elf64-ppc.c 2013-09-14 12:51:24.000000000 +0200
+@@ -4435,10 +4435,6 @@
+ edir->elf.ref_regular_nonweak |= eind->elf.ref_regular_nonweak;
+ edir->elf.needs_plt |= eind->elf.needs_plt;
+
+- /* If we were called to copy over info for a weak sym, that's all. */
+- if (eind->elf.root.type != bfd_link_hash_indirect)
+- return;
+-
+ /* Copy over any dynamic relocs we may have on the indirect sym. */
+ if (eind->dyn_relocs != NULL)
+ {
+@@ -4471,6 +4467,16 @@
+ eind->dyn_relocs = NULL;
+ }
+
++ /* If we were called to copy over info for a weak sym, that's all.
++ You might think dyn_relocs need not be copied over; After all,
++ both syms will be dynamic or both non-dynamic so we're just
++ moving reloc accounting around. However, ELIMINATE_COPY_RELOCS
++ code in ppc64_elf_adjust_dynamic_symbol needs to check for
++ dyn_relocs in read-only sections, and it does so on what is the
++ DIR sym here. */
++ if (eind->elf.root.type != bfd_link_hash_indirect)
++ return;
++
+ /* Copy over got entries that we may have already seen to the
+ symbol which just became indirect. */
+ if (eind->elf.got.glist != NULL)
+diff -Nur binutils-2.22.orig/config.sub binutils-2.22/config.sub
+--- binutils-2.22.orig/config.sub 2011-06-06 12:36:06.000000000 +0200
++++ binutils-2.22/config.sub 2013-09-14 12:51:24.000000000 +0200
+@@ -125,6 +125,7 @@
+ 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* | \
+@@ -1335,6 +1336,7 @@
+ | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
+ | -mingw32* | -linux-gnu* | -linux-android* \
+ | -linux-newlib* | -linux-uclibc* \
++ | -linux-musl* \
+ | -uxpv* | -beos* | -mpeix* | -udk* \
+ | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \
+ | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \
diff --git a/toolchain/binutils/patches/2.22/musl.patch b/toolchain/binutils/patches/2.22/musl.patch
deleted file mode 100644
index 4ea53c18f..000000000
--- a/toolchain/binutils/patches/2.22/musl.patch
+++ /dev/null
@@ -1,20 +0,0 @@
-diff -Nur binutils-2.22.orig/config.sub binutils-2.22/config.sub
---- binutils-2.22.orig/config.sub 2011-06-06 12:36:06.000000000 +0200
-+++ binutils-2.22/config.sub 2013-08-11 14:40:22.308115171 +0200
-@@ -126,6 +126,7 @@
- case $maybe_os in
- nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc | linux-newlib* | \
- linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \
-+ linux-musl* | \
- knetbsd*-gnu* | netbsd*-gnu* | \
- kopensolaris*-gnu* | \
- storm-chaos* | os2-emx* | rtmk-nova*)
-@@ -1334,7 +1335,7 @@
- | -chorusos* | -chorusrdb* | -cegcc* \
- | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
- | -mingw32* | -linux-gnu* | -linux-android* \
-- | -linux-newlib* | -linux-uclibc* \
-+ | -linux-newlib* | -linux-uclibc* | -linux-musl* \
- | -uxpv* | -beos* | -mpeix* | -udk* \
- | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \
- | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \