ld.gold doesn't like if -L points to not a directory

Ian Lance Taylor ian@airs.com
Sun Jul 3 04:17:00 GMT 2011
Arkadiusz Miskiewicz <arekm@maven.pl> writes:

> [arekm@ixion-pld ~]$ more ~/test/x.c
> int main() { return 0; }
> [arekm@ixion-pld ~]$ g++ -L/bin/sh ~/test/x.c
> /usr/bin/ld: error: /bin/sh: can not read directory: Not a directory
> collect2: ld returned 1 exit status
>
> but
>
> [arekm@ixion-pld ~]$ g++ -L/notexistant ~/test/x.c
> [arekm@ixion-pld ~]$
>
> (doesn't complain)
>
> $ ld --version
> GNU gold (Linux/GNU Binutils 2.21.52.0.2.20110610) 1.11
> [...]
>
> Note that ld.bfd has no trouble with -L pointing to not a directory (it simply 
> ignores that fact).
>
> IMO gold should match ld.bfd behaviour and simply ignore not a directories.

Makes sense.  Fixed like so.  Committed to mainline.

Ian


2011-07-02  Ian Lance Taylor  <iant@google.com>

	* dirsearch.cc (Dir_cache::read_files): Ignore ENOTDIR errors.


-------------- next part --------------
A non-text attachment was scrubbed...
Name: foo.patch
Type: text/x-patch
Size: 710 bytes
Desc: patch
URL: <https://sourceware.org/pipermail/binutils/attachments/20110703/03d72a6c/attachment.bin>


More information about the Binutils mailing list