cgccld

Trace gcc linker linking process


How can I trace the gcc ld linker linking process? I need to see how it link with function from shared objects.


Solution

  • 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.)