This is the mail archive of the binutils@sources.redhat.com 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: linker file/section matching rules when using libraries


"Nick Kelsey" <fsf@silicondust.com> writes:

> > If you name an archive, the mapping will be applied to every object in
> > the archive.  At least, that is how it is supposed to work.
> 
> I ran some more tests...
> 
> I have just discovered that it works if I give the path (absolute or
> relative) but it can't find it using the -L search paths.
> 
> The libraries all link ok normally with the search path.
> 
> Is this a bug?

No.  When you name a file in a wildcard statement the linker doesn't
make any special effort to find it.

I quote the documentation:

    When you use a file name which does not contain any wild card
    characters, the linker will first see if you also specified the file
    name on the linker command line or in an @code{INPUT} command.  If you
    did not, the linker will attempt to open the file as an input file, as
    though it appeared on the command line.  Note that this differs from an
    @code{INPUT} command, because the linker will not search for the file in
    the archive search path.

In other words, if you want to search for the library, either put it
on the command line, or use an INPUT statement.

Ian


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