summaryrefslogtreecommitdiffstats
path: root/toolchain/binutils/2.17.50.0.12/320-mips-elf-reloc-regression.patch
diff options
context:
space:
mode:
author"Steven J. Hill" <sjhill@realitydiluted.com>2007-05-07 03:57:09 +0000
committer"Steven J. Hill" <sjhill@realitydiluted.com>2007-05-07 03:57:09 +0000
commit0a41ba39e26b08d9a000a917eeccd948e9da12a7 (patch)
tree1caf03288d573552f0f385cab06bb2d868dd5bb5 /toolchain/binutils/2.17.50.0.12/320-mips-elf-reloc-regression.patch
parent9c865d752e4bdad380bdec75088841ab693602cb (diff)
downloadbuildroot-novena-0a41ba39e26b08d9a000a917eeccd948e9da12a7.tar.gz
buildroot-novena-0a41ba39e26b08d9a000a917eeccd948e9da12a7.zip
Add older version of binutils.
Diffstat (limited to 'toolchain/binutils/2.17.50.0.12/320-mips-elf-reloc-regression.patch')
-rw-r--r--toolchain/binutils/2.17.50.0.12/320-mips-elf-reloc-regression.patch68
1 files changed, 68 insertions, 0 deletions
diff --git a/toolchain/binutils/2.17.50.0.12/320-mips-elf-reloc-regression.patch b/toolchain/binutils/2.17.50.0.12/320-mips-elf-reloc-regression.patch
new file mode 100644
index 000000000..902bb8836
--- /dev/null
+++ b/toolchain/binutils/2.17.50.0.12/320-mips-elf-reloc-regression.patch
@@ -0,0 +1,68 @@
+diff -ur binutils-2.17.50.0.12/bfd/elfxx-mips.c binutils-2.17.50.0.12-patched/bfd/elfxx-mips.c
+--- binutils-2.17.50.0.12/bfd/elfxx-mips.c 2006-11-27 16:21:04.000000000 -0600
++++ binutils-2.17.50.0.12-patched/bfd/elfxx-mips.c 2007-03-20 15:25:42.000000000 -0500
+@@ -3615,7 +3615,6 @@
+ }
+
+ /* We didn't find it. */
+- bfd_set_error (bfd_error_bad_value);
+ return NULL;
+ }
+
+@@ -7849,32 +7848,36 @@
+ several relocations for the same address. In
+ that case, the R_MIPS_LO16 relocation may occur
+ as one of these. We permit a similar extension
+- in general, as that is useful for GCC. */
++ in general, as that is useful for GCC.
++
++ In some cases GCC dead code elimination removes
++ the LO16 but keeps the corresponding HI16. */
+ lo16_relocation = mips_elf_next_relocation (input_bfd,
+ lo16_type,
+ rel, relend);
+- if (lo16_relocation == NULL)
+- return FALSE;
+-
+- lo16_location = contents + lo16_relocation->r_offset;
++ if (lo16_relocation != NULL)
++ {
++ lo16_location = contents + lo16_relocation->r_offset;
+
+- /* Obtain the addend kept there. */
+- lo16_howto = MIPS_ELF_RTYPE_TO_HOWTO (input_bfd,
+- lo16_type, FALSE);
+- _bfd_mips16_elf_reloc_unshuffle (input_bfd, lo16_type, FALSE,
+- lo16_location);
+- l = mips_elf_obtain_contents (lo16_howto, lo16_relocation,
+- input_bfd, contents);
+- _bfd_mips16_elf_reloc_shuffle (input_bfd, lo16_type, FALSE,
+- lo16_location);
+- l &= lo16_howto->src_mask;
+- l <<= lo16_howto->rightshift;
+- l = _bfd_mips_elf_sign_extend (l, 16);
++ /* Obtain the addend kept there. */
++ lo16_howto = MIPS_ELF_RTYPE_TO_HOWTO (input_bfd,
++ lo16_type, FALSE);
++ _bfd_mips16_elf_reloc_unshuffle (input_bfd, lo16_type,
++ FALSE, lo16_location);
++ l = mips_elf_obtain_contents (lo16_howto,
++ lo16_relocation,
++ input_bfd, contents);
++ _bfd_mips16_elf_reloc_shuffle (input_bfd, lo16_type,
++ FALSE, lo16_location);
++ l &= lo16_howto->src_mask;
++ l <<= lo16_howto->rightshift;
++ l = _bfd_mips_elf_sign_extend (l, 16);
+
+- addend <<= 16;
++ addend <<= 16;
+
+- /* Compute the combined addend. */
+- addend += l;
++ /* Compute the combined addend. */
++ addend += l;
++ }
+ }
+ else
+ addend <<= howto->rightshift;