[PATCH] D17265: [lld] [ELF/AArch64] Fix R_AARCH64_ABS64 in Shared mode

Rui Ueyama via llvm-commits llvm-commits at lists.llvm.org
Tue Feb 16 11:39:07 PST 2016


ruiu added inline comments.

================
Comment at: ELF/Writer.cpp:314-322
@@ +313,11 @@
+    if (Target->needsDynRelative(Type)) {
+      // If Body is null it means the relocation is against a local symbol
+      // and thus we need to pass the local symbol index instead.
+      uintX_t Addend = Target->getDynRelativeAddend(Type, getAddend<ELFT>(RI));
+      if (Body)
+        Out<ELFT>::RelaDyn->addReloc({Target->RelativeRel, &C, RI.r_offset, true,
+                                      Body, Addend});
+      else
+        Out<ELFT>::RelaDyn->addReloc({Target->RelativeRel, &C, RI.r_offset, false,
+                                      SymIndex, Addend});
+    }
----------------
Instead of handling a local symbol as a special case, do you think you can create a new instance of SymbolBody here for local symbols and pass it to addReloc?


Repository:
  rL LLVM

http://reviews.llvm.org/D17265





More information about the llvm-commits mailing list