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: Does ld/gold-l always simply add files to the command line


On Wed, Jul 26, 2017 at 1:44 PM, Niklas Hambüchen <mail@nh2.me> wrote:
>
> is the -l flag to ld and gold guaranteed to have the same effect as
> passing the found library file (.so or .a) directly on the command line?
>
> In other words, is it just "lookup convenience", or are there cases
> where -l might do something different than passing the relevant file
> directly?
>
> (I'm asking this for the GHC Haskell compiler, specifically for this
> linker related issue: https://ghc.haskell.org/trac/ghc/ticket/14031)

It is mostly just lookup convenience.  If you replace the -l option
with the full path of the library that is found, the result will be
almost identical.  The only differences I know of are error messages
and the soname that will be used for a shared library with no
DT_SONAME dynamic tag.

Ian


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