This is the mail archive of the binutils@sourceware.cygnus.com mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: PATCH for GOT16 handling


On Mon, Aug 09, 1999 at 03:52:31PM -0700, Mark Mitchell wrote:

> Also fixed is a problem with looking for matching GOT16 entries in the
> GOT.

> 	(mips_elf_got16_entry): Use mips_elf_high to calculate the value
> 	to use wheen looking for a preexisting GOT entry.

> *************** mips_elf_got16_entry (abfd, info, value)
> *** 5537,5543 ****
>     bfd_vma index;
>     bfd_vma address;
>   
> !   value &= 0xffff0000;
>     g = mips_elf_got_info (elf_hash_table (info)->dynobj, &sgot);
>   
>     /* Look to see if we already have an appropriate entry.  */
> --- 5537,5547 ----
>     bfd_vma index;
>     bfd_vma address;
>   
> !   /* Although the ABI says that it is "the high-order 16 bits" that we
> !      want, it is really the %high value.  The complete value is
> !      calculated with a `addiu' of a LO16 relocation, just as with a
> !      HI16/LO16 pair.  */
> !   value = mips_elf_high (value);
>     g = mips_elf_got_info (elf_hash_table (info)->dynobj, &sgot);
>   
>     /* Look to see if we already have an appropriate entry.  */

This is broken, try test case #11 which will show you a bad got.  The
correct fix is to just add change the mips_elf_high() line into
value += 0x8000.

  Ralf

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]