1 # DP: Proposed patch for PR ld/10340, ld doesn't honor sysroot prefix for ldscripts
3 Signed-off-by: Sven Rebhan <odinshorse@googlemail.com>
5 Always try to prepend the sysroot prefix to absolute filenames first.
11 if (! entry->is_archive)
13 - if (entry->sysrooted && IS_ABSOLUTE_PATH (entry->filename))
14 + /* For absolute pathnames, try to always open the file in the
15 + sysroot first. If this fails, try to open the file at the
17 + entry->sysrooted = is_sysrooted_pathname(entry->filename, FALSE);
18 + if (IS_ABSOLUTE_PATH (entry->filename) && ld_sysroot && ! entry->sysrooted)
20 char *name = concat (ld_sysroot, entry->filename,
22 if (ldfile_try_open_bfd (name, entry))
24 entry->filename = name;
25 + entry->sysrooted = TRUE;
30 - else if (ldfile_try_open_bfd (entry->filename, entry))
32 + if (ldfile_try_open_bfd (entry->filename, entry))
34 entry->sysrooted = IS_ABSOLUTE_PATH (entry->filename)
35 && is_sysrooted_pathname (entry->filename, TRUE);