[PATCH] D18591: [ELF] - Separate assignAddressesScript method

Rui Ueyama via llvm-commits llvm-commits at lists.llvm.org
Wed Mar 30 12:48:49 PDT 2016


ruiu added inline comments.

================
Comment at: ELF/Writer.cpp:1413-1423
@@ +1412,13 @@
+
+    // We only assign VAs to allocated sections.
+    if (needsPtLoad<ELFT>(Sec)) {
+      VA = alignTo(VA, Align);
+      Sec->setVA(VA);
+      VA += Sec->getSize();
+    } else if (Sec->getFlags() & SHF_TLS && Sec->getType() == SHT_NOBITS) {
+      uintX_t TVA = VA + ThreadBssOffset;
+      TVA = alignTo(TVA, Align);
+      Sec->setVA(TVA);
+      ThreadBssOffset = TVA - VA + Sec->getSize();
+    }
+  }
----------------
This default behavior needs to be removed because all addresses are given by a linker script, no?

================
Comment at: ELF/Writer.cpp:1430-1432
@@ +1429,5 @@
+
+  // Update "_end" and "end" symbols so that they
+  // point to the end of the data segment.
+  ElfSym<ELFT>::End.st_value = VA;
+
----------------
This is duplicate.

================
Comment at: ELF/Writer.cpp:1434
@@ +1433,3 @@
+
+  assignPhdrs();
+}
----------------
Move this function call to Writer::run().


http://reviews.llvm.org/D18591





More information about the llvm-commits mailing list