* [PATCH] MIPS/BFD: Handle RELA TLS_DTPMOD64 and TLS_TPREL64 relocs
@ 2009-09-01 23:40 Maciej W. Rozycki
2009-09-03 2:46 ` Alan Modra
0 siblings, 1 reply; 2+ messages in thread
From: Maciej W. Rozycki @ 2009-09-01 23:40 UTC (permalink / raw)
To: binutils; +Cc: Maciej W. Rozycki
Hello,
I have discovered a problem with `objdump -R' that does not decode names
for R_MIPS_TLS_DTPMOD64 and R_MIPS_TLS_TPREL64 relocations in dynamic RELA
sections. It may have been missed before, because the MIPS linker uses
the REL format for dynamic relocation sections. The prelinker however
converts such sections to RELA.
An obvious fix follows -- both R_MIPS_TLS_DTPMOD64 and R_MIPS_TLS_TPREL64
relocations are only used in the dynamic link, so the presence or absence
of the howtos does not affect the BFD linker; `objdump' however uses these
tables to decode names of relocations.
Tested for the mips-linux-gnu target, no regressions.
bfd/
2009-09-01 Maciej W. Rozycki <macro@codesourcery.com>
* elf64-mips.c (mips_elf64_howto_table_rela): Add support for
R_MIPS_TLS_DTPMOD64 and R_MIPS_TLS_TPREL64, replacing the
respective stubs.
OK to apply?
Maciej
binutils-2.19.51-20090827-mips-reloc-tls64-1.patch
Index: bfd/elf64-mips.c
===================================================================
--- bfd/elf64-mips.c
+++ bfd/elf64-mips.c
@@ -1328,7 +1328,20 @@ static reloc_howto_type mips_elf64_howto
/* TLS relocations. */
EMPTY_HOWTO (R_MIPS_TLS_DTPMOD32),
EMPTY_HOWTO (R_MIPS_TLS_DTPREL32),
- EMPTY_HOWTO (R_MIPS_TLS_DTPMOD64),
+
+ HOWTO (R_MIPS_TLS_DTPMOD64, /* type */
+ 0, /* rightshift */
+ 4, /* size (0 = byte, 1 = short, 2 = long) */
+ 64, /* bitsize */
+ FALSE, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_dont, /* complain_on_overflow */
+ _bfd_mips_elf_generic_reloc, /* special_function */
+ "R_MIPS_TLS_DTPMOD64", /* name */
+ TRUE, /* partial_inplace */
+ MINUS_ONE, /* src_mask */
+ MINUS_ONE, /* dst_mask */
+ FALSE), /* pcrel_offset */
HOWTO (R_MIPS_TLS_DTPREL64, /* type */
0, /* rightshift */
@@ -1419,8 +1432,22 @@ static reloc_howto_type mips_elf64_howto
0x0000ffff, /* dst_mask */
FALSE), /* pcrel_offset */
+ /* TLS IE dynamic relocations. */
EMPTY_HOWTO (R_MIPS_TLS_TPREL32),
- EMPTY_HOWTO (R_MIPS_TLS_TPREL64),
+
+ HOWTO (R_MIPS_TLS_TPREL64, /* type */
+ 0, /* rightshift */
+ 4, /* size (0 = byte, 1 = short, 2 = long) */
+ 64, /* bitsize */
+ FALSE, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_dont, /* complain_on_overflow */
+ _bfd_mips_elf_generic_reloc, /* special_function */
+ "R_MIPS_TLS_TPREL64", /* name */
+ TRUE, /* partial_inplace */
+ MINUS_ONE, /* src_mask */
+ MINUS_ONE, /* dst_mask */
+ FALSE), /* pcrel_offset */
/* TLS thread pointer offset. */
HOWTO (R_MIPS_TLS_TPREL_HI16, /* type */
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] MIPS/BFD: Handle RELA TLS_DTPMOD64 and TLS_TPREL64 relocs
2009-09-01 23:40 [PATCH] MIPS/BFD: Handle RELA TLS_DTPMOD64 and TLS_TPREL64 relocs Maciej W. Rozycki
@ 2009-09-03 2:46 ` Alan Modra
0 siblings, 0 replies; 2+ messages in thread
From: Alan Modra @ 2009-09-03 2:46 UTC (permalink / raw)
To: Maciej W. Rozycki; +Cc: binutils, Maciej W. Rozycki
On Wed, Sep 02, 2009 at 12:40:00AM +0100, Maciej W. Rozycki wrote:
> * elf64-mips.c (mips_elf64_howto_table_rela): Add support for
> R_MIPS_TLS_DTPMOD64 and R_MIPS_TLS_TPREL64, replacing the
> respective stubs.
OK.
--
Alan Modra
Australia Development Lab, IBM
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2009-09-03 2:46 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-09-01 23:40 [PATCH] MIPS/BFD: Handle RELA TLS_DTPMOD64 and TLS_TPREL64 relocs Maciej W. Rozycki
2009-09-03 2:46 ` Alan Modra
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).