6

How to determine which linker is used by my gcc?
For example I have 3 linkers:
2 in one directory, same place as for gcc
and another one linker in another directory.

Jens
  • 69,818
  • 15
  • 125
  • 179
Laser
  • 6,652
  • 8
  • 54
  • 85

1 Answers1

11

You may add -Wl,-verbose to your gcc link command or use

gcc -print-prog-name=ld
Stephane Rouberol
  • 4,286
  • 19
  • 18
  • Do you know, can I select linker with some gcc option? – Laser Sep 10 '12 at 06:10
  • Yes, the `-B` option sets the binary search path. But beware, the above command tells you where the `ld` binary is. It doesn't tell you if your GCC is configured to use something else, such as `ld.gold`, although it probably isn't. – ams Sep 10 '12 at 09:00
  • 1
    Oh, and if `-print-prog-name=ld` returns just `ld` then that means GCC is just using whatever `ld` is on the ordinary `$PATH`. – ams Sep 10 '12 at 09:05