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 @@ -210,7 +210,7 @@ struct ChunkRange {
210210class Writer {
211211public:
212212 Writer (COFFLinkerContext &c)
213- : buffer(c.e.outputBuffer), delayIdata(c), edata(c), ctx(c) {}
213+ : buffer(c.e.outputBuffer), delayIdata(c), ctx(c) {}
214214 void run ();
215215
216216private:
@@ -298,7 +298,6 @@ class Writer {
298298 Chunk *iatStart = nullptr ;
299299 uint64_t iatSize = 0 ;
300300 DelayLoadContents delayIdata;
301- EdataContents edata;
302301 bool setNoSEHCharacteristic = false ;
303302 uint32_t tlsAlignment = 0 ;
304303
@@ -1325,7 +1324,9 @@ void Writer::createExportTable() {
13251324 if (ctx.config .hadExplicitExports )
13261325 Warn (ctx) << " literal .edata sections override exports" ;
13271326 } 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)
13291330 edataSec->addChunk (c);
13301331 }
13311332 if (!edataSec->chunks .empty ()) {
You can’t perform that action at this time.
0 commit comments