mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-06-20 01:50:24 +08: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:
@ -1138,11 +1138,14 @@ lang_add_input_file (const char *name,
|
||||
lang_input_file_enum_type file_type,
|
||||
const char *target)
|
||||
{
|
||||
if (name != NULL && *name == '=')
|
||||
if (name != NULL
|
||||
&& (*name == '=' || CONST_STRNEQ (name, "$SYSROOT")))
|
||||
{
|
||||
lang_input_statement_type *ret;
|
||||
char *sysrooted_name
|
||||
= concat (ld_sysroot, name + 1, (const char *) NULL);
|
||||
= concat (ld_sysroot,
|
||||
name + (*name == '=' ? 1 : strlen ("$SYSROOT")),
|
||||
(const char *) NULL);
|
||||
|
||||
/* We've now forcibly prepended the sysroot, making the input
|
||||
file independent of the context. Therefore, temporarily
|
||||
|
Reference in New Issue
Block a user