1 Signed-off-by: Sven Rebhan <odinshorse@googlemail.com>
3 Always try to prepend the sysroot prefix to absolute filenames first.
5 http://bugs.gentoo.org/275666
6 http://sourceware.org/bugzilla/show_bug.cgi?id=10340
12 if (! entry->is_archive)
14 - if (entry->sysrooted && IS_ABSOLUTE_PATH (entry->filename))
15 + /* For absolute pathnames, try to always open the file in the
16 + sysroot first. If this fails, try to open the file at the
18 + entry->sysrooted = is_sysrooted_pathname(entry->filename, FALSE);
19 + if (IS_ABSOLUTE_PATH (entry->filename) && ld_sysroot && ! entry->sysrooted)
21 char *name = concat (ld_sysroot, entry->filename,
23 if (ldfile_try_open_bfd (name, entry))
25 entry->filename = name;
26 + entry->sysrooted = TRUE;
31 - else if (ldfile_try_open_bfd (entry->filename, entry))
33 + if (ldfile_try_open_bfd (entry->filename, entry))
35 entry->sysrooted = IS_ABSOLUTE_PATH (entry->filename)
36 && is_sysrooted_pathname (entry->filename, TRUE);