Index: lld/trunk/ELF/ScriptParser.cpp =================================================================== --- lld/trunk/ELF/ScriptParser.cpp +++ lld/trunk/ELF/ScriptParser.cpp @@ -652,6 +652,8 @@ if (consume(">")) Cmd->MemoryRegionName = next(); + else if (peek().startswith(">")) + Cmd->MemoryRegionName = next().drop_front(); Cmd->Phdrs = readOutputSectionPhdrs(); Index: lld/trunk/test/ELF/linkerscript/memory.s =================================================================== --- lld/trunk/test/ELF/linkerscript/memory.s +++ lld/trunk/test/ELF/linkerscript/memory.s @@ -21,8 +21,8 @@ # RUN: rom (rx) : org = (0x80 * 0x1000 * 0x1000), len = 64M \ # RUN: } \ # RUN: SECTIONS { \ -# RUN: .text : { *(.text) } > rom \ -# RUN: .data : { *(.data) } > ram \ +# RUN: .text : { *(.text) } >rom \ +# RUN: .data : { *(.data) } >ram \ # RUN: }" > %t.script # RUN: ld.lld -o %t1 --script %t.script %t # RUN: llvm-objdump -section-headers %t1 | FileCheck -check-prefix=RAMROM %s