1 //===- DLL.h ----------------------------------------------------*- C++ -*-===//
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 #ifndef LLD_COFF_DLL_H
11 #define LLD_COFF_DLL_H
20 // IdataContents creates all chunks for the DLL import table.
21 // You are supposed to call add() to add symbols and then
22 // call getChunks() to get a list of chunks.
25 void add(DefinedImportData *Sym) { Imports.push_back(Sym); }
26 bool empty() { return Imports.empty(); }
27 std::vector<Chunk *> getChunks();
29 uint64_t getDirRVA() { return Dirs[0]->getRVA(); }
30 uint64_t getDirSize();
31 uint64_t getIATRVA() { return Addresses[0]->getRVA(); }
32 uint64_t getIATSize();
37 std::vector<DefinedImportData *> Imports;
38 std::vector<std::unique_ptr<Chunk>> Dirs;
39 std::vector<std::unique_ptr<Chunk>> Lookups;
40 std::vector<std::unique_ptr<Chunk>> Addresses;
41 std::vector<std::unique_ptr<Chunk>> Hints;
42 std::map<StringRef, std::unique_ptr<Chunk>> DLLNames;
46 // DelayLoadContents creates all chunks for the delay-load DLL import table.
47 class DelayLoadContents {
49 void add(DefinedImportData *Sym) { Imports.push_back(Sym); }
50 bool empty() { return Imports.empty(); }
51 void create(Defined *Helper);
52 std::vector<Chunk *> getChunks();
53 std::vector<Chunk *> getDataChunks();
54 std::vector<std::unique_ptr<Chunk>> &getCodeChunks() { return Thunks; }
56 uint64_t getDirRVA() { return Dirs[0]->getRVA(); }
57 uint64_t getDirSize();
60 Chunk *newThunkChunk(DefinedImportData *S, Chunk *Dir);
63 std::vector<DefinedImportData *> Imports;
64 std::vector<std::unique_ptr<Chunk>> Dirs;
65 std::vector<std::unique_ptr<Chunk>> ModuleHandles;
66 std::vector<std::unique_ptr<Chunk>> Addresses;
67 std::vector<std::unique_ptr<Chunk>> Names;
68 std::vector<std::unique_ptr<Chunk>> HintNames;
69 std::vector<std::unique_ptr<Chunk>> Thunks;
70 std::map<StringRef, std::unique_ptr<Chunk>> DLLNames;
74 // EdataContents creates all chunks for the DLL export table.
78 std::vector<std::unique_ptr<Chunk>> Chunks;