[PATCH] D45642: [PPC64] V2 abi: Add glink section for lazy symbol resolution.

Sean Fertile via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri May 4 13:55:22 PDT 2018


sfertile added inline comments.


================
Comment at: ELF/Arch/PPC64.cpp:198
+  int64_t GotPltOffset = InX::GotPlt->getVA() - (InX::Plt->getVA() + 8);
+  write64(Buf + 52, GotPltOffset);
+}
----------------
ruiu wrote:
> Looks like you set 60 to `PltHeaderSize` but you are using only the first 56 bytes. Is this intentional?
I'm writing a 64 bit  offset to `Buf + 52`, so the whole 60 bytes are used.


================
Comment at: ELF/SyntheticSections.cpp:882-883
 GotPltSection::GotPltSection()
-    : SyntheticSection(SHF_ALLOC | SHF_WRITE, SHT_PROGBITS,
-                       Target->GotPltEntrySize, ".got.plt") {}
+    : SyntheticSection(SHF_ALLOC | SHF_WRITE,
+                       Config->EMachine == EM_PPC64 ? SHT_NOBITS : SHT_PROGBITS,
+                       Target->GotPltEntrySize,
----------------
ruiu wrote:
> BSS-ish .got.plt looks pretty odd. Is this really what the spec says? It at least needs some explanation in comment for a reader.
yeah this is odd, I don't know why its made to look like a .bss section but it is specified by the abi (both V1 and V2 64 bit abis as well as the 32 bit abi I believe)


Repository:
  rLLD LLVM Linker

https://reviews.llvm.org/D45642





More information about the llvm-commits mailing list