Source-Changes-HG archive

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

[src/trunk]: src Replace the current usage of Elf64_Half with Elf64_Word and ...



details:   https://anonhg.NetBSD.org/src/rev/402d1289571c
branches:  trunk
changeset: 757430:402d1289571c
user:      joerg <joerg%NetBSD.org@localhost>
date:      Sat Aug 28 21:30:02 2010 +0000

description:
Replace the current usage of Elf64_Half with Elf64_Word and rename
NetBSD specific Elf64_Quarter to Elf64_Half. This restores compatibility
with the common ELF specifications.

diffstat:

 lib/libc/gen/nlist_elf32.c                      |   6 +-
 sys/arch/atari/stand/tostools/libtos/exec_elf.h |   8 +--
 sys/arch/xen/include/xen3-public/elfstructs.h   |  48 +++++++++----------
 sys/sys/exec_elf.h                              |  60 ++++++++++++------------
 tools/amiga-elf2bb/sys/exec_elf.h               |  52 ++++++++++-----------
 tools/mips-elf2ecoff/sys/exec_elf.h             |  52 ++++++++++-----------
 usr.sbin/kvm_mkdb/nlist_elf32.c                 |   6 +-
 usr.sbin/mdsetimage/exec_elf32.c                |   6 +-
 8 files changed, 114 insertions(+), 124 deletions(-)

diffs (truncated from 582 to 300 lines):

diff -r d37b3747e9ea -r 402d1289571c lib/libc/gen/nlist_elf32.c
--- a/lib/libc/gen/nlist_elf32.c        Sat Aug 28 20:54:24 2010 +0000
+++ b/lib/libc/gen/nlist_elf32.c        Sat Aug 28 21:30:02 2010 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: nlist_elf32.c,v 1.31 2009/08/21 08:42:02 he Exp $ */
+/* $NetBSD: nlist_elf32.c,v 1.32 2010/08/28 21:30:02 joerg Exp $ */
 
 /*
  * Copyright (c) 1996 Christopher G. Demetriou
@@ -36,7 +36,7 @@
 
 #include <sys/cdefs.h>
 #if defined(LIBC_SCCS) && !defined(lint)
-__RCSID("$NetBSD: nlist_elf32.c,v 1.31 2009/08/21 08:42:02 he Exp $");
+__RCSID("$NetBSD: nlist_elf32.c,v 1.32 2010/08/28 21:30:02 joerg Exp $");
 #endif /* LIBC_SCCS and not lint */
 
 /* If not included by nlist_elf64.c, ELFSIZE won't be defined. */
@@ -89,7 +89,7 @@
 #if (ELFSIZE == 32)
        Elf32_Half nshdr;
 #elif (ELFSIZE == 64)
-       Elf64_Half nshdr;
+       Elf64_Word nshdr;
 #endif
        size_t i, nsyms;
        int rv, nent;
diff -r d37b3747e9ea -r 402d1289571c sys/arch/atari/stand/tostools/libtos/exec_elf.h
--- a/sys/arch/atari/stand/tostools/libtos/exec_elf.h   Sat Aug 28 20:54:24 2010 +0000
+++ b/sys/arch/atari/stand/tostools/libtos/exec_elf.h   Sat Aug 28 21:30:02 2010 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: exec_elf.h,v 1.5 2008/04/28 20:23:15 martin Exp $      */
+/*     $NetBSD: exec_elf.h,v 1.6 2010/08/28 21:30:02 joerg Exp $       */
 
 /*-
  * Copyright (c) 1994 The NetBSD Foundation, Inc.
@@ -95,10 +95,8 @@
 #define        ELF64_FSZ_XWORD 8
 typedef        __uint64_t      Elf64_Xword;
 #define        ELF64_FSZ_XWORD 8
-typedef        __uint32_t      Elf64_Half;
-#define        ELF64_FSZ_HALF  4
-typedef        __uint16_t      Elf64_Quarter;
-#define        ELF64_FSZ_QUARTER 2
+typedef        __uint16_t      Elf64_Half;
+#define        ELF64_FSZ_HALF 2
 
 /*
  * ELF Header
diff -r d37b3747e9ea -r 402d1289571c sys/arch/xen/include/xen3-public/elfstructs.h
--- a/sys/arch/xen/include/xen3-public/elfstructs.h     Sat Aug 28 20:54:24 2010 +0000
+++ b/sys/arch/xen/include/xen3-public/elfstructs.h     Sat Aug 28 21:30:02 2010 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: elfstructs.h,v 1.2 2007/09/23 16:25:29 bouyer Exp $ */
+/* $NetBSD: elfstructs.h,v 1.3 2010/08/28 21:30:02 joerg Exp $ */
 #ifndef __XEN_PUBLIC_ELFSTRUCTS_H__
 #define __XEN_PUBLIC_ELFSTRUCTS_H__ 1
 /*
@@ -44,9 +44,7 @@
 
 typedef int64_t                Elf64_Sxword;
 typedef uint64_t       Elf64_Xword;
-
-typedef uint32_t       Elf64_Half;
-typedef uint16_t       Elf64_Quarter;
+typedef uint16_t       Elf64_Half;
 
 /*
  * e_ident[] identification indexes
@@ -128,19 +126,19 @@
 
 typedef struct {
        unsigned char   e_ident[EI_NIDENT];     /* Id bytes */
-       Elf64_Quarter   e_type;                 /* file type */
-       Elf64_Quarter   e_machine;              /* machine type */
-       Elf64_Half      e_version;              /* version number */
+       Elf64_Half      e_type;                 /* file type */
+       Elf64_Half      e_machine;              /* machine type */
+       Elf64_Word      e_version;              /* version number */
        Elf64_Addr      e_entry;                /* entry point */
        Elf64_Off       e_phoff;                /* Program hdr offset */
        Elf64_Off       e_shoff;                /* Section hdr offset */
-       Elf64_Half      e_flags;                /* Processor flags */
-       Elf64_Quarter   e_ehsize;               /* sizeof ehdr */
-       Elf64_Quarter   e_phentsize;            /* Program header entry size */
-       Elf64_Quarter   e_phnum;                /* Number of program headers */
-       Elf64_Quarter   e_shentsize;            /* Section header entry size */
-       Elf64_Quarter   e_shnum;                /* Number of section headers */
-       Elf64_Quarter   e_shstrndx;             /* String table index */
+       Elf64_Word      e_flags;                /* Processor flags */
+       Elf64_Half      e_ehsize;               /* sizeof ehdr */
+       Elf64_Half      e_phentsize;            /* Program header entry size */
+       Elf64_Half      e_phnum;                /* Number of program headers */
+       Elf64_Half      e_shentsize;            /* Section header entry size */
+       Elf64_Half      e_shnum;                /* Number of section headers */
+       Elf64_Half      e_shstrndx;             /* String table index */
 } Elf64_Ehdr;
 
 /* e_type */
@@ -203,14 +201,14 @@
 } Elf32_Shdr;
 
 typedef struct {
-       Elf64_Half      sh_name;        /* section name */
-       Elf64_Half      sh_type;        /* section type */
+       Elf64_Word      sh_name;        /* section name */
+       Elf64_Word      sh_type;        /* section type */
        Elf64_Xword     sh_flags;       /* section flags */
        Elf64_Addr      sh_addr;        /* virtual address */
        Elf64_Off       sh_offset;      /* file offset */
        Elf64_Xword     sh_size;        /* section size */
-       Elf64_Half      sh_link;        /* link to another */
-       Elf64_Half      sh_info;        /* misc info */
+       Elf64_Word      sh_link;        /* link to another */
+       Elf64_Word      sh_info;        /* misc info */
        Elf64_Xword     sh_addralign;   /* memory alignment */
        Elf64_Xword     sh_entsize;     /* table entry size */
 } Elf64_Shdr;
@@ -285,10 +283,10 @@
 } Elf32_Sym;
 
 typedef struct {
-       Elf64_Half      st_name;        /* Symbol name index in str table */
+       Elf64_Word      st_name;        /* Symbol name index in str table */
        Elf_Byte        st_info;        /* type / binding attrs */
        Elf_Byte        st_other;       /* unused */
-       Elf64_Quarter   st_shndx;       /* section index of symbol */
+       Elf64_Half      st_shndx;       /* section index of symbol */
        Elf64_Xword     st_value;       /* value of symbol */
        Elf64_Xword     st_size;        /* size of symbol */
 } Elf64_Sym;
@@ -369,8 +367,8 @@
 } Elf32_Phdr;
 
 typedef struct {
-       Elf64_Half      p_type;         /* entry type */
-       Elf64_Half      p_flags;        /* flags */
+       Elf64_Word      p_type;         /* entry type */
+       Elf64_Word      p_flags;        /* flags */
        Elf64_Off       p_offset;       /* offset */
        Elf64_Addr      p_vaddr;        /* virtual address */
        Elf64_Addr      p_paddr;        /* physical address */
@@ -459,9 +457,9 @@
 } Elf32_Note;
 
 typedef struct {
-       Elf64_Half namesz;
-       Elf64_Half descsz;
-       Elf64_Half type;
+       Elf64_Word namesz;
+       Elf64_Word descsz;
+       Elf64_Word type;
 } Elf64_Note;
 
 
diff -r d37b3747e9ea -r 402d1289571c sys/sys/exec_elf.h
--- a/sys/sys/exec_elf.h        Sat Aug 28 20:54:24 2010 +0000
+++ b/sys/sys/exec_elf.h        Sat Aug 28 21:30:02 2010 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: exec_elf.h,v 1.102 2010/03/01 11:27:29 skrll Exp $     */
+/*     $NetBSD: exec_elf.h,v 1.103 2010/08/28 21:30:02 joerg Exp $     */
 
 /*-
  * Copyright (c) 1994 The NetBSD Foundation, Inc.
@@ -99,10 +99,8 @@
 #define        ELF64_FSZ_XWORD 8
 typedef        uint64_t        Elf64_Lword;
 #define        ELF64_FSZ_LWORD 8
-typedef        uint32_t        Elf64_Half;
-#define        ELF64_FSZ_HALF  4
-typedef        uint16_t        Elf64_Quarter;
-#define        ELF64_FSZ_QUARTER 2
+typedef        uint16_t        Elf64_Half;
+#define        ELF64_FSZ_HALF 2
 
 /*
  * ELF Header
@@ -128,19 +126,19 @@
 
 typedef struct {
        unsigned char   e_ident[ELF_NIDENT];    /* Id bytes */
-       Elf64_Quarter   e_type;                 /* file type */
-       Elf64_Quarter   e_machine;              /* machine type */
-       Elf64_Half      e_version;              /* version number */
+       Elf64_Half      e_type;                 /* file type */
+       Elf64_Half      e_machine;              /* machine type */
+       Elf64_Word      e_version;              /* version number */
        Elf64_Addr      e_entry;                /* entry point */
        Elf64_Off       e_phoff;                /* Program hdr offset */
        Elf64_Off       e_shoff;                /* Section hdr offset */
-       Elf64_Half      e_flags;                /* Processor flags */
-       Elf64_Quarter   e_ehsize;               /* sizeof ehdr */
-       Elf64_Quarter   e_phentsize;            /* Program header entry size */
-       Elf64_Quarter   e_phnum;                /* Number of program headers */
-       Elf64_Quarter   e_shentsize;            /* Section header entry size */
-       Elf64_Quarter   e_shnum;                /* Number of section headers */
-       Elf64_Quarter   e_shstrndx;             /* String table index */
+       Elf64_Word      e_flags;                /* Processor flags */
+       Elf64_Half      e_ehsize;               /* sizeof ehdr */
+       Elf64_Half      e_phentsize;            /* Program header entry size */
+       Elf64_Half      e_phnum;                /* Number of program headers */
+       Elf64_Half      e_shentsize;            /* Section header entry size */
+       Elf64_Half      e_shnum;                /* Number of section headers */
+       Elf64_Half      e_shstrndx;             /* String table index */
 } Elf64_Ehdr;
 
 /* e_ident offsets */
@@ -336,8 +334,8 @@
 } Elf32_Phdr;
 
 typedef struct {
-       Elf64_Half      p_type;         /* entry type */
-       Elf64_Half      p_flags;        /* flags */
+       Elf64_Word      p_type;         /* entry type */
+       Elf64_Word      p_flags;        /* flags */
        Elf64_Off       p_offset;       /* offset */
        Elf64_Addr      p_vaddr;        /* virtual address */
        Elf64_Addr      p_paddr;        /* physical address */
@@ -391,14 +389,14 @@
 } Elf32_Shdr;
 
 typedef struct {
-       Elf64_Half      sh_name;        /* section name (.shstrtab index) */
-       Elf64_Half      sh_type;        /* section type */
+       Elf64_Word      sh_name;        /* section name (.shstrtab index) */
+       Elf64_Word      sh_type;        /* section type */
        Elf64_Xword     sh_flags;       /* section flags */
        Elf64_Addr      sh_addr;        /* virtual address */
        Elf64_Off       sh_offset;      /* file offset */
        Elf64_Xword     sh_size;        /* section size */
-       Elf64_Half      sh_link;        /* link to another */
-       Elf64_Half      sh_info;        /* misc info */
+       Elf64_Word      sh_link;        /* link to another */
+       Elf64_Word      sh_info;        /* misc info */
        Elf64_Xword     sh_addralign;   /* memory alignment */
        Elf64_Xword     sh_entsize;     /* table entry size */
 } Elf64_Shdr;
@@ -460,10 +458,10 @@
 } Elf32_Sym;
 
 typedef struct {
-       Elf64_Half      st_name;        /* Symbol name (.strtab index) */
+       Elf64_Word      st_name;        /* Symbol name (.strtab index) */
        Elf_Byte        st_info;        /* type / binding attrs */
        Elf_Byte        st_other;       /* unused */
-       Elf64_Quarter   st_shndx;       /* section index of symbol */
+       Elf64_Half      st_shndx;       /* section index of symbol */
        Elf64_Addr      st_value;       /* value of symbol */
        Elf64_Xword     st_size;        /* size of symbol */
 } Elf64_Sym;
@@ -590,8 +588,8 @@
        Elf64_Lword     m_value;        /* symbol value */
        Elf64_Xword     m_info;         /* size + index */
        Elf64_Xword     m_poffset;      /* symbol offset */
-       Elf64_Half      m_repeat;       /* repeat count */
-       Elf64_Half      m_stride;       /* stride info */
+       Elf64_Word      m_repeat;       /* repeat count */
+       Elf64_Word      m_stride;       /* stride info */
 } Elf64_Move;
 
 #define        ELF64_M_SYM(info)       ((info) >> 8)
@@ -691,7 +689,7 @@
 } Aux32Info;
 
 typedef struct {
-       Elf64_Half      a_type;                         /* 32-bit id */
+       Elf64_Word      a_type;                         /* 32-bit id */
        Elf64_Xword     a_v;                            /* 64-bit id */
 } Aux64Info;
 
@@ -745,9 +743,9 @@
 } Elf32_Nhdr;
 
 typedef struct {
-       Elf64_Half n_namesz;
-       Elf64_Half n_descsz;
-       Elf64_Half n_type;
+       Elf64_Word n_namesz;
+       Elf64_Word n_descsz;
+       Elf64_Word n_type;
 } Elf64_Nhdr;
 
 #define        ELF_NOTE_TYPE_ABI_TAG           1
@@ -905,8 +903,8 @@
 } Elf32_Syminfo;
 
 typedef struct {
-       Elf64_Half      si_boundto;     /* direct bindings - symbol bound to */
-       Elf64_Half      si_flags;       /* per symbol flags */
+       Elf64_Word      si_boundto;     /* direct bindings - symbol bound to */
+       Elf64_Word      si_flags;       /* per symbol flags */
 } Elf64_Syminfo;
 
 #define        SYMINFO_FLG_DIRECT      0x0001  /* symbol ref has direct association
diff -r d37b3747e9ea -r 402d1289571c tools/amiga-elf2bb/sys/exec_elf.h
--- a/tools/amiga-elf2bb/sys/exec_elf.h Sat Aug 28 20:54:24 2010 +0000
+++ b/tools/amiga-elf2bb/sys/exec_elf.h Sat Aug 28 21:30:02 2010 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: exec_elf.h,v 1.2 2008/04/28 20:24:12 martin Exp $      */
+/*     $NetBSD: exec_elf.h,v 1.3 2010/08/28 21:30:02 joerg Exp $       */



Home | Main Index | Thread Index | Old Index