This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: gnu ld searchpath


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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]