summaryrefslogtreecommitdiffstats
path: root/lld/ELF/LinkerScript.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lld/ELF/LinkerScript.cpp')
-rw-r--r--lld/ELF/LinkerScript.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/lld/ELF/LinkerScript.cpp b/lld/ELF/LinkerScript.cpp
index 2a63be4ca5d..1607247aa98 100644
--- a/lld/ELF/LinkerScript.cpp
+++ b/lld/ELF/LinkerScript.cpp
@@ -43,6 +43,7 @@ private:
void readAsNeeded();
void readEntry();
+ void readExtern();
void readGroup();
void readInclude();
void readOutput();
@@ -63,6 +64,8 @@ void LinkerScript::run() {
continue;
if (Tok == "ENTRY") {
readEntry();
+ } else if (Tok == "EXTERN") {
+ readExtern();
} else if (Tok == "GROUP" || Tok == "INPUT") {
readGroup();
} else if (Tok == "INCLUDE") {
@@ -181,6 +184,16 @@ void LinkerScript::readEntry() {
expect(")");
}
+void LinkerScript::readExtern() {
+ expect("(");
+ for (;;) {
+ StringRef Tok = next();
+ if (Tok == ")")
+ return;
+ Config->Undefined.push_back(Tok);
+ }
+}
+
void LinkerScript::readGroup() {
expect("(");
for (;;) {
OpenPOWER on IntegriCloud