From 5bcead818ba71dc1c4fad02a24986a5b47ae1c58 Mon Sep 17 00:00:00 2001 From: kettenis Date: Mon, 11 Dec 2023 22:24:15 +0000 Subject: [PATCH] Make sure the syscall table entries are aligned on a 4-byte boundary. Required for strict-alignment architectures and a good idea on others. ok deraadt@ --- lib/libc/arch/DEFS.h | 3 ++- lib/libc/arch/alpha/SYS.h | 3 ++- lib/libc/arch/hppa/SYS.h | 3 ++- lib/libc/arch/i386/DEFS.h | 3 ++- lib/libc/arch/m88k/DEFS.h | 3 ++- lib/libc/arch/mips64/SYS.h | 3 ++- lib/libc/arch/powerpc64/DEFS.h | 3 ++- lib/libc/arch/riscv64/DEFS.h | 3 ++- lib/libc/arch/sh/SYS.h | 3 ++- 9 files changed, 18 insertions(+), 9 deletions(-) diff --git a/lib/libc/arch/DEFS.h b/lib/libc/arch/DEFS.h index 472b530b240..38cfcdec010 100644 --- a/lib/libc/arch/DEFS.h +++ b/lib/libc/arch/DEFS.h @@ -1,4 +1,4 @@ -/* $OpenBSD: DEFS.h,v 1.3 2023/12/11 03:05:15 deraadt Exp $ */ +/* $OpenBSD: DEFS.h,v 1.4 2023/12/11 22:24:15 kettenis Exp $ */ /* * Copyright (c) 2015,2018,2021 Philip Guenther * @@ -72,6 +72,7 @@ #define PINSYSCALL(sysno, label) \ .pushsection .openbsd.syscalls,"",_PROGBITS; \ + .p2align 2; \ .long label; \ .long sysno; \ .popsection; diff --git a/lib/libc/arch/alpha/SYS.h b/lib/libc/arch/alpha/SYS.h index 62adccb89b5..d7e3f79acf5 100644 --- a/lib/libc/arch/alpha/SYS.h +++ b/lib/libc/arch/alpha/SYS.h @@ -1,4 +1,4 @@ -/* $OpenBSD: SYS.h,v 1.17 2023/12/10 16:45:50 deraadt Exp $ */ +/* $OpenBSD: SYS.h,v 1.18 2023/12/11 22:24:15 kettenis Exp $ */ /* $NetBSD: SYS.h,v 1.4 1996/10/17 03:03:53 cgd Exp $ */ /* @@ -58,6 +58,7 @@ #define PINSYSCALL(sysno, label) \ .pushsection .openbsd.syscalls,"",@progbits; \ + .p2align 2; \ .long label; \ .long sysno; \ .popsection; diff --git a/lib/libc/arch/hppa/SYS.h b/lib/libc/arch/hppa/SYS.h index 460157c9891..2e78cff6316 100644 --- a/lib/libc/arch/hppa/SYS.h +++ b/lib/libc/arch/hppa/SYS.h @@ -1,4 +1,4 @@ -/* $OpenBSD: SYS.h,v 1.25 2023/12/11 02:30:36 deraadt Exp $ */ +/* $OpenBSD: SYS.h,v 1.26 2023/12/11 22:24:15 kettenis Exp $ */ /* * Copyright (c) 1998-2002 Michael Shalayeff @@ -69,6 +69,7 @@ #define PINSYSCALL(sysno, label) \ .pushsection .openbsd.syscalls,"",@progbits !\ + .p2align 2 !\ .long label !\ .long sysno !\ .popsection diff --git a/lib/libc/arch/i386/DEFS.h b/lib/libc/arch/i386/DEFS.h index c8ae4a29beb..07efc8fa8eb 100644 --- a/lib/libc/arch/i386/DEFS.h +++ b/lib/libc/arch/i386/DEFS.h @@ -1,4 +1,4 @@ -/* $OpenBSD: DEFS.h,v 1.4 2023/12/10 16:45:51 deraadt Exp $ */ +/* $OpenBSD: DEFS.h,v 1.5 2023/12/11 22:24:15 kettenis Exp $ */ /* * Copyright (c) 2017 Philip Guenther * @@ -50,6 +50,7 @@ #define PINSYSCALL(sysno, label) \ .pushsection .openbsd.syscalls,"",@progbits; \ + .p2align 2; \ .long label; \ .long sysno; \ .popsection; diff --git a/lib/libc/arch/m88k/DEFS.h b/lib/libc/arch/m88k/DEFS.h index 804636ee852..5260e40bd21 100644 --- a/lib/libc/arch/m88k/DEFS.h +++ b/lib/libc/arch/m88k/DEFS.h @@ -1,4 +1,4 @@ -/* $OpenBSD: DEFS.h,v 1.4 2023/12/10 16:45:51 deraadt Exp $ */ +/* $OpenBSD: DEFS.h,v 1.5 2023/12/11 22:24:15 kettenis Exp $ */ #include @@ -26,6 +26,7 @@ #define PINSYSCALL(sysno, label) \ .pushsection .openbsd.syscalls,"",@progbits; \ + .p2align 2; \ .long label; \ .long sysno; \ .popsection; diff --git a/lib/libc/arch/mips64/SYS.h b/lib/libc/arch/mips64/SYS.h index c9ac6b24cf3..16b5a6fda7e 100644 --- a/lib/libc/arch/mips64/SYS.h +++ b/lib/libc/arch/mips64/SYS.h @@ -29,7 +29,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $OpenBSD: SYS.h,v 1.13 2023/12/10 16:45:51 deraadt Exp $ + * $OpenBSD: SYS.h,v 1.14 2023/12/11 22:24:16 kettenis Exp $ */ #include @@ -127,6 +127,7 @@ #define PINSYSCALL(sysno, label) \ .pushsection .openbsd.syscalls,"",@progbits; \ + .p2align 2; \ .long label; \ .long sysno; \ .popsection; diff --git a/lib/libc/arch/powerpc64/DEFS.h b/lib/libc/arch/powerpc64/DEFS.h index 3b8c9332061..9c90a1b1d92 100644 --- a/lib/libc/arch/powerpc64/DEFS.h +++ b/lib/libc/arch/powerpc64/DEFS.h @@ -1,4 +1,4 @@ -/* $OpenBSD: DEFS.h,v 1.2 2023/12/10 16:45:52 deraadt Exp $ */ +/* $OpenBSD: DEFS.h,v 1.3 2023/12/11 22:24:16 kettenis Exp $ */ /*- * Copyright (c) 1990 The Regents of the University of California. @@ -70,6 +70,7 @@ #define PINSYSCALL(sysno, label) \ .pushsection .openbsd.syscalls,"",@progbits; \ + .p2align 2; \ .long label; \ .long sysno; \ .popsection; diff --git a/lib/libc/arch/riscv64/DEFS.h b/lib/libc/arch/riscv64/DEFS.h index a2c61dda980..09bc27befb6 100644 --- a/lib/libc/arch/riscv64/DEFS.h +++ b/lib/libc/arch/riscv64/DEFS.h @@ -1,4 +1,4 @@ -/* $OpenBSD: DEFS.h,v 1.2 2023/12/10 16:45:52 deraadt Exp $ */ +/* $OpenBSD: DEFS.h,v 1.3 2023/12/11 22:24:16 kettenis Exp $ */ /*- * Copyright (c) 1990 The Regents of the University of California. * All rights reserved. @@ -60,6 +60,7 @@ #define PINSYSCALL(sysno, label) \ .pushsection .openbsd.syscalls,"",@progbits; \ + .p2align 2; \ .long label; \ .long sysno; \ .popsection; diff --git a/lib/libc/arch/sh/SYS.h b/lib/libc/arch/sh/SYS.h index cd5dbeaaf51..cb3fd7ef1e6 100644 --- a/lib/libc/arch/sh/SYS.h +++ b/lib/libc/arch/sh/SYS.h @@ -1,4 +1,4 @@ -/* $OpenBSD: SYS.h,v 1.14 2023/12/10 16:45:52 deraadt Exp $ */ +/* $OpenBSD: SYS.h,v 1.15 2023/12/11 22:24:16 kettenis Exp $ */ /*- * Copyright (c) 1990 The Regents of the University of California. * All rights reserved. @@ -87,6 +87,7 @@ #define PINSYSCALL(sysno, label) \ .pushsection .openbsd.syscalls,"",@progbits; \ + .p2align 2; \ .long label; \ .long sysno; \ .popsection; -- 2.20.1