diff options
author | George Rimar <grimar@accesssoftek.com> | 2016-09-23 13:17:23 +0000 |
---|---|---|
committer | George Rimar <grimar@accesssoftek.com> | 2016-09-23 13:17:23 +0000 |
commit | f34f45fd534140f082d41dbb6a7c60dc675870c4 (patch) | |
tree | 1172d9b359b658f984c144eb9493a78e17901cc9 /lld/ELF/LinkerScript.h | |
parent | d4dea164dd453f567d9d33f3c158c33d6904987f (diff) | |
download | bcm5719-llvm-f34f45fd534140f082d41dbb6a7c60dc675870c4.tar.gz bcm5719-llvm-f34f45fd534140f082d41dbb6a7c60dc675870c4.zip |
[ELF] - Linkerscript: implement DEFINED() command.
DEFINED(symbol)
Return 1 if symbol is in the linker global symbol table and is defined before
the statement using DEFINED in the script, otherwise return 0.
Can be used to define default values for symbols. Found it in the wild.
Differential revision: https://reviews.llvm.org/D24858
llvm-svn: 282245
Diffstat (limited to 'lld/ELF/LinkerScript.h')
-rw-r--r-- | lld/ELF/LinkerScript.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/lld/ELF/LinkerScript.h b/lld/ELF/LinkerScript.h index 654aae21dc6..1d3a713d8ce 100644 --- a/lld/ELF/LinkerScript.h +++ b/lld/ELF/LinkerScript.h @@ -157,6 +157,7 @@ public: virtual uint64_t getOutputSectionAlign(StringRef Name) = 0; virtual uint64_t getHeaderSize() = 0; virtual uint64_t getSymbolValue(StringRef S) = 0; + virtual bool isDefined(StringRef S) = 0; }; // ScriptConfiguration holds linker script parse results. @@ -203,6 +204,7 @@ public: uint64_t getOutputSectionAlign(StringRef Name) override; uint64_t getHeaderSize() override; uint64_t getSymbolValue(StringRef S) override; + bool isDefined(StringRef S) override; std::vector<OutputSectionBase<ELFT> *> *OutputSections; |