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 {
422422
423423 applyRelocation (buf + rel.VirtualAddress , rel);
424424 }
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 );
431425}
432426
433427void SectionChunk::applyRelocation (uint8_t *off,
Original file line number Diff line number Diff line change @@ -2544,7 +2544,15 @@ void Writer::writeSections() {
25442544 }
25452545
25462546 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 );
25482556 });
25492557 }
25502558}
You can’t perform that action at this time.
0 commit comments