Make sure the syscall table entries are aligned on a 4-byte boundary.
authorkettenis <kettenis@openbsd.org>
Mon, 11 Dec 2023 22:24:15 +0000 (22:24 +0000)
committerkettenis <kettenis@openbsd.org>
Mon, 11 Dec 2023 22:24:15 +0000 (22:24 +0000)
Required for strict-alignment architectures and a good idea on others.

ok deraadt@

lib/libc/arch/DEFS.h
lib/libc/arch/alpha/SYS.h
lib/libc/arch/hppa/SYS.h
lib/libc/arch/i386/DEFS.h
lib/libc/arch/m88k/DEFS.h
lib/libc/arch/mips64/SYS.h
lib/libc/arch/powerpc64/DEFS.h
lib/libc/arch/riscv64/DEFS.h
lib/libc/arch/sh/SYS.h

index 472b530..38cfcde 100644 (file)
@@ -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 <guenther@openbsd.org>
  *
@@ -72,6 +72,7 @@
 
 #define PINSYSCALL(sysno, label)                                       \
        .pushsection .openbsd.syscalls,"",_PROGBITS;                    \
+       .p2align 2;                                                     \
        .long label;                                                    \
        .long sysno;                                                    \
        .popsection;
index 62adccb..d7e3f79 100644 (file)
@@ -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;
index 460157c..2e78cff 100644 (file)
@@ -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
index c8ae4a2..07efc8f 100644 (file)
@@ -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 <guenther@openbsd.org>
  *
@@ -50,6 +50,7 @@
 
 #define PINSYSCALL(sysno, label)                                       \
        .pushsection .openbsd.syscalls,"",@progbits;                    \
+       .p2align 2;                                                     \
        .long label;                                                    \
        .long sysno;                                                    \
        .popsection;
index 804636e..5260e40 100644 (file)
@@ -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 <machine/asm.h>
 
@@ -26,6 +26,7 @@
 
 #define PINSYSCALL(sysno, label)                                       \
        .pushsection .openbsd.syscalls,"",@progbits;                    \
+       .p2align 2;                                                     \
        .long label;                                                    \
        .long sysno;                                                    \
        .popsection;
index c9ac6b2..16b5a6f 100644 (file)
@@ -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 <sys/syscall.h>
 
 #define PINSYSCALL(sysno, label)                                       \
        .pushsection .openbsd.syscalls,"",@progbits;                    \
+       .p2align 2;                                                     \
        .long label;                                                    \
        .long sysno;                                                    \
        .popsection;
index 3b8c933..9c90a1b 100644 (file)
@@ -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;
index a2c61dd..09bc27b 100644 (file)
@@ -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;
index cd5dbea..cb3fd7e 100644 (file)
@@ -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;