LD linker map, get absolute path of referenced files

Nick Clifton nickc@redhat.com
Wed Jan 13 11:08:21 GMT 2021


Hi Hugo,

> I have trouble parsing linker maps generated
> by ld 2.28, where examples over the internet seem to get absolute path
> right away. Here is the SO link to a more detailed/formated question:
> https://stackoverflow.com/questions/65514075/force-absolute-path-in-linker-maps

Currently linker maps always report the paths as they were provided on
the command line (or via library resolution and linker script parsing).
In order to report absolute paths it would be necessary to add code to
the linker to do this.  If this is a feature that you feel is important
then please file an enhancement request here:

   https://sourceware.org/bugzilla/enter_bug.cgi?product=binutils

If you would like to have a go at creating a patch to implement the feature
and submitting it along with the PR request that would be fantastic.  The
code you will want to edit is in ld/ldlang.c.


> I would  also be really interested on how to access the same kind of
> information over the dynamic linking step. Is there really no way to get
> more inside on what ld does during symbol resolution?

The dynamic linker is actually part of the glibc project, not the binutils
so you will probably be able to get more information by asking over there.
If you read the ld.so manual page you will see that there is an environment
variable LD_DEBUG which you can set in order to gain more information about
the dynamic linking process.

Cheers
   Nick




More information about the Binutils mailing list