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 create() to populate the chunk vectors.
25 void add(DefinedImportData *Sym) { Imports.push_back(Sym); }
26 bool empty() { return Imports.empty(); }
30 std::vector<DefinedImportData *> Imports;
31 std::vector<Chunk *> Dirs;
32 std::vector<Chunk *> Lookups;
33 std::vector<Chunk *> Addresses;
34 std::vector<Chunk *> Hints;
35 std::vector<Chunk *> DLLNames;
39 // DelayLoadContents creates all chunks for the delay-load DLL import table.
40 class DelayLoadContents {
42 void add(DefinedImportData *Sym) { Imports.push_back(Sym); }
43 bool empty() { return Imports.empty(); }
44 void create(Defined *Helper);
45 std::vector<Chunk *> getChunks();
46 std::vector<Chunk *> getDataChunks();
47 ArrayRef<Chunk *> getCodeChunks() { return Thunks; }
49 uint64_t getDirRVA() { return Dirs[0]->getRVA(); }
50 uint64_t getDirSize();
53 Chunk *newThunkChunk(DefinedImportData *S, Chunk *Dir);
56 std::vector<DefinedImportData *> Imports;
57 std::vector<Chunk *> Dirs;
58 std::vector<Chunk *> ModuleHandles;
59 std::vector<Chunk *> Addresses;
60 std::vector<Chunk *> Names;
61 std::vector<Chunk *> HintNames;
62 std::vector<Chunk *> Thunks;
63 std::vector<Chunk *> DLLNames;
67 // EdataContents creates all chunks for the DLL export table.
71 std::vector<Chunk *> Chunks;
73 uint64_t getRVA() { return Chunks[0]->getRVA(); }
75 return Chunks.back()->getRVA() + Chunks.back()->getSize() - getRVA();