Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/tools/m68k-elf2aout/sys sync with arm.



details:   https://anonhg.NetBSD.org/src/rev/2f88408e756c
branches:  trunk
changeset: 451390:2f88408e756c
user:      christos <christos%NetBSD.org@localhost>
date:      Mon May 20 18:24:57 2019 +0000

description:
sync with arm.

diffstat:

 tools/m68k-elf2aout/sys/aout_mids.h |    84 +-
 tools/m68k-elf2aout/sys/exec_elf.h  |  1428 +++++++++++++++++++++++++---------
 2 files changed, 1072 insertions(+), 440 deletions(-)

diffs (truncated from 1758 to 300 lines):

diff -r c602011ded4e -r 2f88408e756c tools/m68k-elf2aout/sys/aout_mids.h
--- a/tools/m68k-elf2aout/sys/aout_mids.h       Mon May 20 17:00:57 2019 +0000
+++ b/tools/m68k-elf2aout/sys/aout_mids.h       Mon May 20 18:24:57 2019 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: aout_mids.h,v 1.1 2011/07/16 15:52:02 tsutsui Exp $ */
+/* $NetBSD: aout_mids.h,v 1.2 2019/05/20 18:24:57 christos Exp $ */
 
 /*
  * Copyright (c) 2009, The NetBSD Foundation, Inc.
@@ -25,44 +25,56 @@
  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-#ifndef _SYS_MACHINE_IDS_H_
-#define _SYS_MACHINE_IDS_H_
-
+#ifndef _SYS_AOUT_MIDS_H_
+#define _SYS_AOUT_MIDS_H_
 
 /*
  * a_mid - keep sorted in numerical order for sanity's sake
  * ensure that: 0 < mid < 0x3ff
+ *
+ * NB: These are still being used in kernel core files.
  */
-#define        MID_ZERO        0       /* unknown - implementation dependent */
-#define        MID_SUN010      1       /* sun 68010/68020 binary */
-#define        MID_SUN020      2       /* sun 68020-only binary */
-#define        MID_PC386       100     /* 386 PC binary. (so quoth BFD) */
-#define        MID_HP200       200     /* hp200 (68010) BSD binary */
-#define        MID_I386        134     /* i386 BSD binary */
-#define        MID_M68K        135     /* m68k BSD binary with 8K page sizes */
-#define        MID_M68K4K      136     /* m68k BSD binary with 4K page sizes */
-#define        MID_NS32532     137     /* ns32532 */
-#define        MID_SPARC       138     /* sparc */
-#define        MID_PMAX        139     /* pmax */
-#define        MID_VAX1K       140     /* VAX 1K page size binaries */
-#define        MID_ALPHA       141     /* Alpha BSD binary */
-#define        MID_MIPS        142     /* big-endian MIPS */
-#define        MID_ARM6        143     /* ARM6 */
-#define        MID_M680002K    144     /* m68000 with 2K page sizes */
-#define        MID_SH3         145     /* SH3 */
-#define        MID_POWERPC     149     /* big-endian PowerPC */
-#define        MID_VAX         150     /* VAX */
-                               /* 151 - MIPS1 */
-                               /* 152 - MIPS2 */
-#define        MID_M88K        153     /* m88k BSD */
-#define        MID_HPPA        154     /* HP PARISC */
-#define        MID_SH5_64      155     /* LP64 SH5 */
-#define        MID_SPARC64     156     /* LP64 sparc */
-#define        MID_X86_64      157     /* AMD x86-64 */
-#define        MID_SH5_32      158     /* ILP32 SH5 */
-#define        MID_HP200       200     /* hp200 (68010) BSD binary */
-#define        MID_HP300       300     /* hp300 (68020+68881) BSD binary */
-#define        MID_HPUX        0x20C   /* hp200/300 HP-UX binary */
-#define        MID_HPUX800     0x20B   /* hp800 HP-UX binary */
+#define        MID_ZERO        0x000   /* unknown - implementation dependent */
+#define        MID_SUN010      0x001   /* sun 68010/68020 binary */
+#define        MID_SUN020      0x002   /* sun 68020-only binary */
+
+#define        MID_PC386       0x064   /* 386 PC binary. (so quoth BFD) */
+
+#define        MID_I386        0x086   /* i386 BSD binary */
+#define        MID_M68K        0x087   /* m68k BSD binary with 8K page sizes */
+#define        MID_M68K4K      0x088   /* m68k BSD binary with 4K page sizes */
+#define        MID_NS32532     0x089   /* ns32532 */
+#define        MID_SPARC       0x08a   /* sparc */
+#define        MID_PMAX        0x08b   /* pmax */
+#define        MID_VAX1K       0x08c   /* VAX 1K page size binaries */
+#define        MID_ALPHA       0x08d   /* Alpha BSD binary */
+#define        MID_MIPS        0x08e   /* big-endian MIPS */
+#define        MID_ARM6        0x08f   /* ARM6 */
+#define        MID_M680002K    0x090   /* m68000 with 2K page sizes */
+#define        MID_SH3         0x091   /* SH3 */
 
-#endif /* _SYS_MACHINE_IDS_H_ */
+#define        MID_POWERPC64   0x094   /* big-endian PowerPC 64 */
+#define        MID_POWERPC     0x095   /* big-endian PowerPC */
+#define        MID_VAX         0x096   /* VAX */
+#define        MID_MIPS1       0x097   /* MIPS1 */
+#define        MID_MIPS2       0x098   /* MIPS2 */
+#define        MID_M88K        0x099   /* m88k BSD */
+#define        MID_HPPA        0x09a   /* HP PARISC */
+#define        MID_SH5_64      0x09b   /* LP64 SH5 */
+#define        MID_SPARC64     0x09c   /* LP64 sparc */
+#define        MID_X86_64      0x09d   /* AMD x86-64 */
+#define        MID_SH5_32      0x09e   /* ILP32 SH5 */
+#define        MID_IA64        0x09f   /* Itanium */
+
+#define        MID_AARCH64     0x0b7   /* ARM AARCH64 */
+#define        MID_OR1K        0x0b8   /* OpenRISC 1000 */
+#define        MID_RISCV       0x0b9   /* Risc-V */
+
+#define        MID_HP200       0x0c8   /* hp200 (68010) BSD binary */
+
+#define        MID_HP300       0x12c   /* hp300 (68020+68881) BSD binary */
+
+#define        MID_HPUX800     0x20b   /* hp800 HP-UX binary */
+#define        MID_HPUX        0x20c   /* hp200/300 HP-UX binary */
+
+#endif /* _SYS_AOUT_MIDS_H_ */
diff -r c602011ded4e -r 2f88408e756c tools/m68k-elf2aout/sys/exec_elf.h
--- a/tools/m68k-elf2aout/sys/exec_elf.h        Mon May 20 17:00:57 2019 +0000
+++ b/tools/m68k-elf2aout/sys/exec_elf.h        Mon May 20 18:24:57 2019 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: exec_elf.h,v 1.2 2014/01/03 16:50:54 dsl Exp $ */
+/*     $NetBSD: exec_elf.h,v 1.3 2019/05/20 18:24:57 christos Exp $    */
 
 /*-
  * Copyright (c) 1994 The NetBSD Foundation, Inc.
@@ -30,60 +30,71 @@
  */
 
 #ifndef _SYS_EXEC_ELF_H_
-#define        _SYS_EXEC_ELF_H_
+#define _SYS_EXEC_ELF_H_
 
 /*
  * The current ELF ABI specification is available at:
- *     http://www.sco.com/developer/gabi/
+ *     http://www.sco.com/developers/gabi/
  *
  * Current header definitions are in:
- *     http://www.sco.com/developer/gabi/latest/ch4.eheader.html
+ *     http://www.sco.com/developers/gabi/latest/ch4.eheader.html
  */
 
 #if defined(_KERNEL) || defined(_STANDALONE)
 #include <sys/types.h>
 #else
 #include <inttypes.h>
+#include <stddef.h>
 #endif /* _KERNEL || _STANDALONE */
 
-typedef        uint8_t         Elf_Byte;
+#if 0
+#if HAVE_NBTOOL_CONFIG_H
+#include <nbinclude/machine/elf_machdep.h>
+#else
+#include <machine/elf_machdep.h>
+#endif
+#endif
 
-typedef        uint32_t        Elf32_Addr;
-#define        ELF32_FSZ_ADDR  4
-typedef        uint32_t        Elf32_Off;
-#define        ELF32_FSZ_OFF   4
-typedef        int32_t         Elf32_Sword;
-#define        ELF32_FSZ_SWORD 4
-typedef        uint32_t        Elf32_Word;
-#define        ELF32_FSZ_WORD  4
-typedef        uint16_t        Elf32_Half;
-#define        ELF32_FSZ_HALF  2
+typedef uint8_t                Elf_Byte;
 
-typedef        uint64_t        Elf64_Addr;
-#define        ELF64_FSZ_ADDR  8
-typedef        uint64_t        Elf64_Off;
-#define        ELF64_FSZ_OFF   8
+typedef uint32_t       Elf32_Addr;
+#define ELF32_FSZ_ADDR 4
+typedef uint32_t       Elf32_Off;
+typedef int32_t                Elf32_SOff;
+#define ELF32_FSZ_OFF  4
+typedef int32_t                Elf32_Sword;
+#define ELF32_FSZ_SWORD 4
+typedef uint32_t       Elf32_Word;
+#define ELF32_FSZ_WORD 4
+typedef uint16_t       Elf32_Half;
+#define ELF32_FSZ_HALF 2
+typedef uint64_t       Elf32_Lword;
+#define ELF32_FSZ_LWORD 8
 
-#ifndef ELF64_FSZ_SWORD
-typedef        int32_t         Elf64_Sword;
-#define        ELF64_FSZ_SWORD 4
-#endif /* ELF64_FSZ_SWORD */
-#ifndef ELF64_FSZ_WORD
-typedef        uint32_t        Elf64_Word;
-#define        ELF64_FSZ_WORD  4
-#endif /* ELF64_FSZ_WORD */
+typedef uint64_t       Elf64_Addr;
+#define ELF64_FSZ_ADDR 8
+typedef uint64_t       Elf64_Off;
+typedef int64_t                Elf64_SOff;
+#define ELF64_FSZ_OFF  8
 
-typedef        int64_t         Elf64_Sxword;
-#define        ELF64_FSZ_XWORD 8
-typedef        uint64_t        Elf64_Xword;
-#define        ELF64_FSZ_XWORD 8
-typedef        uint16_t        Elf64_Half;
-#define        ELF64_FSZ_HALF 2
+typedef int32_t                Elf64_Sword;
+#define ELF64_FSZ_SWORD 4
+typedef uint32_t       Elf64_Word;
+#define ELF64_FSZ_WORD 4
+
+typedef int64_t                Elf64_Sxword;
+#define ELF64_FSZ_SXWORD 8
+typedef uint64_t       Elf64_Xword;
+#define ELF64_FSZ_XWORD 8
+typedef uint64_t       Elf64_Lword;
+#define ELF64_FSZ_LWORD 8
+typedef uint16_t       Elf64_Half;
+#define ELF64_FSZ_HALF 2
 
 /*
  * ELF Header
  */
-#define        ELF_NIDENT      16
+#define ELF_NIDENT     16
 
 typedef struct {
        unsigned char   e_ident[ELF_NIDENT];    /* Id bytes */
@@ -94,12 +105,12 @@
        Elf32_Off       e_phoff;                /* Program hdr offset */
        Elf32_Off       e_shoff;                /* Section hdr offset */
        Elf32_Word      e_flags;                /* Processor flags */
-       Elf32_Half      e_ehsize;               /* sizeof ehdr */
-       Elf32_Half      e_phentsize;            /* Program header entry size */
-       Elf32_Half      e_phnum;                /* Number of program headers */
-       Elf32_Half      e_shentsize;            /* Section header entry size */
-       Elf32_Half      e_shnum;                /* Number of section headers */
-       Elf32_Half      e_shstrndx;             /* String table index */
+       Elf32_Half      e_ehsize;               /* sizeof ehdr */
+       Elf32_Half      e_phentsize;            /* Program header entry size */
+       Elf32_Half      e_phnum;                /* Number of program headers */
+       Elf32_Half      e_shentsize;            /* Section header entry size */
+       Elf32_Half      e_shnum;                /* Number of section headers */
+       Elf32_Half      e_shstrndx;             /* String table index */
 } Elf32_Ehdr;
 
 typedef struct {
@@ -120,44 +131,45 @@
 } Elf64_Ehdr;
 
 /* e_ident offsets */
-#define        EI_MAG0         0       /* '\177' */
-#define        EI_MAG1         1       /* 'E'    */
-#define        EI_MAG2         2       /* 'L'    */
-#define        EI_MAG3         3       /* 'F'    */
-#define        EI_CLASS        4       /* File class */
-#define        EI_DATA         5       /* Data encoding */
-#define        EI_VERSION      6       /* File version */
-#define        EI_OSABI        7       /* Operating system/ABI identification */
-#define        EI_ABIVERSION   8       /* ABI version */
-#define        EI_PAD          9       /* Start of padding bytes up to EI_NIDENT*/
+#define EI_MAG0                0       /* '\177' */
+#define EI_MAG1                1       /* 'E'    */
+#define EI_MAG2                2       /* 'L'    */
+#define EI_MAG3                3       /* 'F'    */
+#define EI_CLASS       4       /* File class */
+#define EI_DATA                5       /* Data encoding */
+#define EI_VERSION     6       /* File version */
+#define EI_OSABI       7       /* Operating system/ABI identification */
+#define EI_ABIVERSION  8       /* ABI version */
+#define EI_PAD         9       /* Start of padding bytes up to EI_NIDENT*/
+#define EI_NIDENT      16      /* First non-ident header byte */
 
-/* e_ident[ELFMAG0,ELFMAG3] */
-#define        ELFMAG0         0x7f
-#define        ELFMAG1         'E'
-#define        ELFMAG2         'L'
-#define        ELFMAG3         'F'
-#define        ELFMAG          "\177ELF"
-#define        SELFMAG         4
+/* e_ident[EI_MAG0,EI_MAG3] */
+#define ELFMAG0                0x7f
+#define ELFMAG1                'E'
+#define ELFMAG2                'L'
+#define ELFMAG3                'F'
+#define ELFMAG         "\177ELF"
+#define SELFMAG                4
 
 /* e_ident[EI_CLASS] */
-#define        ELFCLASSNONE    0       /* Invalid class */
-#define        ELFCLASS32      1       /* 32-bit objects */
-#define        ELFCLASS64      2       /* 64-bit objects */
-#define        ELFCLASSNUM     3
+#define ELFCLASSNONE   0       /* Invalid class */
+#define ELFCLASS32     1       /* 32-bit objects */
+#define ELFCLASS64     2       /* 64-bit objects */
+#define ELFCLASSNUM    3
 
 /* e_ident[EI_DATA] */
-#define        ELFDATANONE     0       /* Invalid data encoding */
-#define        ELFDATA2LSB     1       /* 2's complement values, LSB first */
-#define        ELFDATA2MSB     2       /* 2's complement values, MSB first */
+#define ELFDATANONE    0       /* Invalid data encoding */
+#define ELFDATA2LSB    1       /* 2's complement values, LSB first */
+#define ELFDATA2MSB    2       /* 2's complement values, MSB first */
 
 /* e_ident[EI_VERSION] */
-#define        EV_NONE         0       /* Invalid version */
-#define        EV_CURRENT      1       /* Current version */
-#define        EV_NUM          2
+#define EV_NONE                0       /* Invalid version */
+#define EV_CURRENT     1       /* Current version */
+#define EV_NUM         2



Home | Main Index | Thread Index | Old Index