Module Name: src Committed By: christos Date: Tue Jul 19 19:46:13 UTC 2011
Modified Files: src/sys/sys: exec_elf.h Log Message: document all the notes we know about in a consistent fashion. XXX: someone please document the checksum tags. To generate a diff of this commit: cvs rdiff -u -r1.113 -r1.114 src/sys/sys/exec_elf.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/sys/sys/exec_elf.h diff -u src/sys/sys/exec_elf.h:1.113 src/sys/sys/exec_elf.h:1.114 --- src/sys/sys/exec_elf.h:1.113 Sat Jun 25 01:45:10 2011 +++ src/sys/sys/exec_elf.h Tue Jul 19 15:46:13 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: exec_elf.h,v 1.113 2011/06/25 05:45:10 nonaka Exp $ */ +/* $NetBSD: exec_elf.h,v 1.114 2011/07/19 19:46:13 christos Exp $ */ /*- * Copyright (c) 1994 The NetBSD Foundation, Inc. @@ -169,10 +169,10 @@ /* e_ident[EI_OSABI] */ #define ELFOSABI_SYSV 0 /* UNIX System V ABI */ #define ELFOSABI_HPUX 1 /* HP-UX operating system */ -#define ELFOSABI_NETBSD 2 /* NetBSD */ +#define ELFOSABI_NETBSD 2 /* NetBSD */ #define ELFOSABI_LINUX 3 /* GNU/Linux */ -#define ELFOSABI_HURD 4 /* GNU/Hurd */ -#define ELFOSABI_86OPEN 5 /* 86Open */ +#define ELFOSABI_HURD 4 /* GNU/Hurd */ +#define ELFOSABI_86OPEN 5 /* 86Open */ #define ELFOSABI_SOLARIS 6 /* Solaris */ #define ELFOSABI_MONTEREY 7 /* Monterey */ #define ELFOSABI_IRIX 8 /* IRIX */ @@ -746,20 +746,67 @@ Elf64_Word n_type; } Elf64_Nhdr; -#define ELF_NOTE_TYPE_ABI_TAG 1 +#define ELF_NOTE_GNU_NAMESZ 4 +#define ELF_NOTE_GNU_NAME "GNU\0" +/* + * GNU-specific note type: ABI tag + * name: GNU\0 + * namesz: 4 + * desc: + * word[0]: OS tag + * word[1]: major version + * word[2]: minor version + * word[3]: teeny version + * descsz: 16 + */ /* GNU-specific note name and description sizes */ -#define ELF_NOTE_ABI_NAMESZ 4 +#define ELF_NOTE_TYPE_ABI_TAG 1 +#define ELF_NOTE_ABI_NAME ELF_NOTE_GNU_NAME +#define ELF_NOTE_ABI_NAMESZ ELF_NOTE_GNU_NAMESZ #define ELF_NOTE_ABI_DESCSZ 16 -/* GNU-specific note name */ -#define ELF_NOTE_ABI_NAME "GNU\0" - /* GNU-specific OS/version value stuff */ #define ELF_NOTE_ABI_OS_LINUX 0 #define ELF_NOTE_ABI_OS_HURD 1 #define ELF_NOTE_ABI_OS_SOLARIS 2 +#define ELF_NOTE_ABI_OS_KFREEBSD 3 +#define ELF_NOTE_ABI_OS_KNETBSD 4 -/* NetBSD-specific note type: Emulation name. desc is emul name string. */ +/* + * GNU-specific note type: Hardware capabilities + * name: GNU\0 + * namesz: 4 + * desc: + * word[0]: Number of entries + * word[1]: Bitmask of enabled entries + * Followed by a byte id, and a NUL terminated string per entry + * descsz: variable + */ +#define ELF_NOTE_TYPE_GNU_HWCAP 2 + +/* + * GNU-specific note type: Build ID generated by ld + * name: GNU\0 + * desc: + * word[0..4] SHA1 [default] + * or + * word[0..3] md5 or uuid + * descsz: 16 or 20 + */ +#define ELF_NOTE_TYPE_GNU_BUILD_ID 3 + +/* NetBSD-specific note type: Emulation name. + * name: NetBSD\0\0 + * namesz: 8 + * desc: + * word[0]: MMmmrrpp00 + * + * M = major version + * m = minor version + * r = release ["",A-Z,Z[A-Z] but numeric] + * p = patchlevel + * descsz: 4 + */ #define ELF_NOTE_TYPE_NETBSD_TAG 1 /* NetBSD-specific note name and description sizes */ #define ELF_NOTE_NETBSD_NAMESZ 7 @@ -767,16 +814,29 @@ /* NetBSD-specific note name */ #define ELF_NOTE_NETBSD_NAME "NetBSD\0\0" -/* NetBSD-specific note type: Checksum. There should be 1 NOTE per PT_LOAD - section. desc is a tuple of <phnum>(16),<chk-type>(16),<chk-value>. */ +/* NetBSD-specific note type: Checksum. + * There should be 1 NOTE per PT_LOAD section. + * name: ??? + * namesz: ??? + * desc: + * a tuple of <phnum>(16),<chk-type>(16),<chk-value>. + * descsz: ??? + */ #define ELF_NOTE_TYPE_CHECKSUM_TAG 2 #define ELF_NOTE_CHECKSUM_CRC32 1 #define ELF_NOTE_CHECKSUM_MD5 2 #define ELF_NOTE_CHECKSUM_SHA1 3 #define ELF_NOTE_CHECKSUM_SHA256 4 -/* NetBSD-specific note type: PaX. There should be 1 NOTE per executable. - section. desc is a 32 bit bitmask */ +/* + * NetBSD-specific note type: PaX. + * There should be 1 NOTE per executable. + * name: PaX\0 + * namesz: 4 + * desc: + * word[0]: capability bitmask + * descsz: 4 + */ #define ELF_NOTE_TYPE_PAX_TAG 3 #define ELF_NOTE_PAX_MPROTECT 0x01 /* Force enable Mprotect */ #define ELF_NOTE_PAX_NOMPROTECT 0x02 /* Force disable Mprotect */