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,
920920 }
921921}
922922
923- EdataContents::EdataContents (COFFLinkerContext &ctx) : ctx(ctx ) {
923+ void createEdataChunks (COFFLinkerContext &ctx, std::vector<Chunk *> &chunks ) {
924924 unsigned baseOrdinal = 1 << 16 , maxOrdinal = 0 ;
925925 for (Export &e : ctx.config .exports ) {
926926 baseOrdinal = std::min (baseOrdinal, (unsigned )e.ordinal );
Original file line number Diff line number Diff line change @@ -77,20 +77,8 @@ class DelayLoadContents {
7777 COFFLinkerContext &ctx;
7878};
7979
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);
9482
9583} // namespace lld::coff
9684
Original file line number Diff line number Diff line change @@ -204,7 +204,7 @@ struct ChunkRange {
204204class Writer {
205205public:
206206 Writer (COFFLinkerContext &c)
207- : buffer(c.e.outputBuffer), delayIdata(c), edata(c), ctx(c) {}
207+ : buffer(c.e.outputBuffer), delayIdata(c), ctx(c) {}
208208 void run ();
209209
210210private:
@@ -293,7 +293,6 @@ class Writer {
293293 Chunk *iatStart = nullptr ;
294294 uint64_t iatSize = 0 ;
295295 DelayLoadContents delayIdata;
296- EdataContents edata;
297296 bool setNoSEHCharacteristic = false ;
298297 uint32_t tlsAlignment = 0 ;
299298
@@ -1335,7 +1334,9 @@ void Writer::createExportTable() {
13351334 if (ctx.config .hadExplicitExports )
13361335 Warn (ctx) << " literal .edata sections override exports" ;
13371336 } 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)
13391340 edataSec->addChunk (c);
13401341 }
13411342 if (!edataSec->chunks .empty ()) {
You can’t perform that action at this time.
0 commit comments