summaryrefslogtreecommitdiffstats
path: root/lld/ELF/LinkerScript.cpp
diff options
context:
space:
mode:
authorDavide Italiano <davide@freebsd.org>2015-10-12 21:08:41 +0000
committerDavide Italiano <davide@freebsd.org>2015-10-12 21:08:41 +0000
commit6836c6182d3f956001ed2f70557ea34b0353670f (patch)
treed9902558553ad82b016f8c2071a0e074bdc3a332 /lld/ELF/LinkerScript.cpp
parent2c072af95eafa6ac1749cf0b1c217b54bffb6746 (diff)
downloadbcm5719-llvm-6836c6182d3f956001ed2f70557ea34b0353670f.tar.gz
bcm5719-llvm-6836c6182d3f956001ed2f70557ea34b0353670f.zip
[ELF2/LinkerScript] Fix OUTPUT_FORMAT directive parsing
Differential Revision: http://reviews.llvm.org/D13668 llvm-svn: 250106
Diffstat (limited to 'lld/ELF/LinkerScript.cpp')
-rw-r--r--lld/ELF/LinkerScript.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/lld/ELF/LinkerScript.cpp b/lld/ELF/LinkerScript.cpp
index f255da3527f..4d05e10f7e4 100644
--- a/lld/ELF/LinkerScript.cpp
+++ b/lld/ELF/LinkerScript.cpp
@@ -212,6 +212,14 @@ void LinkerScript::readOutputFormat() {
// Error checking only for now.
expect("(");
next();
+ StringRef Tok = next();
+ if (Tok == ")")
+ return;
+ if (Tok != ",")
+ error("unexpected token: " + Tok);
+ next();
+ expect(",");
+ next();
expect(")");
}
OpenPOWER on IntegriCloud