File tree 3 files changed +7
-18
lines changed
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 @@ -204,7 +204,7 @@ struct ChunkRange {
204
204
class Writer {
205
205
public:
206
206
Writer (COFFLinkerContext &c)
207
- : buffer(c.e.outputBuffer), delayIdata(c), edata(c), ctx(c) {}
207
+ : buffer(c.e.outputBuffer), delayIdata(c), ctx(c) {}
208
208
void run ();
209
209
210
210
private:
@@ -293,7 +293,6 @@ class Writer {
293
293
Chunk *iatStart = nullptr ;
294
294
uint64_t iatSize = 0 ;
295
295
DelayLoadContents delayIdata;
296
- EdataContents edata;
297
296
bool setNoSEHCharacteristic = false ;
298
297
uint32_t tlsAlignment = 0 ;
299
298
@@ -1335,7 +1334,9 @@ void Writer::createExportTable() {
1335
1334
if (ctx.config .hadExplicitExports )
1336
1335
Warn (ctx) << " literal .edata sections override exports" ;
1337
1336
} else if (!ctx.config .exports .empty ()) {
1338
- for (Chunk *c : edata.chunks )
1337
+ std::vector<Chunk *> edataChunks;
1338
+ createEdataChunks (ctx, edataChunks);
1339
+ for (Chunk *c : edataChunks)
1339
1340
edataSec->addChunk (c);
1340
1341
}
1341
1342
if (!edataSec->chunks .empty ()) {
You can’t perform that action at this time.
0 commit comments