From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ralf Baechle To: Mark Mitchell Cc: binutils@sourceware.cygnus.com Subject: Re: PATCH for GOT16 handling Date: Mon, 09 Aug 1999 17:31:00 -0000 Message-id: <19990810023110.F31627@uni-koblenz.de> References: <19990809155231M.mitchell@codesourcery.com> X-SW-Source: 1999-08/msg00071.html 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