This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
[PATCH] MIPS/BFD: Update RELA target reloc source masks
- From: "Maciej W. Rozycki" <macro at codesourcery dot com>
- To: <binutils at sourceware dot org>
- Cc: Richard Sandiford <rdsandiford at googlemail dot com>, Chung-Lin Tang <cltang at codesourcery dot com>
- Date: Thu, 2 Aug 2012 18:56:19 +0100
- Subject: [PATCH] MIPS/BFD: Update RELA target reloc source masks
Hi,
For RELA targets that have no in-place addend it is an error to specify a
non-null reloc source mask. Here's a change to fix the MIPS16 TLS
relocations recently added.
No regressions with my usual set of 23 MIPS targets. OK to apply?
2012-08-02 Maciej W. Rozycki <macro@codesourcery.com>
bfd/
* elf64-mips.c (mips16_elf64_howto_table_rela): Correct src_mask
field initializers throughout.
* elfn32-mips.c (elf_mips16_howto_table_rela): Likewise.
Maciej
binutils-bfd-mips16-rela-src-mask.diff
Index: binutils-fsf-trunk-quilt/bfd/elf64-mips.c
===================================================================
--- binutils-fsf-trunk-quilt.orig/bfd/elf64-mips.c 2012-03-08 15:30:19.000000000 +0000
+++ binutils-fsf-trunk-quilt/bfd/elf64-mips.c 2012-06-12 06:57:06.594171097 +0100
@@ -1803,7 +1803,7 @@ static reloc_howto_type mips16_elf64_how
_bfd_mips_elf_generic_reloc, /* special_function */
"R_MIPS16_TLS_GD", /* name */
FALSE, /* partial_inplace */
- 0x0000ffff, /* src_mask */
+ 0, /* src_mask */
0x0000ffff, /* dst_mask */
FALSE), /* pcrel_offset */
@@ -1818,7 +1818,7 @@ static reloc_howto_type mips16_elf64_how
_bfd_mips_elf_generic_reloc, /* special_function */
"R_MIPS16_TLS_LDM", /* name */
FALSE, /* partial_inplace */
- 0x0000ffff, /* src_mask */
+ 0, /* src_mask */
0x0000ffff, /* dst_mask */
FALSE), /* pcrel_offset */
@@ -1833,7 +1833,7 @@ static reloc_howto_type mips16_elf64_how
_bfd_mips_elf_generic_reloc, /* special_function */
"R_MIPS16_TLS_DTPREL_HI16", /* name */
FALSE, /* partial_inplace */
- 0x0000ffff, /* src_mask */
+ 0, /* src_mask */
0x0000ffff, /* dst_mask */
FALSE), /* pcrel_offset */
@@ -1848,7 +1848,7 @@ static reloc_howto_type mips16_elf64_how
_bfd_mips_elf_generic_reloc, /* special_function */
"R_MIPS16_TLS_DTPREL_LO16", /* name */
FALSE, /* partial_inplace */
- 0x0000ffff, /* src_mask */
+ 0, /* src_mask */
0x0000ffff, /* dst_mask */
FALSE), /* pcrel_offset */
@@ -1863,7 +1863,7 @@ static reloc_howto_type mips16_elf64_how
_bfd_mips_elf_generic_reloc, /* special_function */
"R_MIPS16_TLS_GOTTPREL", /* name */
FALSE, /* partial_inplace */
- 0x0000ffff, /* src_mask */
+ 0, /* src_mask */
0x0000ffff, /* dst_mask */
FALSE), /* pcrel_offset */
@@ -1878,7 +1878,7 @@ static reloc_howto_type mips16_elf64_how
_bfd_mips_elf_generic_reloc, /* special_function */
"R_MIPS16_TLS_TPREL_HI16", /* name */
FALSE, /* partial_inplace */
- 0x0000ffff, /* src_mask */
+ 0, /* src_mask */
0x0000ffff, /* dst_mask */
FALSE), /* pcrel_offset */
@@ -1893,7 +1893,7 @@ static reloc_howto_type mips16_elf64_how
_bfd_mips_elf_generic_reloc, /* special_function */
"R_MIPS16_TLS_TPREL_LO16", /* name */
FALSE, /* partial_inplace */
- 0x0000ffff, /* src_mask */
+ 0, /* src_mask */
0x0000ffff, /* dst_mask */
FALSE), /* pcrel_offset */
};
Index: binutils-fsf-trunk-quilt/bfd/elfn32-mips.c
===================================================================
--- binutils-fsf-trunk-quilt.orig/bfd/elfn32-mips.c 2012-03-08 15:30:19.000000000 +0000
+++ binutils-fsf-trunk-quilt/bfd/elfn32-mips.c 2012-06-12 07:02:55.413575012 +0100
@@ -1768,7 +1768,7 @@ static reloc_howto_type elf_mips16_howto
_bfd_mips_elf_generic_reloc, /* special_function */
"R_MIPS16_TLS_GD", /* name */
FALSE, /* partial_inplace */
- 0x0000ffff, /* src_mask */
+ 0, /* src_mask */
0x0000ffff, /* dst_mask */
FALSE), /* pcrel_offset */
@@ -1783,7 +1783,7 @@ static reloc_howto_type elf_mips16_howto
_bfd_mips_elf_generic_reloc, /* special_function */
"R_MIPS16_TLS_LDM", /* name */
FALSE, /* partial_inplace */
- 0x0000ffff, /* src_mask */
+ 0, /* src_mask */
0x0000ffff, /* dst_mask */
FALSE), /* pcrel_offset */
@@ -1798,7 +1798,7 @@ static reloc_howto_type elf_mips16_howto
_bfd_mips_elf_generic_reloc, /* special_function */
"R_MIPS16_TLS_DTPREL_HI16", /* name */
FALSE, /* partial_inplace */
- 0x0000ffff, /* src_mask */
+ 0, /* src_mask */
0x0000ffff, /* dst_mask */
FALSE), /* pcrel_offset */
@@ -1813,7 +1813,7 @@ static reloc_howto_type elf_mips16_howto
_bfd_mips_elf_generic_reloc, /* special_function */
"R_MIPS16_TLS_DTPREL_LO16", /* name */
FALSE, /* partial_inplace */
- 0x0000ffff, /* src_mask */
+ 0, /* src_mask */
0x0000ffff, /* dst_mask */
FALSE), /* pcrel_offset */
@@ -1828,7 +1828,7 @@ static reloc_howto_type elf_mips16_howto
_bfd_mips_elf_generic_reloc, /* special_function */
"R_MIPS16_TLS_GOTTPREL", /* name */
FALSE, /* partial_inplace */
- 0x0000ffff, /* src_mask */
+ 0, /* src_mask */
0x0000ffff, /* dst_mask */
FALSE), /* pcrel_offset */
@@ -1843,7 +1843,7 @@ static reloc_howto_type elf_mips16_howto
_bfd_mips_elf_generic_reloc, /* special_function */
"R_MIPS16_TLS_TPREL_HI16", /* name */
FALSE, /* partial_inplace */
- 0x0000ffff, /* src_mask */
+ 0, /* src_mask */
0x0000ffff, /* dst_mask */
FALSE), /* pcrel_offset */
@@ -1858,7 +1858,7 @@ static reloc_howto_type elf_mips16_howto
_bfd_mips_elf_generic_reloc, /* special_function */
"R_MIPS16_TLS_TPREL_LO16", /* name */
FALSE, /* partial_inplace */
- 0x0000ffff, /* src_mask */
+ 0, /* src_mask */
0x0000ffff, /* dst_mask */
FALSE), /* pcrel_offset */
};