Index: ELF/LinkerScript.cpp =================================================================== --- ELF/LinkerScript.cpp +++ ELF/LinkerScript.cpp @@ -577,6 +577,7 @@ unsigned readPhdrType(); void readSymbolAssignment(StringRef Name); std::vector readSectionsCommandExpr(); + void readAt(); const static StringMap Cmd; ScriptConfiguration &Opt = *ScriptConfig; @@ -789,10 +790,23 @@ Opt.Commands.push_back(llvm::make_unique(".", Expr)); } +void ScriptParser::readAt() { + warning("AT command is ignored"); + expect("AT"); + expect("("); + while (!Error) { + StringRef Tok = next(); + if (Tok == ")") + break; + } +} + void ScriptParser::readOutputSectionDescription(StringRef OutSec) { OutputSectionCommand *Cmd = new OutputSectionCommand(OutSec); Opt.Commands.emplace_back(Cmd); expect(":"); + if (peek() == "AT") + readAt(); expect("{"); while (!Error && !skip("}")) { Index: test/ELF/linkerscript-at.s =================================================================== --- test/ELF/linkerscript-at.s +++ test/ELF/linkerscript-at.s @@ -0,0 +1,10 @@ +# REQUIRES: x86 +# RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux %s -o %t +# RUN: echo "SECTIONS { \ +# RUN: .aaa : AT(0x0) \ +# RUN: { \ +# RUN: } \ +# RUN: }" > %t.script +# RUN: ld.lld -shared %t --script %t.script -o %t2 2>&1 | \ +# RUN: FileCheck --check-prefix=IGNORED %s +# IGNORED: AT command is ignored