[PATCH] D35920: [ELF, LinkerScript] Memory region name parsing fix

Meador Inge via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jul 26 14:53:36 PDT 2017


This revision was automatically updated to reflect the committed changes.
Closed by commit rL309191: [ELF, LinkerScript] Memory region name parsing fix (authored by meadori).

Changed prior to commit:
  https://reviews.llvm.org/D35920?vs=108364&id=108365#toc

Repository:
  rL LLVM

https://reviews.llvm.org/D35920

Files:
  lld/trunk/ELF/ScriptParser.cpp
  lld/trunk/test/ELF/linkerscript/memory.s


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
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();
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D35920.108365.patch
Type: text/x-patch
Size: 1009 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170726/f97fb084/attachment.bin>


More information about the llvm-commits mailing list