RFC: Change readelf/objdump to automatically follow debug links

Nick Clifton nickc@redhat.com
Mon Mar 1 13:53:03 GMT 2021


Hi Mark,

> But secondly it combines this with dumping sections from the linked
> files itself (intermixed with dumping the sections of the actual input
> file). This might be useful to some users, but is very confusion for
> tools relying on just dumping (debug) sections from specific file. The
> dwz and debugedit testsuites get very confused by this. And it causes
> bugs like PR27486 and PR27478
> 
> Could these features be split (--follow-links vs --dump-links) with the
> first possibly being made the default and the second only on request of
> the user?

I think that this is already done.  Ie =follow-links is on by default
but =dump-links is off by default.  (The =dump-links option just displays
the contents of link sections, it does not mean 'show the contents of
sections in linked files').

 From what you have said however it sounds as if users want readelf to
follow links, and display the contents of sections in linked files, only
if this has been explicitly requested.  (Or possibly only when processing
debugging info is some way).  But there is a problem: the change to
following debug links by default came about because objdump's disassembler
was not taking advantage of the symbol tables in debug info files.  So
for some non-debug-info related tasks we do want to follow the links and
load the files, but for others we do not.  I am not sure how this can
resolved.

Cheers
   Nick

PS.  Just to be clear there is an option to disable the automatic
   following of links, so users do already have control over readelf's
   behaviour.  It is more a case of choosing what the default behaviour
   should be.



More information about the Binutils mailing list