summaryrefslogtreecommitdiff
path: root/ld/ldlex.l
diff options
context:
space:
mode:
authorNick Clifton <nickc@redhat.com>2017-05-18 15:07:59 +0100
committerNick Clifton <nickc@redhat.com>2017-05-18 15:07:59 +0100
commit3aa2d05a728216bbb99dbb5718be9bb36429cf41 (patch)
tree634ea00884160b88e1c0c55154b963ab3652e077 /ld/ldlex.l
parent59cc050d893d1e8c75547de950a35e809588f12f (diff)
downloadbinutils-gdb-3aa2d05a728216bbb99dbb5718be9bb36429cf41.tar.gz
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.
Diffstat (limited to 'ld/ldlex.l')
-rw-r--r--ld/ldlex.l5
1 files changed, 5 insertions, 0 deletions
diff --git a/ld/ldlex.l b/ld/ldlex.l
index fa9b9244261..acba1a2b4b6 100644
--- a/ld/ldlex.l
+++ b/ld/ldlex.l
@@ -380,6 +380,11 @@ V_IDENTIFIER [*?.$_a-zA-Z\[\]\-\!\^\\]([*?.$_a-zA-Z0-9\[\]\-\!\^\\]|::)*
yylval.name = xstrdup (yytext);
return NAME;
}
+<INPUTLIST>"$SYSROOT"{FILENAMECHAR1}{FILENAMECHAR}* {
+/* Filename to be prefixed by --sysroot or when non-sysrooted, nothing. */
+ yylval.name = xstrdup (yytext);
+ return NAME;
+ }
<BOTH,INPUTLIST>"-l"{FILENAMECHAR}+ {
yylval.name = xstrdup (yytext + 2);
return LNAME;