Asm/arm64/LzmaDecOpt.S does not support PAC and BTI
A free file archiver for extremely high compression
Brought to you by:
ipavlov
On aarch64/arm64, when we build 7zip with -mbranch-protection=standard
to enable Pointer Authentication (PAC) and Branch Target Identification (BTI), the final link disable them, because Asm/arm64/LzmaDecOpt.S
does not support PAC and BTI.
The following warning message shows the issue:
[ 56s] /usr/lib64/gcc/aarch64-suse-linux/13/../../../../aarch64-suse-linux/bin/ld: b/g_arm64/LzmaDecOpt.o: warning: BTI turned on by -z force-bti when all inputs do not have BTI in NOTE section.
This is a matter to add paciasp/autiasp
in start/end of functions for PAC and BTI C
(or hint #34
) as landing pad on branches for BTI.
More information on :
* PAC: https://developer.arm.com/documentation/102433/0100/Return-oriented-programming
* BTI: https://developer.arm.com/documentation/102433/0100/Jump-oriented-programming
I don't have any warnings in my test.
What exact compilers and commands/switches do you use?
You can use GCC13 with
-mbranch-protection=standard
as LOCAL_FLAGS and also add-z force-bti
as LDFLAGS to actually show the warning.gcc (Debian 13.2.0-4) 13.2.0 gives warnings for some gcc files too:
@ipavlov PR here: https://github.com/ip7z/7zip/pull/39