This is the mail archive of the binutils@sources.redhat.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]
Other format: [Raw text]

Re: Bug in gas generating sh PIC, or is it me?


On Fri, Nov 29, 2002 at 06:30:30PM -0500, Graeme Peterson wrote:
> I think I may have found a bug in the sh PIC stuff in gas.

You have.  This code

    case BFD_RELOC_32_PLT_PCREL:
      /* Make the jump instruction point to the address of the operand.  At
	 runtime we merely add the offset to the actual PLT entry.  */
      * valP = 0xfffffffc;
      val = 0;

in tc-sh.c:md_apply_fix3 totally ignores the add_number passed in
(which happens to also be fixP->fx_offset in this case), and tc_gen_reloc
also ignores fx_offset for this reloc type.  You can see this by
assembling

	.long bar@PLT + . - .L4 - x

with varying constants for "x".  You'll get the same object file
regardless of "x", but if you trace under gdb you'll see that the
generic parts of gas are setting the fixup structure properly.

-- 
Alan Modra
IBM OzLabs - Linux Technology Centre


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