Skip to content
This repository was archived by the owner on Aug 20, 2024. It is now read-only.

Commit 49b65b9

Browse files
amitdanielkachhapKendrenogen
authored andcommitted
arm64: Kconfig: ptrauth: Add binutils version check to fix mismatch
Recent addition of ARM64_PTR_AUTH exposed a mismatch issue with binutils. 9.1+ versions of gcc inserts a section note .note.gnu.property but this can be used properly by binutils version greater than 2.33.1. If older binutils are used then the following warnings are generated, aarch64-linux-ld: warning: arch/arm64/kernel/vdso/vgettimeofday.o: unsupported GNU_PROPERTY_TYPE (5) type: 0xc0000000 aarch64-linux-objdump: warning: arch/arm64/lib/csum.o: unsupported GNU_PROPERTY_TYPE (5) type: 0xc0000000 aarch64-linux-nm: warning: .tmp_vmlinux1: unsupported GNU_PROPERTY_TYPE (5) type: 0xc0000000 This patch enables ARM64_PTR_AUTH when gcc and binutils versions are compatible with each other. Older gcc which do not insert such section continue to work as before. This scenario may not occur with clang as a recent commit 3a192fc9362d15d ("arm64: Kconfig: verify binutils support for ARM64_PTR_AUTH") masks binutils version lesser then 2.34. Reported-by: kbuild test robot <[email protected]> Suggested-by: Vincenzo Frascino <[email protected]> Signed-off-by: Amit Daniel Kachhap <[email protected]> [[email protected]: slight adjustment to the comment] Signed-off-by: Catalin Marinas <[email protected]>
1 parent 46bd430 commit 49b65b9

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

arch/arm64/Kconfig

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1539,7 +1539,10 @@ config ARM64_PTR_AUTH
15391539
default y
15401540
depends on !KVM || ARM64_VHE
15411541
depends on (CC_HAS_SIGN_RETURN_ADDRESS || CC_HAS_BRANCH_PROT_PAC_RET) && AS_HAS_PAC
1542-
depends on CC_IS_GCC || (CC_IS_CLANG && AS_HAS_CFI_NEGATE_RA_STATE)
1542+
# GCC 9.1 and later inserts a .note.gnu.property section note for PAC
1543+
# which is only understood by binutils starting with version 2.33.1.
1544+
depends on !CC_IS_GCC || GCC_VERSION < 90100 || LD_VERSION >= 233010000
1545+
depends on !CC_IS_CLANG || AS_HAS_CFI_NEGATE_RA_STATE
15431546
depends on (!FUNCTION_GRAPH_TRACER || DYNAMIC_FTRACE_WITH_REGS)
15441547
help
15451548
Pointer authentication (part of the ARMv8.3 Extensions) provides

0 commit comments

Comments
 (0)