diff --git a/lld/ELF/LinkerScript.cpp b/lld/ELF/LinkerScript.cpp index 103277729e3f..310392c3c18a 100644 --- a/lld/ELF/LinkerScript.cpp +++ b/lld/ELF/LinkerScript.cpp @@ -1330,7 +1330,7 @@ Expr ScriptParser::readPrimary() { // the next page boundary for simplicity. if (Tok == "DATA_SEGMENT_RELRO_END") { expect("("); - next(); + readExpr(); expect(","); readExpr(); expect(")"); diff --git a/lld/test/ELF/linkerscript/data-segment-relro.s b/lld/test/ELF/linkerscript/data-segment-relro.s index 94734110ca00..118be033c212 100644 --- a/lld/test/ELF/linkerscript/data-segment-relro.s +++ b/lld/test/ELF/linkerscript/data-segment-relro.s @@ -9,7 +9,7 @@ # RUN: . = DATA_SEGMENT_ALIGN (CONSTANT (MAXPAGESIZE), CONSTANT (COMMONPAGESIZE)); \ # RUN: .dynamic : { *(.dynamic) } \ # RUN: .got : { *(.got) } \ -# RUN: . = DATA_SEGMENT_RELRO_END (24, .); \ +# RUN: . = DATA_SEGMENT_RELRO_END (1 ? 24 : 0, .); \ # RUN: .got.plt : { *(.got.plt) } \ # RUN: .data : { *(.data) } \ # RUN: .bss : { *(.bss) } \