Bug 16094 - ld searches LIBRARY_PATH and LD_LIBRARY_PATH but gold only searches LIBRARY_PATH
Summary: ld searches LIBRARY_PATH and LD_LIBRARY_PATH but gold only searches LIBRARY_PATH
Status: RESOLVED WONTFIX
Alias: None
Product: binutils
Classification: Unclassified
Component: gold (show other bugs)
Version: 2.22
: P2 minor
Target Milestone: ---
Assignee: Ian Lance Taylor
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-10-28 15:58 UTC by jbo
Modified: 2013-10-28 17:06 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description jbo 2013-10-28 15:58:41 UTC
I'm trying out gold on Ubuntu Linux 12.04 through the binutils-gold package v2.22-6ubuntu1.1 and it looks like while ld searches LIBRARY_PATH and LD_LIBRARY_PATH when linking, gold only searches LIBRARY_PATH. Is this intentional?
Comment 1 Cary Coutant 2013-10-28 17:00:49 UTC
Yes, it's intentional. LD_LIBRARY_PATH is the run-time search path for dynamic libraries, while LIBRARY_PATH is the link-time search path for libraries.

The Gnu linker searches for dynamic libraries with LD_LIBRARY_PATH while resolving symbolic references across shared libraries, and attempts to reproduce the dynamic linker's searching behavior. Gold, by design, does not do this.
Comment 2 jbo 2013-10-28 17:06:06 UTC
(In reply to Cary Coutant from comment #1)
> Yes, it's intentional. LD_LIBRARY_PATH is the run-time search path for
> dynamic libraries, while LIBRARY_PATH is the link-time search path for
> libraries.
> 
> The Gnu linker searches for dynamic libraries with LD_LIBRARY_PATH while
> resolving symbolic references across shared libraries, and attempts to
> reproduce the dynamic linker's searching behavior. Gold, by design, does not
> do this.

Yeah, that makes sense. Is there a mechanism for setting the system LIBRARY_PATH default in a similar way to the way LD_LIBRARY_PATH is set by ld.so.conf?