gnu ld searchpath
H.J. Lu
hjl.tools@gmail.com
Thu May 28 12:01:00 GMT 2015
On Thu, May 28, 2015 at 4:53 AM, Vinitha Vijayan
<vinitha.vijayann@gmail.com> wrote:
> Hi,
> Sorry if I am posting to a wrong mailing list.
>
> As per the gnu ld documentation,
> " The linker uses the following search paths to locate required shared
> libraries:
The key words here are "required shared libraries". It is for libraries listed
in DT_NEEDED.
> Does this mean, if I have placed a local shared lib " libfoo.so" in a
> local path e.g, /usr/local/foo/lib and add this path in
> /etc/ld.so.conf or /etc/ld.so.conf.d/libfoo.conf, the following will
> work ?
>
> gcc main.c -lfoo
>
> The above doesn't seems to work in with a native linker in a native
> armhf environment, unless I pass -L/usr/local/foo/lib in the command
> line.
>
> Is this the expected behavior for gnu ld ? And ld.so.conf file entries
> only affect runtime linker (ld-linux*.so) searchpaths ?
-lfoo doesn't ask for shared library. It can be libfoo.a and libfoo.so can
be a linker script.
--
H.J.
More information about the Binutils
mailing list