[PATCH] D31555: [PPC64, Sanitizers] Proper stack frame for the thread spawned in internal_clone

Aleksey Shlyapnikov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Apr 3 15:44:53 PDT 2017


alekseyshl added inline comments.


================
Comment at: lib/sanitizer_common/sanitizer_linux.cc:1117
+// Stack frame structure.
+#if SANITIZER_PPC64V1
+//   Back chain == 0        (SP + 112)
----------------
echristo wrote:
> Do you mean elfv1 vs elfv2 here? The standard one would be just to check for _CALL_ELF == 1 and _CALL_ELF == 2.
That's common practice in sanitizers, sanitizer_platform.h defines SANITIZER_... symbols and those get to be used everywhere. SANITIZER_PPC64V1/2 defined in terms of _CALL_ELF


================
Comment at: lib/sanitizer_common/sanitizer_linux.cc:1137
+//   Back chain             (SP + 0)
+# define FRAME_SIZE (12 * sizeof(unsigned long long))
+# define FRAME_TOC_SAVE_OFFSET 24
----------------
echristo wrote:
> If we're just talking about power64 we can probably just hard code it to N rather than N * sizeof(some type).
Makes sense


https://reviews.llvm.org/D31555





More information about the llvm-commits mailing list