This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: gnu ld searchpath
- From: "H.J. Lu" <hjl dot tools at gmail dot com>
- To: Vinitha Vijayan <vinitha dot vijayann at gmail dot com>
- Cc: Binutils <binutils at sourceware dot org>
- Date: Thu, 28 May 2015 05:01:42 -0700
- Subject: Re: gnu ld searchpath
- Authentication-results: sourceware.org; auth=none
- References: <CABcFW_ga=BeLYT0Dc33L8qmgrVMEAj=AAhUQ-t1EwXP5afT-fg at mail dot gmail dot com>
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.