The implementation of shadow call stack on aarch64 is quite different to
the implementation on x86_64. Instead of reserving a segment register for
the shadow call stack, we reserve the platform register, x18. Any function
that spills lr to sp also spills it to the shadow call stack, a pointer to
which is stored in x18.
Details
Diff Detail
- Build Status
Buildable 16737 Build 16737: arc lint + arc unit
Event Timeline
clang/docs/ShadowCallStack.rst | ||
---|---|---|
11–12 | Should also mention aarch64 here. | |
llvm/lib/Target/AArch64/AArch64RegisterInfo.cpp | ||
78 | It's sort of a stretch to construct a scenario where this is likely to happen, but is it possible that a runtime function marked with __attribute__((no_sanitize("shadowcallstack"))) would spill x18 across a function call because of this mask if it's referenced before and after? If that was a concern, we could make this test hasAttr(SCS) || hasFlag(fFixedx18) |
Should also mention aarch64 here.