Index: sys/kern/imgact_elf.c =================================================================== --- sys/kern/imgact_elf.c +++ sys/kern/imgact_elf.c @@ -71,6 +71,7 @@ #include #include #include +#include #include #include @@ -166,7 +167,7 @@ #define aligned(a, t) (rounddown2((u_long)(a), sizeof(t)) == (u_long)(a)) -static const char FREEBSD_ABI_VENDOR[] = "FreeBSD"; +static const char FREEBSD_ABI_VENDOR[] = ELF_NOTE_FREEBSD; Elf_Brandnote __elfN(freebsd_brandnote) = { .hdr.n_namesz = sizeof(FREEBSD_ABI_VENDOR), @@ -189,8 +190,8 @@ return (true); } -static const char GNU_ABI_VENDOR[] = "GNU"; -static int GNU_KFREEBSD_ABI_DESC = 3; +static const char GNU_ABI_VENDOR[] = ELF_NOTE_GNU; +static int GNU_KFREEBSD_ABI_DESC = ELF_NOTE_OS_FREEBSD; Elf_Brandnote __elfN(kfreebsd_brandnote) = { .hdr.n_namesz = sizeof(GNU_ABI_VENDOR), Index: sys/sys/elf_common.h =================================================================== --- sys/sys/elf_common.h +++ sys/sys/elf_common.h @@ -806,6 +806,22 @@ #define NT_GNU_GOLD_VERSION 4 #define NT_GNU_PROPERTY_TYPE_0 5 +/* FreeBSD note section name */ +#define ELF_NOTE_FREEBSD "FreeBSD" +/* NetBSD note section name */ +#define ELF_NOTE_NETBSD "NetBSD" +/* Solaris note section name */ +#define ELF_NOTE_SOLARIS "SUNW Solaris" +/* Note section name for GNU systems */ +#define ELF_NOTE_GNU "GNU" + +/* Known OS numbers in word 0 of NT_GNU_ABI_TAG note section entry */ +#define ELF_NOTE_OS_LINUX 0 +#define ELF_NOTE_OS_GNU 1 +#define ELF_NOTE_OS_SOLARIS2 2 +#define ELF_NOTE_OS_FREEBSD 3 +#define ELF_NOTE_OS_NETBSD 4 + #define GNU_PROPERTY_LOPROC 0xc0000000 #define GNU_PROPERTY_HIPROC 0xdfffffff