[ELF] - Linkerscript: accept space between '=' and expression in section filler.

Previously we failed to parse next scripts because disallowed
a space between filler value and '=':

  .text : {
...
  } :text = 0x9090

Differential revision: https://reviews.llvm.org/D24831

llvm-svn: 282248
This commit is contained in:
George Rimar 2016-09-23 13:29:20 +00:00
parent daf4cb8b6a
commit 4ebc562052
2 changed files with 10 additions and 1 deletions

View File

@ -1275,8 +1275,12 @@ ScriptParser::readOutputSectionDescription(StringRef OutSec) {
setError("unknown command " + Tok);
}
Cmd->Phdrs = readOutputSectionPhdrs();
if (peek().startswith("="))
if (skip("="))
Cmd->Filler = readOutputSectionFiller(next());
else if (peek().startswith("="))
Cmd->Filler = readOutputSectionFiller(next().drop_front());
return Cmd;
}

View File

@ -31,6 +31,11 @@
# RUN: | FileCheck --check-prefix=ERR2 %s
# ERR2: invalid filler expression: 0x99XX
## Check case with space between '=' and expression:
# RUN: echo "SECTIONS { .mysec : { *(.mysec*) } = 0x1122 }" > %t.script
# RUN: ld.lld -o %t.out --script %t.script %t
# RUN: llvm-objdump -s %t.out | FileCheck -check-prefix=YES %s
.section .mysec.1,"a"
.align 16
.byte 0x66