1 | // This program makes a multi tier nested function call to test AArch64 |
2 | // Pointer Authentication feature. |
3 | |
4 | // To enable PAC return address signing compile with following clang arguments: |
5 | // -march=armv8.3-a -mbranch-protection=pac-ret+leaf |
6 | |
7 | #include <stdlib.h> |
8 | |
9 | static void __attribute__((noinline)) func_c(void) { |
10 | exit(status: 0); // Frame func_c |
11 | } |
12 | |
13 | static void __attribute__((noinline)) func_b(void) { |
14 | func_c(); // Frame func_b |
15 | } |
16 | |
17 | static void __attribute__((noinline)) func_a(void) { |
18 | func_b(); // Frame func_a |
19 | } |
20 | |
21 | int main(int argc, char *argv[]) { |
22 | func_a(); // Frame main |
23 | return 0; |
24 | } |
25 | |