From 89562a9cc7cf6eb908a2c712bbec98af6d7709c2 Mon Sep 17 00:00:00 2001 From: bluhm Date: Fri, 21 Apr 2023 13:24:20 +0000 Subject: [PATCH] If gapdummy.c is compiled with -fcf-protection=branch, clang 13 creates and additional section .note.gnu.property. With that the linker creates a section .plt in gap.o. In the end, a .plt section is also present in the kernel. There it does not make sense. As a quick fix explcitly disable cf protection when compiling gapdummy.c to gapdummy.o. There is no code to protect anyway. OK deraadt@ --- sys/arch/amd64/conf/Makefile.amd64 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/arch/amd64/conf/Makefile.amd64 b/sys/arch/amd64/conf/Makefile.amd64 index 7fd82c320f1..7759b875d7f 100644 --- a/sys/arch/amd64/conf/Makefile.amd64 +++ b/sys/arch/amd64/conf/Makefile.amd64 @@ -1,4 +1,4 @@ -# $OpenBSD: Makefile.amd64,v 1.131 2023/04/17 01:14:24 deraadt Exp $ +# $OpenBSD: Makefile.amd64,v 1.132 2023/04/21 13:24:20 bluhm Exp $ # For instructions on building kernels consult the config(8) and options(4) # manual pages. @@ -177,7 +177,7 @@ ld.script: ${_machdir}/conf/ld.script gapdummy.o: echo '__asm(".section .rodata,\"a\"");' > gapdummy.c - ${CC} -c ${CFLAGS} ${CPPFLAGS} gapdummy.c -o $@ + ${CC} -c ${CFLAGS} ${CPPFLAGS} -fcf-protection=none gapdummy.c -o $@ makegap.sh: cp $S/conf/makegap.sh $@ -- 2.20.1