aboutsummaryrefslogtreecommitdiff
path: root/sys/sys/elf_generic.h
diff options
context:
space:
mode:
authorJohn Polstra <jdp@FreeBSD.org>1998-09-14 20:30:13 +0000
committerJohn Polstra <jdp@FreeBSD.org>1998-09-14 20:30:13 +0000
commitc8afdc1dcf62637d2965cb3d99cc1a81ff2cc553 (patch)
treead90f637e567e0149074c9804c83f8d59f6d4cd5 /sys/sys/elf_generic.h
parent24b66c5360312f5f7e41112dcbeb00a972d9820c (diff)
downloadsrc-c8afdc1dcf62637d2965cb3d99cc1a81ff2cc553.tar.gz
src-c8afdc1dcf62637d2965cb3d99cc1a81ff2cc553.zip
Add generic defines ELF_ARCH, ELF_CLASS, and ELF_DATA. These give
the relevant characteristics of the native machine, for building and checking Elf_Ehdr structures. Add structures to represent ELF "note" headers. Add defines for the note types used in ELF core files.
Notes
Notes: svn path=/head/; revision=39189
Diffstat (limited to 'sys/sys/elf_generic.h')
-rw-r--r--sys/sys/elf_generic.h13
1 files changed, 12 insertions, 1 deletions
diff --git a/sys/sys/elf_generic.h b/sys/sys/elf_generic.h
index ca5092454bd1..7ab479e23b2a 100644
--- a/sys/sys/elf_generic.h
+++ b/sys/sys/elf_generic.h
@@ -23,7 +23,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id$
+ * $Id: elf_generic.h,v 1.1 1998/08/16 03:03:38 jdp Exp $
*/
#ifndef _SYS_ELF_GENERIC_H_
@@ -40,6 +40,16 @@
#error "__ELF_WORD_SIZE must be defined as 32 or 64"
#endif
+#define ELF_CLASS __CONCAT(ELFCLASS,__ELF_WORD_SIZE)
+
+#if BYTE_ORDER == LITTLE_ENDIAN
+#define ELF_DATA ELFDATA2LSB
+#elif BYTE_ORDER == BIG_ENDIAN
+#define ELF_DATA ELFDATA2MSB
+#else
+#error "Unknown byte order"
+#endif
+
#define __ElfN(x) __CONCAT(__CONCAT(__CONCAT(Elf,__ELF_WORD_SIZE),_),x)
#define __ELFN(x) __CONCAT(__CONCAT(__CONCAT(ELF,__ELF_WORD_SIZE),_),x)
#define __ElfType(x) typedef __ElfN(x) __CONCAT(Elf_,x)
@@ -54,6 +64,7 @@ __ElfType(Ehdr);
__ElfType(Shdr);
__ElfType(Phdr);
__ElfType(Dyn);
+__ElfType(Note);
__ElfType(Rel);
__ElfType(Rela);
__ElfType(Sym);