summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTodd C. Miller <millert@cvs.openbsd.org>2003-05-13 16:39:24 +0000
committerTodd C. Miller <millert@cvs.openbsd.org>2003-05-13 16:39:24 +0000
commit5012c831c332b2006450ea5b18471e5a3d31a45f (patch)
tree10bc70209a7dbdba361a433c5100e9bc20e5cf61
parentbb325e7b36afb8a252b9db1e956b0e40fc7600cd (diff)
Use EI_OSABI instead of EI_BRAND
-rw-r--r--sys/kern/exec_elf.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/sys/kern/exec_elf.c b/sys/kern/exec_elf.c
index 982a43412db..4ee10c9af01 100644
--- a/sys/kern/exec_elf.c
+++ b/sys/kern/exec_elf.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: exec_elf.c,v 1.45 2003/04/16 21:17:52 drahn Exp $ */
+/* $OpenBSD: exec_elf.c,v 1.46 2003/05/13 16:39:23 millert Exp $ */
/*
* Copyright (c) 1996 Per Fogelstrom
@@ -833,12 +833,16 @@ ELFNAME2(exec,fixup)(struct proc *p, struct exec_package *epp)
return (error);
}
+/*
+ * Older ELF binaries use EI_ABIVERSION (formerly EI_BRAND) to brand
+ * executables. Newer ELF binaries use EI_OSABI instead.
+ */
char *
ELFNAME(check_brand)(Elf_Ehdr *eh)
{
- if (eh->e_ident[EI_BRAND] == '\0')
+ if (eh->e_ident[EI_ABIVERSION] == '\0')
return (NULL);
- return (&eh->e_ident[EI_BRAND]);
+ return (&eh->e_ident[EI_ABIVERSION]);
}
int