This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Re: ld doesn't relocate sysroot if called as tooldir/bin/ld
And here's the last bit I had to make the entire toolchain
relocatable. The linker wouldn't find linker scripts if it was called
from within tooldir/bin *and* the tree had been relocated. Ok to
install?
Index: ld/ChangeLog
from Alexandre Oliva <aoliva at redhat dot com>
* ldmain.c (set_scripts_dir): Look for relative to TOOLBINDIR as
well.
Index: ld/ldmain.c
===================================================================
RCS file: /cvs/uberbaum/ld/ldmain.c,v
retrieving revision 1.63
diff -u -p -r1.63 ldmain.c
--- ld/ldmain.c 25 Feb 2003 10:32:33 -0000 1.63
+++ ld/ldmain.c 26 Feb 2003 23:39:24 -0000
@@ -669,6 +669,14 @@ set_scripts_dir ()
if (dir)
free (dir);
+ dir = make_relative_prefix (program_name, TOOLBINDIR, SCRIPTDIR);
+ if (dir && check_for_scripts_dir (dir))
+ /* Success. Don't free dir. */
+ return;
+
+ if (dir)
+ free (dir);
+
if (check_for_scripts_dir (SCRIPTDIR))
/* We've been installed normally. */
return;
--
Alexandre Oliva Enjoy Guarana', see http://www.ic.unicamp.br/~oliva/
Red Hat GCC Developer aoliva at {redhat dot com, gcc.gnu.org}
CS PhD student at IC-Unicamp oliva at {lsd dot ic dot unicamp dot br, gnu.org}
Free Software Evangelist Professional serial bug killer