[ELF] Simplify InputSection::writeTo. NFC
authorFangrui Song <i@maskray.me>
Thu, 27 Jan 2022 06:03:26 +0000 (22:03 -0800)
committerFangrui Song <i@maskray.me>
Thu, 27 Jan 2022 06:03:26 +0000 (22:03 -0800)
lld/ELF/InputSection.cpp

index e6ce2c3..943cf18 100644 (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) {