[PATCH] D52099: [PPC64] Add split-stack support.

Sean Fertile via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Sep 18 07:02:53 PDT 2018


sfertile marked an inline comment as done.
sfertile added inline comments.


================
Comment at: ELF/Arch/PPC64.cpp:665
+                                             uint8_t StOther) const {
+  // If the caller has a global entry point adjust the buffer past it to find
+  // the start of the split-stack prologue.
----------------
ruiu wrote:
> sfertile wrote:
> > ruiu wrote:
> > > It's not clear to me what this code does -- is this PPC-specific thing?
> > Yes, its V2 abi specific. A function can have 2 entry points:
> > 
> > 1) A global entry point which will setup the TOC pointer if the function needs it. 
> > 2) A local entry point, which will be the entry if the caller shares the same value for the TOC pointer, this skips over the TOC pointer initialization.
> > The 3 most significant bits of the  functions st_other flags are used to encode the offset from the global entry to the local entry.
> > 
> > This is something we are already doing in getRelocTargetVA for `R_PPC_CALL` RelExpr and I believe it comes up in the position-dependent long branch thunks patch I posted. I'll move the calculation into its own function and try to explain the how and why more clearly there so its not so opaque to people not familiar with PowerPC64 abi.
> > 
> A documentation about that kind of ABI-specific stuff is sometimes extremely useful to understand code. Can you write a file comment describing what you just wrote? If there are other PPC-specific things, it's worth to be written as well.
I've posted https://reviews.llvm.org/D52231 which is an nfc patch adding a helper function to calculate the offset as well as document the differences between global entry and local entry. I'll update this patch to be dependent on that one.


Repository:
  rLLD LLVM Linker

https://reviews.llvm.org/D52099





More information about the llvm-commits mailing list