This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
[gold] Fix empty filename error
- From: Richard Sandiford <richard dot sandiford at linaro dot org>
- To: binutils at sourceware dot org
- Date: Tue, 12 Oct 2010 09:21:57 +0100
- Subject: [gold] Fix empty filename error
While using gold to build a sysrooted arm-linux-gnueabi GCC cross toolchain,
I got:
/arm-linux-gnueabi-ld: error: cannot open : No such file or directory
from the libjava install phase, which was trying to relink the libraries.
I'm not yet sure why this only failed during the relink and not during the
original link -- that's probably a GCC build problem -- but... the error came
from the lookup of libgcc.a. Case 4 in find_file() finds the correct file
in the default search path, but fails to initialise the two output filename
parameters. We'd then try to open the empty filename.
Tested on arm-linux-gnueabi, where it allows the build to complete
successfully. OK to install?
(I couldn't see any previous reports of this, but sorry in advance
if the patch is a duplicate.)
Richard
gold/
* fileread.cc (Input_file::find_file): Initialize *found_name
and *namep when using the fallback search for case 4.
Index: gold/fileread.cc
===================================================================
--- gold/fileread.cc 2010-09-02 14:17:12.000000000 +0100
+++ gold/fileread.cc 2010-10-12 08:58:26.000000000 +0100
@@ -963,6 +963,8 @@ Input_file::find_file(const Dirsearch& d
input_argument->name());
return false;
}
+ *found_name = input_argument->name();
+ *namep = name;
*pindex = index + 1;
return true;
}