This is the mail archive of the binutils@sourceware.org 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: [PATCH] Fix MIPS16 section-relative addressing


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

Richard


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