This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Re: ld input file and INPUT command - file location problem
- From: "Galit Heller" <Galit dot Heller at nsc dot com>
- To: binutils at sources dot redhat dot com
- Date: Thu, 30 Oct 2003 22:09:17 +0200
- Subject: Re: ld input file and INPUT command - file location problem
- References: <3F9BA45B.4AC81F2C@nsc.com> <m3oevykfz9.fsf@redhat.com>
Hi Nick,
> > When a library file is the argument to INPUT command, the archive
> > library search path is searched, and the archive is found. However,
> > for object files the search path isn't searched. E.g. if file.o
> > resides in .., and -L.. is used in the command line, and the linker
> > script has the line:
> >
> > INPUT(file.o)
> >
> > then ld returns the following error:
> > "cannot open file.o": No such file or directory".
>
> Which version of the sources are you using ? I tried the current
> sources in the CVS repository and could not reproduce this failure.
You are absolutely right. I cannot reproduce this either, although
I was certain that it happened several times before sending in the
report. Either the test case wasn't as general as I thought, or the
error output of the second problem mislead me (solved by you below).
If I encounter the problem again I'll report it.
> Please could you try out the patch below and let me know if it solves
> the problem for you ?
>
> Cheers
> Nick
>
> 2003-10-30 Nick Clifton <nickc@redhat.com>
>
> * ldlang.c (lookup_name): When looking for a previously loaded
> file compare the local_sym_name not the filename, as the
> filename might have been transformed via the search directory
> path lookup.
> If the sought-for file has not been found in the input file
> chain then create a new node with the search_dirs_flag set so
> that the entire set of directory paths will be scanned for it.
Yes, it certainly does solve it (for both objects and archives).
Thank you,
Galit.