[PATCH] D52099: [PPC64] Add split-stack support.
Rui Ueyama via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Fri Sep 14 13:28:42 PDT 2018
ruiu 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.
----------------
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.
Repository:
rLLD LLVM Linker
https://reviews.llvm.org/D52099
More information about the llvm-commits
mailing list