[PATCH] D48090: [PPC64] global dynamic to initial exec relaxation
Rui Ueyama via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Jun 13 13:55:32 PDT 2018
ruiu added inline comments.
================
Comment at: ELF/Arch/PPC64.cpp:418-422
+// Instruction Relocation Symbol
+// addis r3, r2, x at got@tlsgd at ha R_PPC64_GOT_TLSGD16_HA x
+// addi r3, r3, x at got@tlsgd at l R_PPC64_GOT_TLSGD16_LO x
+// bl __tls_get_addr(x at tlsgd) R_PPC64_TLSGD x
+// R_PPC64_REL24 __tls_get_addr
----------------
I wonder if this comment actually explains what this function is doing. This function handles three different relocation types, but this comment seems to cover only one type.
================
Comment at: ELF/Arch/PPC64.cpp:443
+ uint32_t EndianOffset = Config->EKind == ELF64BEKind ? 2U : 0U;
+ uint32_t InputRegister = (read32(Loc - EndianOffset) & (31 << 16));
+ write32(Loc - EndianOffset,
----------------
Perhaps 0x7fff0000 is easier to understand than 31<<16.
================
Comment at: ELF/Arch/PPC64.cpp:449
+ case R_PPC64_TLSGD:
+ write32(Loc, 0x60000000); // bl __tls_get_addr(sym at tlsgd) --> nop
+ write32(Loc + 4, 0x7c636A14); // nop --> add r3, r3, r13
----------------
Wrong indentation -- can you always apply clang-format?
Repository:
rLLD LLVM Linker
https://reviews.llvm.org/D48090
More information about the llvm-commits
mailing list