[ELF] Simplify InputSection::writeTo. NFC

This commit is contained in:
Fangrui Song 2022-01-26 22:03:26 -08:00
parent ad39b5bc59
commit 14b7785c09
1 changed files with 2 additions and 3 deletions

View File

@ -1261,9 +1261,8 @@ template <class ELFT> void InputSection::writeTo(uint8_t *buf) {
// Copy section contents from source object file to output file
// and then apply relocations.
memcpy(buf, data().data(), data().size());
uint8_t *bufEnd = buf + data().size();
relocate<ELFT>(buf, bufEnd);
memcpy(buf, rawData.data(), rawData.size());
relocate<ELFT>(buf, buf + rawData.size());
}
void InputSection::replace(InputSection *other) {