ld input file and INPUT command - file location problem
Galit Heller
Galit.Heller@nsc.com
Thu Oct 30 20:06:00 GMT 2003
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.
More information about the Binutils
mailing list