summaryrefslogtreecommitdiffstats
path: root/sys/amd64/include/elf.h
diff options
context:
space:
mode:
authorjdp <jdp@FreeBSD.org>1998-08-16 03:03:38 +0000
committerjdp <jdp@FreeBSD.org>1998-08-16 03:03:38 +0000
commitd1ce81d497992a3de7490d0995410edf07e7ae04 (patch)
treea138dd5d56ee74a338a26b84622f820a72945c7d /sys/amd64/include/elf.h
parentb48943eaac13f7c26e86cdaced8344dd8a25d587 (diff)
downloadFreeBSD-src-d1ce81d497992a3de7490d0995410edf07e7ae04.zip
FreeBSD-src-d1ce81d497992a3de7490d0995410edf07e7ae04.tar.gz
Revamp the ELF include files to better support architecture-independent
applications. Here's how it works. The kernel should include <machine/elf.h> to get the definitions for the native architecture. It can reference the various ELF structures with generic names like Elf_Sym, Elf_Shdr, etc. A define __ELF_WORD_SIZE is also available with the value 32 or 64 as appropriate for the native architecture. Generic applications should include <elf.h>, which is just a wrapper for <machine/elf.h>. Applications such as object file dumpers that need to deal with foreign ELF files can include <sys/elf32.h> and/or <sys/elf64.h>. Both can be included from the same source file if desired. The structure names must be referenced using wordsize-specific names like Elf32_Sym, Elf64_Shdr, etc. I haven't change the alpha stuff, but I haven't broken it either.
Diffstat (limited to 'sys/amd64/include/elf.h')
-rw-r--r--sys/amd64/include/elf.h7
1 files changed, 6 insertions, 1 deletions
diff --git a/sys/amd64/include/elf.h b/sys/amd64/include/elf.h
index 34478e7..2c13a1f 100644
--- a/sys/amd64/include/elf.h
+++ b/sys/amd64/include/elf.h
@@ -23,7 +23,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: elf.h,v 1.1 1997/05/21 23:07:28 jdp Exp $
+ * $Id: elf.h,v 1.2 1997/08/30 18:59:48 peter Exp $
*/
#ifndef _MACHINE_ELF_H_
@@ -35,6 +35,9 @@
#include <sys/elf32.h> /* Definitions common to all 32 bit architectures. */
+#define __ELF_WORD_SIZE 32 /* Used by <sys/elf_generic.h> */
+#include <sys/elf_generic.h>
+
/*
* Auxiliary vector entries for passing information to the interpreter.
*
@@ -51,6 +54,8 @@ typedef struct { /* Auxiliary vector entry on initial stack */
} a_un;
} Elf32_Auxinfo;
+__ElfType(Auxinfo);
+
/* Values for a_type. */
#define AT_NULL 0 /* Terminates the vector. */
#define AT_IGNORE 1 /* Ignored entry. */
OpenPOWER on IntegriCloud