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

Adhemerval Zanella via llvm-commits llvm-commits at lists.llvm.org
Wed Feb 17 05:02:07 PST 2016


zatrazz 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});
+    }
----------------
ruiu wrote:
> 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?
I tried to add a local symbol table in InputSectionBase, but it ended up begin disruptive in the sense it required a lot of code modification to handle it. However I think it is possible to create a local SymbolBody, although I see such modification to be an forward change.


Repository:
  rL LLVM

http://reviews.llvm.org/D17265





More information about the llvm-commits mailing list