From 0a41ba39e26b08d9a000a917eeccd948e9da12a7 Mon Sep 17 00:00:00 2001 From: "\"Steven J. Hill\"" Date: Mon, 7 May 2007 03:57:09 +0000 Subject: Add older version of binutils. --- .../320-mips-elf-reloc-regression.patch | 68 ++++++++++++++++++++++ 1 file changed, 68 insertions(+) create mode 100644 toolchain/binutils/2.17.50.0.12/320-mips-elf-reloc-regression.patch (limited to 'toolchain/binutils/2.17.50.0.12/320-mips-elf-reloc-regression.patch') 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; -- cgit v1.2.3