diff options
Diffstat (limited to 'lld/ELF/ScriptParser.cpp')
| -rw-r--r-- | lld/ELF/ScriptParser.cpp | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/lld/ELF/ScriptParser.cpp b/lld/ELF/ScriptParser.cpp index fc6b8e337f4..61e682cdc9b 100644 --- a/lld/ELF/ScriptParser.cpp +++ b/lld/ELF/ScriptParser.cpp @@ -568,10 +568,20 @@ ScriptParser::readOutputSectionDescription(StringRef OutSec) { OutputSectionCommand *Cmd = Script->createOutputSectionCommand(OutSec, getCurrentLocation()); - // Read an address expression. - // https://sourceware.org/binutils/docs/ld/Output-Section-Address.html - if (peek() != ":") - Cmd->AddrExpr = readExpr(); + if (peek() != ":") { + // Read an address expression. + // https://sourceware.org/binutils/docs/ld/Output-Section-Address.html + if (peek() != "(") + Cmd->AddrExpr = readExpr(); + + // Read a section type. Currently, only NOLOAD is supported. + // https://sourceware.org/binutils/docs/ld/Output-Section-Type.html + if (consume("(")) { + expect("NOLOAD"); + expect(")"); + Cmd->Noload = true; + } + } expect(":"); |

