RFC: Change readelf/objdump to automatically follow debug links

Mark Wielaard mark@klomp.org
Mon Mar 1 12:43:31 GMT 2021

Hi Nick,

On Wed, 2021-02-10 at 10:30 +0000, Nick Clifton via Binutils wrote:
>   I received a bug report from a Fedora rawhide user[1] that requests
>   that the objdump program should follow debug links automatically when
>   it is disassembling code.  The request seems reasonable to me, given
>   that many distributions these days make use of separate debug info
>   files, so I have created the attached patch.
>   The patch adds a new configure time option --enable-follow-debugs-links=[yes|no]
>   which can be used to set the default behaviour for both objdump and
>   readelf.  If the option is not used, the default is to follow the
>   links.
>   What do people think ?  Any objections to this idea ?

As discussed on the dwz mailinglist already, making this the default
breaks various things when made the default. That is because it seems
to mix two concepts. First displaying information from linked files,
like strings from an alt/dup file when displaying debug-dump sections.
This part seems fine and could even be the default (eu-readelf does
this by default).

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?



More information about the Binutils mailing list