[PATCH] D22116: [ELF] Support for setting the base address

Rafael Ávila de Espíndola via llvm-commits llvm-commits at lists.llvm.org
Fri Jul 8 12:06:37 PDT 2016


rafael added inline comments.

================
Comment at: ELF/Config.h:104
@@ -103,2 +103,3 @@
   bool Trace;
+  uint64_t VAStart = -1;
   bool Verbose;
----------------
Don't give it an initial value in here.

================
Comment at: ELF/Driver.cpp:534
@@ -533,1 +533,3 @@
 
+  if (auto *Arg = Args.getLastArg(OPT_Ttext_segment)) {
+    StringRef S = Arg->getValue();
----------------
Always set VAStart in here, since this is already looking at Target-> it may as well have an else to set it to the target default.

================
Comment at: ELF/Writer.cpp:1129
@@ -1128,1 +1128,3 @@
 
+static uint64_t getVAStart() {
+  return Config->VAStart != uint64_t(-1) ? Config->VAStart : Target->getVAStart();
----------------
And with Config->VAStart always having the correct value you don't need this function.


http://reviews.llvm.org/D22116





More information about the llvm-commits mailing list