Link Issue: /usr/bin/ld: cannot find : No such file or directory

Alan Modra amodra@gmail.com
Wed Aug 15 02:26:00 GMT 2012


On Tue, Aug 14, 2012 at 08:57:43PM -0400, Jeffrey Walton wrote:
> Hi All,
> 
> I'm getting an unexpected complaint from LD that it can't find
> something. I'm not sure what LD cannot find, even after passing
> --verbose.
> 
> $ g++ -g3 -O0 sample.cpp -o sample.exe -Wall -Wextra -Wconversion
> -fPIE -pie -fstack-protector-all -Wl,-z,noexecstack -Wl,-z,noexecheap
> -Wl,-z,relro, -Wl,-z,now
> /usr/bin/ld: warning: -z noexecheap ignored.
> /usr/bin/ld: cannot find : No such file or directory
> collect2: ld returned 1 exit status

Try adding -Wl,-v to see how g++ is invoking ld.  You might need to
dump that output to a file then inspect with a hex editor to find some
weird filename.

-- 
Alan Modra
Australia Development Lab, IBM



More information about the Binutils mailing list