On 16/01/18(Tue) 14:17, Karel Gardas wrote:
> [...] 
> The patch looks good if you are OK with adding values which are no longer in
> spec. IMHO I do not see value in those,

What if somebody use them in their code?  Removing them would break
their app for free.  That's why I see value in those ;)

> so I would kill everything which is not in spec and does not break OpenBSD
> build or any of ports. Related comments below.

Updated diff, does it work for you?

Index: sys/exec_elf.h
===================================================================
RCS file: /cvs/src/sys/sys/exec_elf.h,v
retrieving revision 1.78
diff -u -p -r1.78 exec_elf.h
--- sys/exec_elf.h      9 Dec 2017 06:35:08 -0000       1.78
+++ sys/exec_elf.h      17 Jan 2018 11:11:19 -0000
@@ -106,15 +106,20 @@ typedef __uint16_t        Elf64_Quarter;
 #define ELFOSABI_HURD          4       /* GNU/Hurd */
 #define ELFOSABI_86OPEN                5       /* 86Open common IA32 ABI */
 #define ELFOSABI_SOLARIS       6       /* Solaris */
-#define ELFOSABI_MONTEREY      7       /* Monterey */
+#define ELFOSABI_AIX           7       /* AIX */
 #define ELFOSABI_IRIX          8       /* IRIX */
 #define ELFOSABI_FREEBSD       9       /* FreeBSD */
 #define ELFOSABI_TRU64         10      /* TRU64 UNIX */
 #define ELFOSABI_MODESTO       11      /* Novell Modesto */
 #define ELFOSABI_OPENBSD       12      /* OpenBSD */
+#define ELFOSABI_OPENVMS       13      /* Open VMS */
+#define ELFOSABI_NSK           14      /* HP Non-Stop Kernel */
 #define ELFOSABI_ARM           97      /* ARM */
 #define ELFOSABI_STANDALONE    255     /* Standalone (embedded) application */
 
+#define ELFOSABI_NONE          ELFOSABI_SYSV   /* symbol used in old spec */
+#define ELFOSABI_MONTEREY      ELFOSABI_AIX    /* Monterey */
+
 /* e_ident */
 #define IS_ELF(ehdr) ((ehdr).e_ident[EI_MAG0] == ELFMAG0 && \
                       (ehdr).e_ident[EI_MAG1] == ELFMAG1 && \
@@ -164,8 +169,10 @@ typedef struct {
 #define ET_DYN         3               /* shared object file */
 #define ET_CORE                4               /* core file */
 #define ET_NUM         5               /* number of types */
-#define ET_LOPROC      0xff00          /* reserved range for processor */
-#define ET_HIPROC      0xffff          /*  specific e_type */
+#define ET_LOOS                0xfe00          /* First operating system 
specific. */
+#define ET_HIOS                0xfeff          /* Last operating 
system-specific. */
+#define ET_LOPROC      0xff00          /* First processor-specific. */
+#define ET_HIPROC      0xffff          /*  Last processor-specific. */
 
 /* e_machine */
 #define EM_NONE                0               /* No Machine */
@@ -241,25 +248,31 @@ typedef struct {
 #define SHN_LORESERVE  0xff00          /* lower bounds of reserved indexes */
 #define SHN_LOPROC     0xff00          /* reserved range for processor */
 #define SHN_HIPROC     0xff1f          /*   specific section indexes */
+#define SHN_LOOS       0xff20          /* First operating system-specific. */
+#define SHN_HIOS       0xff3f          /* Last operating system-specific. */
 #define SHN_ABS                0xfff1          /* absolute value */
 #define SHN_COMMON     0xfff2          /* common symbol */
 #define SHN_XINDEX     0xffff          /* Escape -- index stored elsewhere. */
 #define SHN_HIRESERVE  0xffff          /* upper bounds of reserved indexes */
 
 /* sh_type */
-#define SHT_NULL       0               /* inactive */
-#define SHT_PROGBITS   1               /* program defined information */
-#define SHT_SYMTAB     2               /* symbol table section */
-#define SHT_STRTAB     3               /* string table section */
-#define SHT_RELA       4               /* relocation section with addends*/
-#define SHT_HASH       5               /* symbol hash table section */
-#define SHT_DYNAMIC    6               /* dynamic section */
-#define SHT_NOTE       7               /* note section */
-#define SHT_NOBITS     8               /* no space section */
-#define SHT_REL                9               /* relation section without 
addends */
-#define SHT_SHLIB      10              /* reserved - purpose unknown */
-#define SHT_DYNSYM     11              /* dynamic symbol table section */
-#define SHT_NUM                12              /* number of section types */
+#define SHT_NULL               0       /* inactive */
+#define SHT_PROGBITS           1       /* program defined information */
+#define SHT_SYMTAB             2       /* symbol table section */
+#define SHT_STRTAB             3       /* string table section */
+#define SHT_RELA               4       /* relocation section with addends*/
+#define SHT_HASH               5       /* symbol hash table section */
+#define SHT_DYNAMIC            6       /* dynamic section */
+#define SHT_NOTE               7       /* note section */
+#define SHT_NOBITS             8       /* no space section */
+#define SHT_REL                        9       /* relation section without 
addends */
+#define SHT_SHLIB              10      /* reserved - purpose unknown */
+#define SHT_DYNSYM             11      /* dynamic symbol table section */
+#define SHT_INIT_ARRAY         14      /* Initialization function pointers. */
+#define SHT_FINI_ARRAY         15      /* Termination function pointers. */
+#define SHT_PREINIT_ARRAY      16      /* Pre-initialization function ptrs. */
+#define SHT_GROUP              17      /* Section group. */
+#define SHT_SYMTAB_SHNDX       18      /* Section indexes (see SHN_XINDEX). */
 #define SHT_LOPROC     0x70000000      /* reserved range for processor */
 #define SHT_HIPROC     0x7fffffff      /*  specific section header types */
 #define SHT_LOUSER     0x80000000      /* reserved range for application */
@@ -338,15 +351,17 @@ typedef struct {
 #define ELF64_ST_TYPE(x)       (((unsigned int) x) & 0xf)
 #define ELF64_ST_INFO(b,t)     (((b) << 4) + ((t) & 0xf))
 
-/* Symbol Binding - ELF32_ST_BIND - st_info */
-#define STB_LOCAL      0               /* Local symbol */
-#define STB_GLOBAL     1               /* Global symbol */
-#define STB_WEAK       2               /* like global - lower precedence */
-#define STB_NUM                3               /* number of symbol bindings */
-#define STB_LOPROC     13              /* reserved range for processor */
-#define STB_HIPROC     15              /*  specific symbol bindings */
+/* Symbol Binding - ELFNN_ST_BIND - st_info */
+#define STB_LOCAL      0       /* Local symbol */
+#define STB_GLOBAL     1       /* Global symbol */
+#define STB_WEAK       2       /* like global - lower precedence */
+#define STB_NUM                3       /* number of symbol bindings */
+#define STB_LOOS       10      /* Start of operating system reserved range. */
+#define STB_HIOS       12      /* End of operating system reserved range. */
+#define STB_LOPROC     13      /* reserved range for processor */
+#define STB_HIPROC     15      /*  specific symbol bindings */
 
-/* Symbol type - ELF32_ST_TYPE - st_info */
+/* Symbol type - ELFNN_ST_TYPE - st_info */
 #define STT_NOTYPE     0               /* not specified */
 #define STT_OBJECT     1               /* data object */
 #define STT_FUNC       2               /* function */

Reply via email to