From d021a9004a0193cbe68ac45214b6f2736851ec47 Mon Sep 17 00:00:00 2001 From: emaste Date: Thu, 18 Jan 2018 21:39:19 +0000 Subject: [PATCH] lld: Handle parsing AT(ADDR(.foo-bar)). The problem we had with it is that anything inside an AT is an expression, so we failed to parse the section name because of the - in it. Requested by: royger Obtained from: LLVM r322801 by Rafael Espindola --- contrib/llvm/tools/lld/ELF/ScriptParser.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/contrib/llvm/tools/lld/ELF/ScriptParser.cpp b/contrib/llvm/tools/lld/ELF/ScriptParser.cpp index 435b3b28f4f2..e068beeee262 100644 --- a/contrib/llvm/tools/lld/ELF/ScriptParser.cpp +++ b/contrib/llvm/tools/lld/ELF/ScriptParser.cpp @@ -930,7 +930,10 @@ ByteCommand *ScriptParser::readByteCommand(StringRef Tok) { StringRef ScriptParser::readParenLiteral() { expect("("); + bool Orig = InExpr; + InExpr = false; StringRef Tok = next(); + InExpr = Orig; expect(")"); return Tok; }