summaryrefslogtreecommitdiffstats
path: root/lld/ELF/LinkerScript.h
diff options
context:
space:
mode:
authorGeorge Rimar <grimar@accesssoftek.com>2018-03-08 14:54:38 +0000
committerGeorge Rimar <grimar@accesssoftek.com>2018-03-08 14:54:38 +0000
commit9e2c8a9db16f502b135a38fdb6555de8739b9a5f (patch)
tree43f4ef01cf0b3671e43fd56cff2f161ecc10c0c3 /lld/ELF/LinkerScript.h
parent9003b3b76d57c15ee8c451f0c2292977916dcb88 (diff)
downloadbcm5719-llvm-9e2c8a9db16f502b135a38fdb6555de8739b9a5f.tar.gz
bcm5719-llvm-9e2c8a9db16f502b135a38fdb6555de8739b9a5f.zip
[ELF] - Support "INSERT AFTER" statement.
This implements INSERT AFTER in a following way: During reading scripts it collects all insert statements. After we done and read all files it inserts statements into script commands list. With that: * Rest of code does know nothing about INSERT. * Approach is straightforward and have no visible limitations. * It is also easy to support INSERT BEFORE (was seen in clang code once). * Should work for PR35877 and similar cases. Cons: * It assumes we have "main" scripts that describes sections. Differential revision: https://reviews.llvm.org/D43468 llvm-svn: 327003
Diffstat (limited to 'lld/ELF/LinkerScript.h')
-rw-r--r--lld/ELF/LinkerScript.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/lld/ELF/LinkerScript.h b/lld/ELF/LinkerScript.h
index 4eddafa4996..fe5d6d8ef6f 100644
--- a/lld/ELF/LinkerScript.h
+++ b/lld/ELF/LinkerScript.h
@@ -267,6 +267,9 @@ public:
void processSectionCommands();
void declareSymbols();
+ // Used to handle INSERT AFTER statements.
+ void processInsertCommands();
+
// SECTIONS command list.
std::vector<BaseCommand *> SectionCommands;
@@ -285,6 +288,10 @@ public:
// A list of symbols referenced by the script.
std::vector<llvm::StringRef> ReferencedSymbols;
+
+ // Used to implement INSERT AFTER. Contains commands that need
+ // to be inserted into SECTIONS commands list.
+ llvm::DenseMap<StringRef, std::vector<BaseCommand *>> InsertAfterCommands;
};
extern LinkerScript *Script;
OpenPOWER on IntegriCloud