Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Trace gcc linker linking process

Tags:

c

gcc

ld

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

like image 985
mnabil Avatar asked Oct 21 '25 15:10

mnabil


1 Answers

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:

  • --trace option
  • --cref option

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

like image 116
Florian Weimer Avatar answered Oct 24 '25 05:10

Florian Weimer



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!