diff options
author | etheisen <etheisen@cvs.openbsd.org> | 1996-10-27 19:44:18 +0000 |
---|---|---|
committer | etheisen <etheisen@cvs.openbsd.org> | 1996-10-27 19:44:18 +0000 |
commit | 2d078fd034de2f0bcf7fefc1c3a64e6bd4255237 (patch) | |
tree | 0a8a1e4d3f30b127114add712f9dc9100bafc519 /sys | |
parent | f1d7a0c415a0f6f0a4abad7d29ece84de602f1a5 (diff) |
Gear up for OLF.
Diffstat (limited to 'sys')
-rw-r--r-- | sys/sys/exec_olf.h | 122 |
1 files changed, 122 insertions, 0 deletions
diff --git a/sys/sys/exec_olf.h b/sys/sys/exec_olf.h new file mode 100644 index 00000000000..c4a13950544 --- /dev/null +++ b/sys/sys/exec_olf.h @@ -0,0 +1,122 @@ +/* $OpenBSD: exec_olf.h,v 1.1 1996/10/27 19:44:17 etheisen Exp $ */ +/* + * Copyright (c) 1996 Erik Theisen + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + + /**** OLF - Open Linkage Format ****/ + + /* + * OLF is a modified ELF that attempts + * to fix two serious shortcomings in + * the SVR4 ABI. Namely a lack of an + * operating system and strip tag. + */ + +#ifndef _SYS_EXEC_OLF_H_ +#define _SYS_EXEC_OLF_H_ + +#include <sys/exec_elf.h> + +/* e_ident[] identification indexes */ +#define OI_MAG0 EI_MAG0 /* file ID */ +#define OI_MAG1 EI_MAG1 /* file ID */ +#define OI_MAG2 EI_MAG2 /* file ID */ +#define OI_MAG3 EI_MAG3 /* file ID */ +#define OI_CLASS EI_CLASS /* file class */ +#define OI_DATA EI_DATA /* data encoding */ +#define OI_VERSION EI_VERSION /* OLF header version */ +#define OI_OS 7 /* Operating system */ +#define OI_STRIP 8 /* Strip tag */ +#define OI_PAD 9 /* start of pad bytes */ +#define OI_NIDENT EI_NIDENT /* Size of e_ident[] */ + +/* e_ident[] magic number */ +#define OLFMAG0 ELFMAG0 /* e_ident[OI_MAG0] */ +#define OLFMAG1 'O' /* e_ident[OI_MAG1] */ +#define OLFMAG2 ELFMAG2 /* e_ident[OI_MAG2] */ +#define OLFMAG3 ELFMAG3 /* e_ident[OI_MAG3] */ +#define OLFMAG "\177OLF" /* magic */ +#define SOLFMAG SELFMAG /* size of magic */ + +/* e_ident[] file class */ +#define OLFCLASSNONE ELFCLASSNONE /* invalid */ +#define OLFCLASS32 ELFCLASS32 /* 32-bit objs */ +#define OLFCLASS64 ELFCLASS64 /* 64-bit objs */ +#define OLFCLASSNUM ELFCLASSNUM /* number of classes */ + +/* e_ident[] data encoding */ +#define OLFDATANONE ELFDATANONE /* invalid */ +#define OLFDATA2LSB ELFDATA2LSB /* Little-Endian */ +#define OLFDATA2MSB ELFDATA2MSB /* Big-Endian */ +#define OLFDATANUM ELFDATANUM /* number of data encode defines */ + + +/* + * Please help make this list definative. + */ +/* e_ident[] system */ +#define OOS_NULL 0 /* invalid */ +#define OOS_OPENBSD 1 /* OpenBSD */ +#define OOS_NETBSD 2 /* NetBSD */ +#define OOS_FREEBSD 3 /* FreeBSD */ +#define OOS_44BSD 4 /* 4.4BSD */ +#define OOS_LINUX 5 /* Linux */ +#define OOS_MACH 6 /* Mach */ +#define OOS_SVR4 7 /* AT&T System V Release 4 */ +#define OOS_ESIX 8 /* esix UNIX */ +#define OOS_SOLARIS 9 /* SunSoft Solaris */ +#define OOS_IRIX 10 /* SGI IRIX */ +#define OOS_SCO 11 /* SCO UNIX */ +#define OOS_DELL 13 /* DELL SVR4 */ +#define OOS_NUM 14 /* Number of systems */ + +/* + * Lowercase and numbers ONLY. + * No whitespace or punc. + */ +#define OOSN_NULL "invalid" /* invalid */ +#define OOSN_OPENBSD "openbsd" /* OpenBSD */ +#define OOSN_NETBSD "netbsd" /* NetBSD */ +#define OOSN_FREEBSD "freebsd" /* FreeBSD */ +#define OOSN_44BSD "44bsd" /* 4.4BSD */ +#define OOSN_LINUX "linux" /* Linux */ +#define OOSN_MACH "mach" /* Mach */ +#define OOSN_SVR4 "svr4" /* AT&T System V Release 4 */ +#define OOSN_ESIX "esix" /* esix UNIX */ +#define OOSN_SOLARIS "solaris" /* SunSoft Solaris */ +#define OOSN_IRIX "irix" /* SGI IRIX */ +#define OOSN_SCO "sco" /* SCO UNIX */ +#define OOSN_DELL "dell" /* DELL SVR4 */ + +/* e_ident */ +#define IS_OLF(ehdr) ((ehdr).e_ident[OI_MAG0] == OLFMAG0 && \ + (ehdr).e_ident[OI_MAG1] == OLFMAG1 && \ + (ehdr).e_ident[OI_MAG2] == OLFMAG2 && \ + (ehdr).e_ident[OI_MAG3] == OLFMAG3) + +/* The rest of the types and defines come from the ELF header file */ +#endif /* _SYS_EXEC_OLF_H_ */ |