This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: Fix -q for x86 ELF after TLS descriptor changes
- From: Alan Modra <amodra at bigpond dot net dot au>
- To: binutils at sourceware dot org, richard at codesourcery dot com
- Date: Tue, 28 Feb 2006 09:39:25 +1030
- Subject: Re: Fix -q for x86 ELF after TLS descriptor changes
- References: <87u0akwq8m.fsf@talisman.home>
On Mon, Feb 27, 2006 at 07:34:01PM +0000, Richard Sandiford wrote:
> One of the quirks of VxWorks is that -q (aka --emit-relocs) is standard
> for user-mode executables. This showed up the fact that --emit-relocs
> no longer works for x86 ELF targets after the recent TLS descriptor
> changes.
I suspect that --emit-relocs is still not correct on x86. TLS code
sequences and relocs are edited in relocate_section, but I don't see the
new reloc being written back to the reloc array. That means -q will
output the original reloc, so eg. you might get a GD reloc for what has
become an IE code sequence. Whether this matters for VxWorks I can't
say, but I needed to fix the same problem on powerpc for our FDPR-Pro
people.
> bfd/
> * elf32-i386.c (elf_i386_link_hash_table): Add next_tls_desc_index.
> (elf_i386_link_hash_table_create): Initialize it.
> (elf_i386_compute_jump_table_size): Use it instead of
> srelplt->reloc_count.
> (allocate_dynrelocs): Likewise.
> (elf_i386_size_dynamic_sections): Likewise.
> (elf_i386_relocate_section): Likewise.
>
> ld/testsuite/
> * ld-i386/emit-relocs.s, ld-i386/emit-relocs.d: New test.
> * ld-i386/i386.exp: Run it.
OK.
--
Alan Modra
IBM OzLabs - Linux Technology Centre