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<Chunk *> Dirs;
39 std::vector<Chunk *> Addresses;
40 std::vector<Chunk *> Hints;
41 std::vector<Chunk *> DLLNames;
45 // DelayLoadContents creates all chunks for the delay-load DLL import table.
46 class DelayLoadContents {
48 void add(DefinedImportData *Sym) { Imports.push_back(Sym); }
49 bool empty() { return Imports.empty(); }
50 void create(Defined *Helper);
51 std::vector<Chunk *> getChunks();
52 std::vector<Chunk *> getDataChunks();
53 ArrayRef<Chunk *> getCodeChunks() { return Thunks; }
55 uint64_t getDirRVA() { return Dirs[0]->getRVA(); }
56 uint64_t getDirSize();
59 Chunk *newThunkChunk(DefinedImportData *S, Chunk *Dir);
62 std::vector<DefinedImportData *> Imports;
63 std::vector<Chunk *> Dirs;
64 std::vector<Chunk *> ModuleHandles;
65 std::vector<Chunk *> Addresses;
66 std::vector<Chunk *> Names;
67 std::vector<Chunk *> HintNames;
68 std::vector<Chunk *> Thunks;
69 std::vector<Chunk *> DLLNames;
73 // EdataContents creates all chunks for the DLL export table.
77 std::vector<Chunk *> Chunks;