From 8ce8d223a716e16cd3ffd3aaa04d4dee7d35d4dd Mon Sep 17 00:00:00 2001 From: Igor Pashev Date: Mon, 3 Dec 2012 19:01:30 +0400 Subject: GNU binutils 2.22+ --- binutils/patches/140_pr10340.patch | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 binutils/patches/140_pr10340.patch (limited to 'binutils/patches/140_pr10340.patch') diff --git a/binutils/patches/140_pr10340.patch b/binutils/patches/140_pr10340.patch new file mode 100644 index 0000000..349d863 --- /dev/null +++ b/binutils/patches/140_pr10340.patch @@ -0,0 +1,35 @@ +# DP: Proposed patch for PR ld/10340, ld doesn't honor sysroot prefix for ldscripts + +Signed-off-by: Sven Rebhan + +Always try to prepend the sysroot prefix to absolute filenames first. + +--- a/ld/ldfile.c ++++ b/ld/ldfile.c +@@ -308,18 +308,24 @@ + directory first. */ + if (! entry->is_archive) + { +- if (entry->sysrooted && IS_ABSOLUTE_PATH (entry->filename)) ++ /* For absolute pathnames, try to always open the file in the ++ sysroot first. If this fails, try to open the file at the ++ given location. */ ++ entry->sysrooted = is_sysrooted_pathname(entry->filename, FALSE); ++ if (IS_ABSOLUTE_PATH (entry->filename) && ld_sysroot && ! entry->sysrooted) + { + char *name = concat (ld_sysroot, entry->filename, + (const char *) NULL); + if (ldfile_try_open_bfd (name, entry)) + { + entry->filename = name; ++ entry->sysrooted = TRUE; + return TRUE; + } + free (name); + } +- else if (ldfile_try_open_bfd (entry->filename, entry)) ++ ++ if (ldfile_try_open_bfd (entry->filename, entry)) + { + entry->sysrooted = IS_ABSOLUTE_PATH (entry->filename) + && is_sysrooted_pathname (entry->filename, TRUE); -- cgit v1.2.3