diff options
author | Artur Grabowski <art@cvs.openbsd.org> | 2001-01-16 15:44:37 +0000 |
---|---|---|
committer | Artur Grabowski <art@cvs.openbsd.org> | 2001-01-16 15:44:37 +0000 |
commit | 5e14a6f7d6d4acd8b6b68e95da53fcfbeb1dae96 (patch) | |
tree | c8e00c3c61f36ee15ee0c00c56988aeaa6e13520 /sys | |
parent | 53a865f9b304de1ca3eba7bd2d6f2e839e110800 (diff) |
Allow use of ELFSIZE to get Elf_* types and macros instead of explicit Elf{32,64}_.
From NetBSD
This will probably let us unify a lot of code (exec_elf.c vs. exec_elf64.c).
Diffstat (limited to 'sys')
-rw-r--r-- | sys/sys/exec_elf.h | 60 |
1 files changed, 59 insertions, 1 deletions
diff --git a/sys/sys/exec_elf.h b/sys/sys/exec_elf.h index f7603ee9fcf..2ecf387d53c 100644 --- a/sys/sys/exec_elf.h +++ b/sys/sys/exec_elf.h @@ -1,4 +1,4 @@ -/* $OpenBSD: exec_elf.h,v 1.21 2000/08/11 00:35:18 deraadt Exp $ */ +/* $OpenBSD: exec_elf.h,v 1.22 2001/01/16 15:44:36 art Exp $ */ /* * Copyright (c) 1995, 1996 Erik Theisen. All rights reserved. * @@ -493,6 +493,64 @@ struct elf_args { #endif +#if defined(ELFSIZE) +#define CONCAT(x,y) __CONCAT(x,y) +#define ELFNAME(x) CONCAT(elf,CONCAT(ELFSIZE,CONCAT(_,x))) +#define ELFNAME2(x,y) CONCAT(x,CONCAT(_elf,CONCAT(ELFSIZE,CONCAT(_,y)))) +#define ELFNAMEEND(x) CONCAT(x,CONCAT(_elf,ELFSIZE)) +#define ELFDEFNNAME(x) CONCAT(ELF,CONCAT(ELFSIZE,CONCAT(_,x))) +#endif + +#include <machine/elf_machdep.h> + +#if defined(ELFSIZE) && (ELFSIZE == 32) +#define Elf_Ehdr Elf32_Ehdr +#define Elf_Phdr Elf32_Phdr +#define Elf_Shdr Elf32_Shdr +#define Elf_Sym Elf32_Sym +#define Elf_Rel Elf32_Rel +#define Elf_RelA Elf32_RelA +#define Elf_Dyn Elf32_Dyn +#define Elf_Word Elf32_Word +#define Elf_Sword Elf32_Sword +#define Elf_Addr Elf32_Addr +#define Elf_Off Elf32_Off +#define Elf_Nhdr Elf32_Nhdr + +#define ELF_R_SYM ELF32_R_SYM +#define ELF_R_TYPE ELF32_R_TYPE +#define ELFCLASS ELFCLASS32 + +#define ELF_ST_BIND ELF32_ST_BIND +#define ELF_ST_TYPE ELF32_ST_TYPE +#define ELF_ST_INFO ELF32_ST_INFO + +#define AuxInfo Aux32Info +#elif defined(ELFSIZE) && (ELFSIZE == 64) +#define Elf_Ehdr Elf64_Ehdr +#define Elf_Phdr Elf64_Phdr +#define Elf_Shdr Elf64_Shdr +#define Elf_Sym Elf64_Sym +#define Elf_Rel Elf64_Rel +#define Elf_RelA Elf64_RelA +#define Elf_Dyn Elf64_Dyn +#define Elf_Word Elf64_Word +#define Elf_Sword Elf64_Sword +#define Elf_Addr Elf64_Addr +#define Elf_Off Elf64_Off +#define Elf_Nhdr Elf64_Nhdr + +#define ELF_R_SYM ELF64_R_SYM +#define ELF_R_TYPE ELF64_R_TYPE +#define ELFCLASS ELFCLASS64 + +#define ELF_ST_BIND ELF64_ST_BIND +#define ELF_ST_TYPE ELF64_ST_TYPE +#define ELF_ST_INFO ELF64_ST_INFO + +#define AuxInfo Aux64Info +#endif + #ifdef _KERNEL #ifdef _KERN_DO_ELF64 int exec_elf64_makecmds __P((struct proc *, struct exec_package *)); |