[PATCH] Fix MIPS16 section-relative addressing

Richard Sandiford richard@codesourcery.com
Wed Jul 26 22:10:00 GMT 2006


Hit send too early, sorry.

Richard Sandiford <richard@codesourcery.com> writes:
> Thiemo Seufer <ths@networkno.de> writes:
>> @@ -13578,6 +13573,10 @@ tc_gen_reloc (asection *section ATTRIBUT
>>    else
>>      reloc->addend = fixp->fx_addnumber;
>>  
>> +  /* Handle relocs adjusted against a section symbol.  */
>> +  if (fixp->fx_r_type == BFD_RELOC_MIPS16_JMP)
>> +    reloc->addend += fixp->fx_offset;
>> +
>>    /* Since the old MIPS ELF ABI uses Rel instead of Rela, encode the vtable
>>       entry to be used in the relocation's section offset.  */
>>    if (! HAVE_NEWABI && fixp->fx_r_type == BFD_RELOC_VTABLE_ENTRY)
>
> Can you add a comment saying why this special handling is only
> needed for BFD_RELOC_MIPS16_JMP?  Would it work if we removed the
> code above and at the same time removed the special "*valP = 0;"
> case in md_apply_fix3?  (This may be a daft question -- I haven't
> tried. ;))
>
> It just seems odd on the face of it that what is now a
> _bfd_mips_elf_generic_reloc

...is the only one to need this special handling.

Richard



More information about the Binutils mailing list