Reputation: 745
How can I trace the gcc ld linker linking process? I need to see how it link with function from shared objects.
Upvotes: 4
Views: 2761
Reputation: 1714
as saving a log file can help dig into later issues, I prefer this flags: -Wl,-Map,linker.log
. in which you can search and we can also save it inside repository for later usage
Upvotes: 0
Reputation: 33719
Depending on what you are after, you can pass either -Wl,--trace
or -Wl,--cref
to gcc
, instructing the linker to print additional details about the linking process:
If you are interested in a particular symbol, say SYMBOL
, you could try -Wl,--trace-symbol,SYMBOL
as well.
(This assumes that you are using binutils ld
, of course.)
Upvotes: 9