Add BTI landing pads for aarch64
When Branch Target Identifier (BTI) is enabled on aarch64,
any software which run libglvnd will fail with SIGILL, Illegal instruction.
If I run kmscube
within gdb
, I get:
Thread 1 "kmscube" received signal SIGILL, Illegal instruction.
0x0000fffff7e7e300 in glGetString () from /lib64/libGLESv2.so.2
#0 0x0000fffff7e7e300 in glGetString () from /lib64/libGLESv2.so.2
#1 0x0000aaaaaaaa7b28 in ?? ()
#2 0x0000aaaaaaaa5dc8 [PAC] in ?? ()
#3 0x0000fffff77b70c4 [PAC] in __libc_start_call_main () from /lib64/libc.so.6
#4 0x0000fffff77b7198 [PAC] in __libc_start_main_impl () from /lib64/libc.so.6
#5 0x0000aaaaaaaa75f8 [PAC] in ?? ()
This is because some assembler code misses the BTI landing pads. See: https://developer.arm.com/documentation/102433/0100/Jump-oriented-programming
"hint #34 (closed)" is the same thing as "BTI C" landing pad, but keep compatibility with systems without BTI enabled.