File tree Expand file tree Collapse file tree 2 files changed +9
-7
lines changed Expand file tree Collapse file tree 2 files changed +9
-7
lines changed Original file line number Diff line number Diff line change @@ -422,12 +422,6 @@ void SectionChunk::writeTo(uint8_t *buf) const {
422
422
423
423
applyRelocation (buf + rel.VirtualAddress , rel);
424
424
}
425
-
426
- // Write the offset to EC entry thunk preceding section contents. The low bit
427
- // is always set, so it's effectively an offset from the last byte of the
428
- // offset.
429
- if (Defined *entryThunk = getEntryThunk ())
430
- write32le (buf - sizeof (uint32_t ), entryThunk->getRVA () - rva + 1 );
431
425
}
432
426
433
427
void SectionChunk::applyRelocation (uint8_t *off,
Original file line number Diff line number Diff line change @@ -2544,7 +2544,15 @@ void Writer::writeSections() {
2544
2544
}
2545
2545
2546
2546
parallelForEach (sec->chunks , [&](Chunk *c) {
2547
- c->writeTo (secBuf + c->getRVA () - sec->getRVA ());
2547
+ uint8_t *buf = secBuf + c->getRVA () - sec->getRVA ();
2548
+ c->writeTo (buf);
2549
+
2550
+ // Write the offset to EC entry thunk preceding section contents. The low
2551
+ // bit is always set, so it's effectively an offset from the last byte of
2552
+ // the offset.
2553
+ if (Defined *entryThunk = c->getEntryThunk ())
2554
+ write32le (buf - sizeof (uint32_t ),
2555
+ entryThunk->getRVA () - c->getRVA () + 1 );
2548
2556
});
2549
2557
}
2550
2558
}
You can’t perform that action at this time.
0 commit comments