File tree Expand file tree Collapse file tree 3 files changed +7
-18
lines changed Expand file tree Collapse file tree 3 files changed +7
-18
lines changed Original file line number Diff line number Diff line change @@ -920,7 +920,7 @@ Chunk *DelayLoadContents::newThunkChunk(DefinedImportData *s,
920
920
}
921
921
}
922
922
923
- EdataContents::EdataContents (COFFLinkerContext &ctx) : ctx(ctx ) {
923
+ void createEdataChunks (COFFLinkerContext &ctx, std::vector<Chunk *> &chunks ) {
924
924
unsigned baseOrdinal = 1 << 16 , maxOrdinal = 0 ;
925
925
for (Export &e : ctx.config .exports ) {
926
926
baseOrdinal = std::min (baseOrdinal, (unsigned )e.ordinal );
Original file line number Diff line number Diff line change @@ -77,20 +77,8 @@ class DelayLoadContents {
77
77
COFFLinkerContext &ctx;
78
78
};
79
79
80
- // Windows-specific.
81
- // EdataContents creates all chunks for the DLL export table.
82
- class EdataContents {
83
- public:
84
- EdataContents (COFFLinkerContext &ctx);
85
- std::vector<Chunk *> chunks;
86
-
87
- uint64_t getRVA () { return chunks[0 ]->getRVA (); }
88
- uint64_t getSize () {
89
- return chunks.back ()->getRVA () + chunks.back ()->getSize () - getRVA ();
90
- }
91
-
92
- COFFLinkerContext &ctx;
93
- };
80
+ // Create all chunks for the DLL export table.
81
+ void createEdataChunks (COFFLinkerContext &ctx, std::vector<Chunk *> &chunks);
94
82
95
83
} // namespace lld::coff
96
84
Original file line number Diff line number Diff line change @@ -210,7 +210,7 @@ struct ChunkRange {
210
210
class Writer {
211
211
public:
212
212
Writer (COFFLinkerContext &c)
213
- : buffer(c.e.outputBuffer), delayIdata(c), edata(c), ctx(c) {}
213
+ : buffer(c.e.outputBuffer), delayIdata(c), ctx(c) {}
214
214
void run ();
215
215
216
216
private:
@@ -298,7 +298,6 @@ class Writer {
298
298
Chunk *iatStart = nullptr ;
299
299
uint64_t iatSize = 0 ;
300
300
DelayLoadContents delayIdata;
301
- EdataContents edata;
302
301
bool setNoSEHCharacteristic = false ;
303
302
uint32_t tlsAlignment = 0 ;
304
303
@@ -1325,7 +1324,9 @@ void Writer::createExportTable() {
1325
1324
if (ctx.config .hadExplicitExports )
1326
1325
Warn (ctx) << " literal .edata sections override exports" ;
1327
1326
} else if (!ctx.config .exports .empty ()) {
1328
- for (Chunk *c : edata.chunks )
1327
+ std::vector<Chunk *> edataChunks;
1328
+ createEdataChunks (ctx, edataChunks);
1329
+ for (Chunk *c : edataChunks)
1329
1330
edataSec->addChunk (c);
1330
1331
}
1331
1332
if (!edataSec->chunks .empty ()) {
You can’t perform that action at this time.
0 commit comments