1 /* 2 * CDDL HEADER START 3 * 4 * The contents of this file are subject to the terms of the 5 * Common Development and Distribution License (the "License"). 6 * You may not use this file except in compliance with the License. 7 * 8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 9 * or http://www.opensolaris.org/os/licensing. 10 * See the License for the specific language governing permissions 11 * and limitations under the License. 12 * 13 * When distributing Covered Code, include this CDDL HEADER in each 14 * file and include the License file at usr/src/OPENSOLARIS.LICENSE. 15 * If applicable, add the following below this CDDL HEADER, with the 16 * fields enclosed by brackets "[]" replaced with your own identifying 17 * information: Portions Copyright [yyyy] [name of copyright owner] 18 * 19 * CDDL HEADER END 20 * 21 * $FreeBSD$ 22 * 23 * ELF compatibility definitions for OpenSolaris source. 24 * 25 */ 26 27 #ifndef _SYS__ELF_SOLARIS_H_ 28 #define _SYS__ELF_SOLARIS_H_ 29 30 #include_next <sys/elf.h> 31 32 #define __sElfN(x) typedef __CONCAT(__CONCAT(__CONCAT(Elf,__ELF_WORD_SIZE),_),x) x 33 34 __sElfN(Addr); 35 __sElfN(Cap); 36 __sElfN(Dyn); 37 __sElfN(Ehdr); 38 __sElfN(Move); 39 __sElfN(Off); 40 __sElfN(Phdr); 41 __sElfN(Rel); 42 __sElfN(Rela); 43 __sElfN(Shdr); 44 __sElfN(Sym); 45 __sElfN(Syminfo); 46 __sElfN(Verdaux); 47 __sElfN(Verdef); 48 __sElfN(Vernaux); 49 __sElfN(Verneed); 50 __sElfN(Versym); 51 52 __sElfN(Half); 53 __sElfN(Sword); 54 __sElfN(Word); 55 56 #if __ELF_WORD_SIZE == 32 57 typedef Elf32_Word Xword; /* Xword/Sxword are 32-bits in Elf32 */ 58 typedef Elf32_Sword Sxword; 59 #else 60 typedef Elf64_Xword Xword; 61 typedef Elf64_Sxword Sxword; 62 #endif 63 64 #define ELF_M_INFO __ELFN(M_INFO) 65 #define ELF_M_SIZE __ELFN(M_SIZE) 66 #define ELF_M_SYM __ELFN(M_SYM) 67 68 /* 69 * Elf `printf' type-cast macros. These force arguments to be a fixed size 70 * so that Elf32 and Elf64 can share common format strings. 71 */ 72 #define EC_ADDR(a) ((Elf64_Addr)(a)) /* "ull" */ 73 #define EC_OFF(a) ((Elf64_Off)(a)) /* "ull" */ 74 #define EC_HALF(a) ((Elf64_Half)(a)) /* "d" */ 75 #define EC_WORD(a) ((Elf64_Word)(a)) /* "u" */ 76 #define EC_SWORD(a) ((Elf64_Sword)(a)) /* "d" */ 77 #define EC_XWORD(a) ((Elf64_Xword)(a)) /* "ull" */ 78 #define EC_SXWORD(a) ((Elf64_Sxword)(a)) /* "ll" */ 79 #define EC_LWORD(a) ((Elf64_Lword)(a)) /* "ull" */ 80 81 #define elf_checksum __elfN(checksum) 82 #define elf_fsize __elfN(fsize) 83 #define elf_getehdr __elfN(getehdr) 84 #define elf_getphdr __elfN(getphdr) 85 #define elf_newehdr __elfN(newehdr) 86 #define elf_newphdr __elfN(newphdr) 87 #define elf_getshdr __elfN(getshdr) 88 #define elf_xlatetof __elfN(xlatetof) 89 #define elf_xlatetom __elfN(xlatetom) 90 91 #define Elf_cap_entry __ElfN(cap_entry) 92 #define Elf_cap_title __ElfN(cap_title) 93 #define Elf_demangle_name __ElfN(demangle_name) 94 #define Elf_dyn_entry __ElfN(dyn_entry) 95 #define Elf_dyn_title __ElfN(dyn_title) 96 #define Elf_ehdr __ElfN(ehdr) 97 #define Elf_got_entry __ElfN(got_entry) 98 #define Elf_got_title __ElfN(got_title) 99 #define Elf_reloc_apply_reg __ElfN(reloc_apply_reg) 100 #define Elf_reloc_apply_val __ElfN(reloc_apply_val) 101 #define Elf_reloc_entry_1 __ElfN(reloc_entry_1) 102 #define Elf_reloc_entry_2 __ElfN(reloc_entry_2) 103 #define Elf_reloc_title __ElfN(reloc_title) 104 #define Elf_phdr __ElfN(phdr) 105 #define Elf_shdr __ElfN(shdr) 106 #define Elf_syms_table_entry __ElfN(syms_table_entry) 107 #define Elf_syms_table_title __ElfN(syms_table_title) 108 #define Elf_ver_def_title __ElfN(ver_def_title) 109 #define Elf_ver_line_1 __ElfN(ver_line_1) 110 #define Elf_ver_line_2 __ElfN(ver_line_2) 111 #define Elf_ver_line_3 __ElfN(ver_line_3) 112 #define Elf_ver_line_4 __ElfN(ver_line_4) 113 #define Elf_ver_line_5 __ElfN(ver_line_5) 114 #define Elf_ver_need_title __ElfN(ver_need_title) 115 116 #endif /* !_SYS__ELF_SOLARIS_H_ */ 117