On Fri, Apr 21, 2023 at 07:35:22AM -0600, Theo de Raadt wrote:
> It may still be better to add it to match the style.  On i386, also.

Here is the diff for arm64.  No -fcf-protection for i386 yet.  

Before:

root@ot11:.../GENERIC.MP# objdump -s obj/gapdummy.o | grep 'Contents of section'
Contents of section .note.gnu.property:
Contents of section .comment:
root@ot11:.../GENERIC.MP# objdump -s obj/gap.o | grep 'Contents of section'
Contents of section .text:
Contents of section .rodata:
Contents of section .data:
Contents of section .comment:
Contents of section .note.gnu.property:
root@ot11:.../GENERIC.MP# objdump -s obj/bsd | grep 'Contents of section'
Contents of section .text:
Contents of section .rodata:
Contents of section .openbsd.randomdata:
Contents of section .data:
Contents of section .comment:
Contents of section .SUNW_ctf:

After my fix:

root@ot10:.../GENERIC.MP# objdump -s obj/gapdummy.o | grep 'Contents of secti >
root@ot10:.../GENERIC.MP# objdump -s obj/gap.o | grep 'Contents of section'
Contents of section .text:
Contents of section .rodata:
Contents of section .data:
Contents of section .comment:
root@ot10:.../GENERIC.MP# objdump -s obj/bsd | grep 'Contents of section'
Contents of section .text:
Contents of section .rodata:
Contents of section .openbsd.randomdata:
Contents of section .data:
Contents of section .comment:
Contents of section .SUNW_ctf:

ok?

bluhm

Index: arch/arm64/conf/Makefile.arm64
===================================================================
RCS file: /mount/openbsd/cvs/src/sys/arch/arm64/conf/Makefile.arm64,v
retrieving revision 1.46
diff -u -p -r1.46 Makefile.arm64
--- arch/arm64/conf/Makefile.arm64      9 Apr 2023 19:48:37 -0000       1.46
+++ arch/arm64/conf/Makefile.arm64      21 Apr 2023 15:51:50 -0000
@@ -154,7 +154,7 @@ ld.script: ${_archdir}/conf/kern.ldscrip
            -e 's/@KERNEL_BASE_VIRT@/${KERNEL_BASE_VIRT}/' > ld.script
 gapdummy.o:
        echo '__asm(".section .rodata,\"a\"");' > gapdummy.c
-       ${CC} -c ${CFLAGS} ${CPPFLAGS} gapdummy.c -o $@
+       ${CC} -c ${CFLAGS} ${CPPFLAGS} -mbranch-protection=none gapdummy.c -o $@
 
 makegap.sh:
        cp $S/conf/makegap.sh $@

Reply via email to