This is the mail archive of the
binutils@sourceware.cygnus.com
mailing list for the binutils project.
RE: Sorting entries in dynamic relocation
- To: 'Ian Lance Taylor' <ian at zembu dot com>, knk at dde dot dk
- Subject: RE: Sorting entries in dynamic relocation
- From: Donn Terry <donnte at microsoft dot com>
- Date: Wed, 8 Mar 2000 11:09:50 -0800
- Cc: binutils at sourceware dot cygnus dot com
In the FW(little)IW department: in code I haven't officially
submitted yet (and can't until various things I don't
have full control over happen) I do sort the dynamic relocations
without problem. As Ian suggests, near
the end of *_final_link is a good place. I just sort the
internal relocations (as that's the only relevant part for
me, anyway).
No magic involved; just find the right section and sort it
with qsort().
Donn Terry
> -----Original Message-----
> From: Ian Lance Taylor [mailto:ian@zembu.com]
> Sent: Wednesday, March 08, 2000 10:59 AM
> To: knk@dde.dk
> Cc: binutils@sourceware.cygnus.com
> Subject: Re: Sorting entries in dynamic relocation
>
>
> Date: Wed, 08 Mar 2000 17:09:07 -0700
> From: Koundinya K <knk@dde.dk>
>
> The entries in the dynamic relocation section must be ordered by
> increasing r_symndx value.
>
> In case I need to put some code for this, where could this
> probably fit
> into ?.
>
> Off hand I can't think of anything that points to dynamic relocations,
> so I think this should be more or less straightforward. Unless I've
> forgotten something. Do the sort somewhere near the end of
> _bfd_mips_elf_final_link.
>
> Are any other targets doing this ??.
>
> Not that I know of.
>
> The R_MIPS_REL32 relocation type is the only relocation
> performed by the
> dynamic linker. The value EA used by the dynamic linker to
> relocate an
> R_MIPS_REL32 relocation depends on its r_symndx value. If
> the relocation
> entry r_symndx is less then DT_MIPS_GOTSYM, the value of EA is the
> symbol st_value plus displacement. Otherwise the value of EA is the
> value in the GOT entry corresponding to the relocation
> entry r_symndx.
>
>
> I am not getting what this "displacement" is. Can you
> please clarify ??.
>
> I don't know off hand. I don't have my copy of the MIPS ELF ABI with
> me. The desired result is clear enough; whatever calculation causes
> that result is the right one.
>
> Ian
>