This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: [PATCH, MIPS] More meaningful error message on small-data overflow
Adam Nemet wrote:
> Adam Nemet <anemet@caviumnetworks.com> writes:
> > Here is the new version. OK?
>
> Actually, it was incomplete. I needed to handle R_MIPS_LITERAL
> similarly to GPREL16.
>
> For a while I also thought that I would need to add similar code to
> _bfd_elf_mips_get_relocated_section_contents. It turns out that this
> hook is only used if the target changes during linking and the output
> target does not define a custom final_link function to handle the
> relocations (e.g. when using output format srec). In this case we
> have no access to the elf-mips-specific link table so we can't track
> whether the error was already printed so I decided not to do it.
> Therefore, this error message only works if the output format is also
> ELF but I don't think this is big loss.
>
> Is the new version OK?
>
> Adam
>
>
> * elfxx-mips.c (struct mips_elf_link_hash_table): Add new field
> small_data_overflow_reported.
> (_bfd_mips_elf_link_hash_table_create): Initialize it.
> (_bfd_mips_elf_relocate_section) <bfd_reloc_overflow>: Report
> small-data section overflow.
Ok.
Testcases for both relocations would be a nice addition, but I don't
insist on them. :-)
Thiemo