[PATCH] elf: Dump SHT_RELR relocations for objdump -R

H.J. Lu hjl.tools@gmail.com
Tue Feb 25 09:29:37 GMT 2025


On Tue, Feb 25, 2025 at 5:24 PM Nick Clifton <nickc@redhat.com> wrote:
>
> Hi H.J.
>
> > Update _bfd_elf_get_dynamic_reloc_upper_bound to count SHT_RELR
> > relocations and update _bfd_elf_canonicalize_dynamic_reloc to slurp
> > them. The backend only needs to define elf_dt_relr_reloc_howto for the
> > pointer to reloc_howto_type for SHT_RELR relocation type which typically
> > is R_*_RELATIVE.
>
> I prefer the current solution - having objdump tell users to use readelf
> if they want to see RELR relocation dumps - on the grounds that it keeps
> things (slightly) simpler.  Adding code to the BFD library is adding the
> potential for more bugs, and if readelf can already do the job then why
> not just leave it at that ?
>

This is for consistency.  BFD library provides

bfd_get_dynamic_reloc_upper_bound
bfd_canonicalize_dynamic_reloc

They should cover all dynamic relocations.  objdump is just one of
users of BFD library.

-- 
H.J.


More information about the Binutils mailing list