diff options
author | George Rimar <grimar@accesssoftek.com> | 2015-10-19 17:35:12 +0000 |
---|---|---|
committer | George Rimar <grimar@accesssoftek.com> | 2015-10-19 17:35:12 +0000 |
commit | 83f406cff501a79f0aad0790b9850d38bb815ddb (patch) | |
tree | 128f9c256689d957386c28f8b1342f0c97da97f1 /lld/ELF/LinkerScript.cpp | |
parent | 2adc80107a03b4e589b7ee46cdf5617b678fdc11 (diff) | |
download | bcm5719-llvm-83f406cff501a79f0aad0790b9850d38bb815ddb.tar.gz bcm5719-llvm-83f406cff501a79f0aad0790b9850d38bb815ddb.zip |
[ELF2] - Linker script EXTERN command implemented.
The reason of collecting all undefines in vector is that during reading files we already need to have Symtab created. Or like was done in that patch - to put undefines from scripts somewhere to delay Symtab.addUndefinedOpt() call.
Differential Revision: http://reviews.llvm.org/D13870
llvm-svn: 250711
Diffstat (limited to 'lld/ELF/LinkerScript.cpp')
-rw-r--r-- | lld/ELF/LinkerScript.cpp | 13 |
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 (;;) { |