This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Re: Fix Relocs for x86-64
- To: Hans-Peter Nilsson <hans-peter dot nilsson at axis dot com>
- Subject: Re: Fix Relocs for x86-64
- From: Andreas Jaeger <aj at suse dot de>
- Date: 10 Mar 2001 10:02:48 +0100
- Cc: binutils at sources dot redhat dot com
- References: <200103091828.TAA19327@ignucius.axis.se>
Hans-Peter Nilsson <hans-peter.nilsson@axis.com> writes:
> > From: Andreas Jaeger <aj@suse.de>
> > Date: 07 Mar 2001 14:48:08 +0100
>
> > We didn't handle some relocations correctly for x86-64, I've committed
> > the appended patch to both branches after testing on both branches.
>
> I see the same hunk of code in several targets, but rarely a
> line indicating what situations the code reflects. If you
> happen to know and have this in clear memory, how about adding a
> descriptive comment line or two? See the DWARF comment. I'll
> help with an example which should match here.
>
> /* When creating a shared library, we can have an
> ordinary relocation for a symbol defined in a shared
> library (perhaps the one we create). We then make
> the relocation value zero, as it will be added into
> the relocation addend in this shared library.
> FIXME: Not sure this example covers the
> h->elf_link_hash_flags test. */
That description looks fine. What do others think? I'm in favour of
including it for x86-64.
Thanks,
Andreas
> > + || (info->shared
> > + && ((! info->symbolic && h->dynindx != -1)
> > + || (h->elf_link_hash_flags
> > + & ELF_LINK_HASH_DEF_REGULAR) == 0)
> > + && ( r_type == R_X86_64_8 ||
> > + r_type == R_X86_64_16 ||
> > + r_type == R_X86_64_32 ||
> > + r_type == R_X86_64_64 ||
> > + r_type == R_X86_64_PC16 ||
> > + r_type == R_X86_64_PC32)
> > + && ((input_section->flags & SEC_ALLOC) != 0
> > + /* DWARF will emit R_X86_64_32 relocations in its
> > + sections against symbols defined externally
> > + in shared libraries. We can't do anything
> > + with them here. */
> > + || ((input_section->flags & SEC_DEBUGGING) != 0
> > + && (h->elf_link_hash_flags
> > + & ELF_LINK_HASH_DEF_DYNAMIC) != 0))))
>
> brgds, H-P
>
--
Andreas Jaeger
SuSE Labs aj@suse.de
private aj@arthur.inka.de
http://www.suse.de/~aj