diff options
author | 2003-05-13 16:40:37 +0000 | |
---|---|---|
committer | 2003-05-13 16:40:37 +0000 | |
commit | 466ca89203806a9b37cb736e66bdf37a5ad28613 (patch) | |
tree | 6b00f8d592b00014bdacdf72f6bc398054c16803 | |
parent | Use EI_OSABI instead of EI_BRAND (diff) | |
download | wireguard-openbsd-466ca89203806a9b37cb736e66bdf37a5ad28613.tar.xz wireguard-openbsd-466ca89203806a9b37cb736e66bdf37a5ad28613.zip |
De-hackify. Use proper defines now that we have EI_OSABI and ELFOSABI_FREEBSD
-rw-r--r-- | sys/compat/freebsd/freebsd_exec.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/sys/compat/freebsd/freebsd_exec.c b/sys/compat/freebsd/freebsd_exec.c index f51f6c6330f..7f36ae19c8b 100644 --- a/sys/compat/freebsd/freebsd_exec.c +++ b/sys/compat/freebsd/freebsd_exec.c @@ -1,4 +1,4 @@ -/* $OpenBSD: freebsd_exec.c,v 1.13 2003/03/11 22:43:23 millert Exp $ */ +/* $OpenBSD: freebsd_exec.c,v 1.14 2003/05/13 16:40:37 millert Exp $ */ /* $NetBSD: freebsd_exec.c,v 1.2 1996/05/18 16:02:08 christos Exp $ */ /* @@ -157,8 +157,12 @@ freebsd_elf_probe(p, epp, itp, pos, os) int error; size_t len; + /* + * Older FreeBSD ELF binaries use a brand; newer ones use EI_OSABI + */ brand = elf32_check_brand(eh); - if ((brand == NULL || strcmp(brand, "FreeBSD")) && eh->e_ident[EI_PAD] != 9) + if ((brand == NULL || strcmp(brand, "FreeBSD")) && + eh->e_ident[EI_OSABI] != ELFOSABI_FREEBSD) return (EINVAL); if (itp[0]) { if ((error = emul_find(p, NULL, freebsd_emul_path, itp, &bp, 0))) |