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
Details
Diff Detail
Diff Detail
- Repository
- rL LLVM
Event Timeline
clang/docs/ShadowCallStack.rst | ||
---|---|---|
12 ↗ | (On Diff #140890) | Should also mention aarch64 here. |
llvm/lib/Target/AArch64/AArch64RegisterInfo.cpp | ||
78 ↗ | (On Diff #140890) | 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) |