Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>I'm not sure that there is any option for simply printing the full effective search path.</p> <p>But: the search path consists of directories specified by <code>-L</code> options on the command line, followed by directories added to the search path by <code>SEARCH_DIR("...")</code> directives in the linker script(s). So you can work it out if you can see both of those, which you can do as follows:</p> <p>If you're invoking <code>ld</code> directly:</p> <ul> <li>The <code>-L</code> options are whatever you've said they are.</li> <li>To see the linker script, add the <code>--verbose</code> option. Look for the <code>SEARCH_DIR("...")</code> directives, usually near the top of the output. (Note that these are not necessarily the same for every invocation of <code>ld</code> -- the linker has a number of different built-in default linker scripts, and chooses between them based on various other linker options.)</li> </ul> <p>If you're linking via <code>gcc</code>:</p> <ul> <li>You can pass the <code>-v</code> option to <code>gcc</code> so that it shows you how it invokes the linker. In fact, it normally does not invoke <code>ld</code> directly, but indirectly via a tool called <code>collect2</code> (which lives in one of its internal directories), which in turn invokes <code>ld</code>. That will show you what <code>-L</code> options are being used.</li> <li>You can add <code>-Wl,--verbose</code> to the <code>gcc</code> options to make it pass <code>--verbose</code> through to the linker, to see the linker script as described above.</li> </ul>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload