mirror of
https://github.com/bminor/binutils-gdb.git
synced 2025-12-28 01:50:48 +00:00
Treat a prefix of "$SYSROOT" in the same way as "=" when parsing linker search paths.
PR ld/21251 * ldfile.c (ldfile_add_library_path): If the path starts with $SYSROOT then use the sysroot as the real prefix. * ldlang.c (lang_add_input_file): Treat $SYSROOT in the same way as =. * ldlex.l: Add $SYSROOT as allow prefix for a filename. * ld.texinfo (-L): Document that $SYSROOT acts like = when prefixing a library search path. (INPUT): Likewise. * testsuite/ld-scripts/sysroot-prefix.exp: Add $SYSROOT prefix tests.
This commit is contained in:
@@ -112,6 +112,8 @@ ldfile_add_library_path (const char *name, bfd_boolean cmdline)
|
||||
now. */
|
||||
if (name[0] == '=')
|
||||
new_dirs->name = concat (ld_sysroot, name + 1, (const char *) NULL);
|
||||
else if (CONST_STRNEQ (name, "$SYSROOT"))
|
||||
new_dirs->name = concat (ld_sysroot, name + strlen ("$SYSROOT"), (const char *) NULL);
|
||||
else
|
||||
new_dirs->name = xstrdup (name);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user