[ELF, LinkerScript] Memory region name parsing fix

This patch fixes a small issue with respect to how memory region names
are parsed on output section descriptions.  For example, consider:

  .text : { *(.text) } > rom

That can also be written like:

  .text : { *(.text) } >rom

The latter form is accepted by GNU LD and is fairly common.

Differential Revision: https://reviews.llvm.org/D35920

llvm-svn: 309191
This commit is contained in:
Meador Inge 2017-07-26 21:51:09 +00:00
parent cb98c14f89
commit b0e6229742
2 changed files with 4 additions and 2 deletions

View File

@ -652,6 +652,8 @@ ScriptParser::readOutputSectionDescription(StringRef OutSec) {
if (consume(">"))
Cmd->MemoryRegionName = next();
else if (peek().startswith(">"))
Cmd->MemoryRegionName = next().drop_front();
Cmd->Phdrs = readOutputSectionPhdrs();