bug-binutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: readelf: also dump the address contained in offset on R_386_RELATIVE


From: Nick Clifton
Subject: Re: readelf: also dump the address contained in offset on R_386_RELATIVE relocs
Date: Tue, 11 Jan 2022 13:57:44 +0000
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.3.0

Hi Andrea,

I see that, when dumping R_386_RELATIVE relocs in readelf, the format is
like this

    Offset     Info    Type            Sym.Value  Sym. Name
   00003d01  00000008 R_386_RELATIVE


If I understand that type of relocation correctly, another information
is missing: the address contained at the given offset, which ld.so adds
to the load address of the module and then overwrites at the same
offset.

I think it is reasonable to provide that information.  Some users might
need it for debugging or learning purposes.

It could indeed be useful, but there is a downside: adding extra information
like this tends to break the binutils testsuites (since some tests wll not
be expecting the extra output) - and more seriously, it tends to break user
scripts that expect readelf's output to be in a certain format.

This is not to say that the feature should not be added, but rather than it
would probably be best to have it as an optional extra, controlled via a
command line option.  (Eg the --arch-specific option).

Also, this looks like it might be a suitable project for someone interested
in learning about the binutils.  So I am hoping that you, or someone else
will volunteer to have a go ... :-)

Cheers
  Nick





reply via email to

[Prev in Thread] Current Thread [Next in Thread]