version 1.26, 1999/10/23 08:45:49
|
version 1.27, 1999/10/25 13:47:10
|
Line 41
|
Line 41
|
|
|
#include <machine/types.h> |
#include <machine/types.h> |
|
|
typedef u_int8_t Elf_Byte; |
typedef u_int8_t Elf_Byte; |
|
|
typedef u_int32_t Elf32_Addr; |
typedef u_int32_t Elf32_Addr; |
typedef u_int32_t Elf32_Off; |
#define ELF32_FSZ_ADDR 4 |
typedef int32_t Elf32_Sword; |
typedef u_int32_t Elf32_Off; |
typedef u_int32_t Elf32_Word; |
#define ELF32_FSZ_OFF 4 |
typedef u_int16_t Elf32_Half; |
typedef int32_t Elf32_Sword; |
|
#define ELF32_FSZ_SWORD 4 |
typedef u_int64_t Elf64_Addr; |
typedef u_int32_t Elf32_Word; |
typedef u_int64_t Elf64_Off; |
#define ELF32_FSZ_WORD 4 |
typedef int64_t Elf64_Sword; |
typedef u_int16_t Elf32_Half; |
typedef int32_t Elf64_Shalf; |
#define ELF32_FSZ_HALF 2 |
typedef u_int64_t Elf64_Word; |
|
typedef u_int32_t Elf64_Half; |
typedef u_int64_t Elf64_Addr; |
typedef u_int16_t Elf64_Quarter; |
#define ELF64_FSZ_ADDR 8 |
|
typedef u_int64_t Elf64_Off; |
|
#define ELF64_FSZ_OFF 8 |
#define ELF_IDSIZE 16 |
typedef int64_t Elf64_Sword; |
|
#define ELF64_FSZ_SWORD 8 |
enum Elf_e_type { |
typedef int32_t Elf64_Shalf; |
Elf_et_none = 0, |
#define ELF64_FSZ_SHALF 4 |
Elf_et_rel, |
typedef u_int64_t Elf64_Word; |
Elf_et_exec, |
#define ELF64_FSZ_WORD 8 |
Elf_et_dyn, |
typedef u_int32_t Elf64_Half; |
Elf_et_core, |
#define ELF64_FSZ_HALF 4 |
Elf_et_num |
typedef u_int16_t Elf64_Quarter; |
}; |
#define ELF64_FSZ_QUARTER 2 |
|
|
enum Elf_e_machine { |
|
Elf_em_none = 0, |
#define ELF_NIDENT 16 |
Elf_em_m32, |
|
Elf_em_sparc, |
#define ET_NONE 0 |
Elf_em_386, |
#define ET_REL 1 |
Elf_em_68k, |
#define ET_EXEC 2 |
Elf_em_88k, |
#define ET_DYN 3 |
Elf_em_486, |
#define ET_CORE 4 |
Elf_em_860, |
#define ET_NUM 5 |
Elf_em_mips, |
|
Elf_em_mips_rs3_le = 10, |
#define EM_NONE 0 /* No machine */ |
Elf_em_rs6000, |
#define EM_M32 1 /* AT&T WE 32100 */ |
Elf_em_parisc = 15, |
#define EM_SPARC 2 /* SPARC */ |
Elf_em_ncube, |
#define EM_386 3 /* Intel 80386 */ |
Elf_em_vpp500, |
#define EM_68K 4 /* Motorola 68000 */ |
Elf_em_sparc32plus, |
#define EM_88K 5 /* Motorola 88000 */ |
Elf_em_ppc = 20, |
#define EM_486 6 /* Intel 80486 */ |
Elf_em_arm = 40, |
#define EM_860 7 /* Intel 80860 */ |
Elf_em_alpha = 41, |
#define EM_MIPS 8 /* MIPS I Architecture */ |
Elf_em_sh = 42, |
#define EM_S370 9 /* Amdahl UTS on System/370 */ |
Elf_em_sparc64 = 43, |
#define EM_MIPS_RS3_LE 10 /* MIPS RS3000 Little-endian */ |
Elf_em_vax = 75, |
#define EM_RS6000 11 /* IBM RS/6000 XXX reserved */ |
Elf_em_alpha_exp = 0x9026, |
#define EM_PARISC 15 /* Hewlett-Packard PA-RISC */ |
Elf_em_num |
#define EM_NCUBE 16 /* NCube XXX reserved */ |
}; |
#define EM_VPP500 17 /* Fujitsu VPP500 */ |
|
#define EM_SPARC32PLUS 18 /* Enhanced instruction set SPARC */ |
enum Elf_e_class { |
#define EM_960 19 /* Intel 80960 */ |
Elf_ec_invalid = 0, |
#define EM_PPC 20 /* PowerPC */ |
Elf_ec_32bit, |
#define EM_V800 36 /* NEC V800 */ |
Elf_ec_64bit |
#define EM_FR20 37 /* Fujitsu FR20 */ |
}; |
#define EM_RH32 38 /* TRW RH-32 */ |
|
#define EM_RCE 39 /* Motorola RCE */ |
enum Elf_e_ident { |
#define EM_ARM 40 /* Advanced RISC Machines ARM */ |
Elf_ei_mag0 = 0, |
#define EM_ALPHA 41 /* DIGITAL Alpha */ |
Elf_ei_mag1, |
#define EM_SH 42 /* Hitachi Super-H */ |
Elf_ei_mag2, |
#define EM_SPARCV9 43 /* SPARC Version 9 */ |
Elf_ei_mag3, |
#define EM_TRICORE 44 /* Siemens Tricore */ |
Elf_ei_class, |
#define EM_ARC 45 /* Argonaut RISC Core */ |
Elf_ei_data, |
#define EM_H8_300 46 /* Hitachi H8/300 */ |
Elf_ei_version, |
#define EM_H8_300H 47 /* Hitachi H8/300H */ |
Elf_ei_pad, |
#define EM_H8S 48 /* Hitachi H8S */ |
Elf_ei_size = 16 |
#define EM_H8_500 49 /* Hitachi H8/500 */ |
}; |
#define EM_IA_64 50 /* Intel Merced Processor */ |
|
#define EM_MIPS_X 51 /* Stanford MIPS-X */ |
enum Elf_e_version { |
#define EM_COLDFIRE 52 /* Motorola Coldfire */ |
Elf_ev_none, |
#define EM_68HC12 53 /* Motorola MC68HC12 */ |
Elf_ev_current |
#define EM_VAX 75 /* DIGITAL VAX */ |
}; |
#define EM_ALPHA_EXP 36902 /* used by NetBSD/alpha; obsolete */ |
|
#define EM_NUM 36903 |
|
|
|
#define ELFCLASSNONE 0 /* Invalid class */ |
|
#define ELFCLASS32 1 /* 32-bit objects */ |
|
#define ELFCLASS64 2 /* 64-bit objects */ |
|
#define ELFCLASSNUM 3 |
|
|
|
#define EI_MAG0 0 |
|
#define EI_MAG1 1 |
|
#define EI_MAG2 2 |
|
#define EI_MAG3 3 |
|
#define EI_CLASS 4 |
|
#define EI_DATA 5 |
|
#define EI_VERSION 6 |
|
#define EI_PAD 7 |
|
|
|
#define EV_NONE 0 /* Invalid version */ |
|
#define EV_CURRENT 1 /* Current version */ |
|
#define EV_NUM 2 |
|
|
|
#define ELFDATANONE 0 /* Invalid data encoding */ |
|
#define ELFDATA2LSB 1 /* 2's complement values, LSB first */ |
|
#define ELFDATA2MSB 2 /* 2's complement values, MSG first */ |
|
|
|
#define PF_R 0x4 |
|
#define PF_W 0x2 |
|
#define PF_X 0x1 |
|
|
enum Elf_e_datafmt { |
#define PF_MASKPROC 0xf0000000 /* Processor-specific values */ |
Elf_ed_none, |
|
Elf_ed_2lsb, |
|
Elf_ed_2msb |
|
}; |
|
|
|
enum Elf_p_pf { |
|
Elf_pf_r = 4, |
|
Elf_pf_w = 2, |
|
Elf_pf_x = 1 |
|
}; |
|
|
|
typedef struct { |
typedef struct { |
unsigned char e_ident[ELF_IDSIZE]; /* Id bytes */ |
unsigned char e_ident[ELF_NIDENT]; /* Id bytes */ |
Elf32_Half e_type; /* file type */ |
Elf32_Half e_type; /* file type */ |
Elf32_Half e_machine; /* machine type */ |
Elf32_Half e_machine; /* machine type */ |
Elf32_Word e_version; /* version number */ |
Elf32_Word e_version; /* version number */ |
Line 147 typedef struct {
|
Line 164 typedef struct {
|
Elf32_Half e_shstrndx; /* String table index */ |
Elf32_Half e_shstrndx; /* String table index */ |
} Elf32_Ehdr; |
} Elf32_Ehdr; |
|
|
#define Elf32_e_ident "\177ELF\001" |
|
#define Elf32_e_siz (sizeof(Elf32_e_ident) - 1) |
|
#define ELF32_HDR_SIZE (sizeof(Elf32_Ehdr)) |
|
|
|
typedef struct { |
typedef struct { |
unsigned char e_ident[ELF_IDSIZE]; /* Id bytes */ |
unsigned char e_ident[ELF_NIDENT]; /* Id bytes */ |
Elf64_Quarter e_type; /* file type */ |
Elf64_Quarter e_type; /* file type */ |
Elf64_Quarter e_machine; /* machine type */ |
Elf64_Quarter e_machine; /* machine type */ |
Elf64_Half e_version; /* version number */ |
Elf64_Half e_version; /* version number */ |
Line 168 typedef struct {
|
Line 181 typedef struct {
|
Elf64_Quarter e_shstrndx; /* String table index */ |
Elf64_Quarter e_shstrndx; /* String table index */ |
} Elf64_Ehdr; |
} Elf64_Ehdr; |
|
|
#define Elf64_e_ident "\177ELF\002" |
#define ELFMAG0 0x7f |
#define Elf64_e_siz (sizeof(Elf64_e_ident) - 1) |
#define ELFMAG1 'E' |
#define ELF64_HDR_SIZE (sizeof(Elf64_Ehdr)) |
#define ELFMAG2 'L' |
|
#define ELFMAG3 'F' |
enum Elf_p_pt { |
#define ELFMAG "\177ELF" |
Elf_pt_null = 0, /* Program header table entry unused */ |
#define SELFMAG 4 |
Elf_pt_load = 1, /* Loadable program segment */ |
|
Elf_pt_dynamic = 2, /* Dynamic linking information */ |
#define PT_NULL 0 /* Program header table entry unused */ |
Elf_pt_interp = 3, /* Program interpreter */ |
#define PT_LOAD 1 /* Loadable program segment */ |
Elf_pt_note = 4, /* Auxiliary information */ |
#define PT_DYNAMIC 2 /* Dynamic linking information */ |
Elf_pt_shlib = 5, /* Reserved, unspecified semantics */ |
#define PT_INTERP 3 /* Program interpreter */ |
Elf_pt_phdr = 6, /* Entry for header table itself */ |
#define PT_NOTE 4 /* Auxiliary information */ |
Elf_pt_loproc = 0x70000000, /* Processor-specific */ |
#define PT_SHLIB 5 /* Reserved, unspecified semantics */ |
Elf_pt_hiproc = 0x7FFFFFFF /* Processor-specific */ |
#define PT_PHDR 6 /* Entry for header table itself */ |
#define Elf_pt_mips_reginfo 0x70000000 |
#define PT_NUM 7 |
}; |
|
|
#define PT_LOPROC 0x70000000 /* Processor-specific range */ |
|
#define PT_HIPROC 0x7fffffff |
|
|
|
#define PT_MIPS_REGINFO 0x70000000 |
|
|
typedef struct { |
typedef struct { |
Elf32_Word p_type; /* entry type */ |
Elf32_Word p_type; /* entry type */ |
Line 210 typedef struct {
|
Line 227 typedef struct {
|
/* |
/* |
* Section Headers |
* Section Headers |
*/ |
*/ |
enum Elf_s_sht { |
#define SHT_NULL 0 |
Elf_sht_null = 0, |
#define SHT_PROGBITS 1 |
Elf_sht_progbits = 1, |
#define SHT_SYMTAB 2 |
Elf_sht_symtab = 2, |
#define SHT_STRTAB 3 |
Elf_sht_strtab = 3, |
#define SHT_RELA 4 |
Elf_sht_rela = 4, |
#define SHT_HASH 5 |
Elf_sht_hash = 5, |
#define SHT_DYNAMIC 6 |
Elf_sht_dynamic = 6, |
#define SHT_NOTE 7 |
Elf_sht_note = 7, |
#define SHT_NOBITS 8 |
Elf_sht_nobits = 8, |
#define SHT_REL 9 |
Elf_sht_rel = 9, |
#define SHT_SHLIB 10 |
Elf_sht_shlib = 10, |
#define SHT_DYNSYM 11 |
Elf_sht_dynsym = 11, |
#define SHT_NUM 12 |
Elf_sht_loproc = 0x70000000, |
|
Elf_sht_hiproc = 0x7FFFFFFF |
#define SHT_LOUSER 0x80000000 |
}; |
#define SHT_HIUSER 0xffffffff |
|
#define SHT_LOPROC 0x70000000 /* Processor-specific range */ |
|
#define SHT_HIPROC 0x7fffffff |
|
|
typedef struct { |
typedef struct { |
Elf32_Word sh_name; /* section name */ |
Elf32_Word sh_name; /* section name */ |
Line 256 typedef struct {
|
Line 275 typedef struct {
|
/* |
/* |
* Bits for sh_flags |
* Bits for sh_flags |
*/ |
*/ |
#define SHF_WRITE 0x1 /* section contains writable data */ |
#define SHF_WRITE 0x1 /* Section contains writable data */ |
#define SHF_ALLOC 0x2 /* section occupies memory */ |
#define SHF_ALLOC 0x2 /* Section occupies memory */ |
#define SHF_EXECINSTR 0x4 /* section contains executable insns */ |
#define SHF_EXECINSTR 0x4 /* Section contains executable insns */ |
#define SHF_MASKPROC 0xf0000000 /* processor-specific mask */ |
|
|
#define SHF_MASKPROC 0xf0000000 /* Processor-specific values */ |
|
|
/* |
/* |
* Symbol Definitions |
* Symbol Definitions |
Line 284 typedef struct {
|
Line 304 typedef struct {
|
|
|
#define ELF_SYM_UNDEFINED 0 |
#define ELF_SYM_UNDEFINED 0 |
|
|
enum elf_e_symbol_binding { |
#define STB_LOCAL 0 /* local symbol */ |
Elf_estb_local, |
#define STB_GLOBAL 1 /* global symbol */ |
Elf_estb_global, |
#define STB_WEAK 2 /* weakly defined global symbol */ |
Elf_estb_weak |
#define STB_NUM 3 |
}; |
|
|
#define STB_LOPROC 13 /* Processor-specific range */ |
#define ELF_SYM_BIND(info) ((enum elf_e_symbol_binding) (((u_int32_t)(info)) >> 4)) |
#define STB_HIPROC 15 |
|
|
enum elf_e_symbol_type { |
/* Symbol types */ |
Elf_estt_notype, |
#define STT_NOTYPE 0 /* Type not specified */ |
Elf_estt_object, |
#define STT_OBJECT 1 /* Associated with a data object */ |
Elf_estt_func, |
#define STT_FUNC 2 /* Associated with a function */ |
Elf_estt_section, |
#define STT_SECTION 3 /* Associated with a section */ |
Elf_estt_file |
#define STT_FILE 4 /* Associated with a file name */ |
}; |
#define STT_NUM 5 |
|
|
#define ELF_SYM_TYPE(info) ((enum elf_e_symbol_type) ((info) & 0x0F)) |
#define STT_LOPROC 13 /* Processor-specific range */ |
|
#define STT_HIPROC 15 |
|
|
|
#define ELF32_ST_BIND(info) ((info) >> 4) |
|
#define ELF32_ST_TYPE(info) ((info) & 0xf) |
|
#define ELF32_ST_INFO(bind,type) (((bind) << 4 + ((type) & 0xf)) |
|
|
enum elf_e_symbol_section_index { |
/* |
Elf_eshn_undefined =0, |
* Special section indexes |
Elf_eshn_mips_acommon =0xFF00, |
*/ |
Elf_eshn_mips_scommon =0xFF03, |
#define SHN_UNDEF 0 /* Undefined section */ |
Elf_eshn_absolute =0xFFF1, |
#define SHN_LORESERVE 0xff00 /* Reserved range */ |
Elf_eshn_common =0xFFF2 |
#define SHN_ABS 0xfff1 /* Absolute symbol */ |
}; |
#define SHN_COMMON 0xfff2 /* Common symbol */ |
|
#define SHN_HIRESERVE 0xffff |
|
|
|
#define SHN_LOPROC 0xff00 /* Rrocessor-specific range */ |
|
#define SHN_HIPROC 0xff1f |
|
|
|
#define SHN_MIPS_ACOMMON 0xff00 |
|
#define SHN_MIPS_TEXT 0xff01 |
|
#define SHN_MIPS_DATA 0xff02 |
|
#define SHN_MIPS_SCOMMON 0xff03 |
|
|
/* |
/* |
* Relocation Entries |
* Relocation Entries |
Line 330 typedef struct {
|
Line 364 typedef struct {
|
} Elf64_Rel; |
} Elf64_Rel; |
|
|
#define ELF32_R_SYM(info) ((info) >> 8) |
#define ELF32_R_SYM(info) ((info) >> 8) |
#define ELF32_R_TYPE(info) ((info) & 0xFF) |
#define ELF32_R_TYPE(info) ((info) & 0xff) |
|
#define ELF32_R_INFO(sym, type) (((sym) << 8) + (unsigned char)(type)) |
|
|
typedef struct { |
typedef struct { |
Elf64_Word r_offset; /* where to do it */ |
Elf64_Word r_offset; /* where to do it */ |
Line 339 typedef struct {
|
Line 374 typedef struct {
|
} Elf64_RelA; |
} Elf64_RelA; |
|
|
#define ELF64_R_SYM(info) ((info) >> 32) |
#define ELF64_R_SYM(info) ((info) >> 32) |
#define ELF64_R_TYPE(info) ((info) & 0xFFFFFFFF) |
#define ELF64_R_TYPE(info) ((info) & 0xffffffff) |
|
#define ELF64_R_INFO(sym,type) (((sym) << 32) + (type)) |
|
|
typedef struct { |
typedef struct { |
Elf32_Word d_tag; /* entry tag value */ |
Elf32_Sword d_tag; /* entry tag value */ |
union { |
union { |
Elf32_Addr d_ptr; |
Elf32_Addr d_ptr; |
Elf32_Word d_val; |
Elf32_Word d_val; |
Line 350 typedef struct {
|
Line 386 typedef struct {
|
} Elf32_Dyn; |
} Elf32_Dyn; |
|
|
typedef struct { |
typedef struct { |
Elf64_Word d_tag; /* entry tag value */ |
Elf64_Sword d_tag; /* entry tag value */ |
union { |
union { |
Elf64_Addr d_ptr; |
Elf64_Addr d_ptr; |
Elf64_Word d_val; |
Elf64_Word d_val; |
} d_un; |
} d_un; |
} Elf64_Dyn; |
} Elf64_Dyn; |
|
|
enum Elf_e_dynamic_type { |
#define DT_NULL 0 /* Marks end of dynamic array */ |
Elf_edt_null, |
#define DT_NEEDED 1 /* Name of needed library (DT_STRTAB offset) */ |
Elf_edt_needed, |
#define DT_PLTRELSZ 2 /* Size, in bytes, of relocations in PLT */ |
Elf_edt_pltrelsz, |
#define DT_PLTGOT 3 /* Address of PLT and/or GOT */ |
Elf_edt_pltgot, |
#define DT_HASH 4 /* Address of symbol hash table */ |
Elf_edt_hash, |
#define DT_STRTAB 5 /* Address of string table */ |
Elf_edt_strtab, |
#define DT_SYMTAB 6 /* Address of symbol table */ |
Elf_edt_symtab, |
#define DT_RELA 7 /* Address of Rela relocation table */ |
Elf_edt_rela, |
#define DT_RELASZ 8 /* Size, in bytes, of DT_RELA table */ |
Elf_edt_relasz, |
#define DT_RELAENT 9 /* Size, in bytes, of one DT_RELA entry */ |
Elf_edt_relaent, |
#define DT_STRSZ 10 /* Size, in bytes, of DT_STRTAB table */ |
Elf_edt_strsz, |
#define DT_SYMENT 11 /* Size, in bytes, of one DT_SYMTAB entry */ |
Elf_edt_syment, |
#define DT_INIT 12 /* Address of initialization function */ |
Elf_edt_init, |
#define DT_FINI 13 /* Address of termination function */ |
Elf_edt_fini, |
#define DT_SONAME 14 /* Shared object name (DT_STRTAB offset) */ |
Elf_edt_soname, |
#define DT_RPATH 15 /* Library search path (DT_STRTAB offset) */ |
Elf_edt_rpath, |
#define DT_SYMBOLIC 16 /* Start symbol search within local object */ |
Elf_edt_symbolic, |
#define DT_REL 17 /* Address of Rel relocation table */ |
Elf_edt_rel, |
#define DT_RELSZ 18 /* Size, in bytes, of DT_REL table */ |
Elf_edt_relsz, |
#define DT_RELENT 19 /* Size, in bytes, of one DT_REL entry */ |
Elf_edt_relent, |
#define DT_PLTREL 20 /* Type of PLT relocation entries */ |
Elf_edt_pltrel, |
#define DT_DEBUG 21 /* Used for debugging; unspecified */ |
Elf_edt_debug, |
#define DT_TEXTREL 22 /* Relocations might modify non-writable seg */ |
Elf_edt_textrel, |
#define DT_JMPREL 23 /* Address of relocations associated with PLT */ |
Elf_edt_jmprel |
#define DT_NUM 24 |
}; |
|
|
|
|
#define DT_LOPROC 0x70000000 /* Processor-specific range */ |
|
#define DT_HIPROC 0x7fffffff |
|
|
|
/* |
|
* Auxiliary Vectors |
|
*/ |
typedef struct { |
typedef struct { |
Elf32_Sword au_id; /* 32-bit id */ |
Elf32_Sword a_type; /* 32-bit id */ |
Elf32_Word au_v; /* 32-bit value */ |
Elf32_Word a_v; /* 32-bit id */ |
} Aux32Info; |
} Aux32Info; |
|
|
typedef struct { |
typedef struct { |
Elf64_Shalf au_id; /* 32-bit id */ |
Elf64_Shalf a_type; /* 32-bit id */ |
Elf64_Word au_v; /* 64-bit id */ |
Elf64_Word a_v; /* 64-bit id */ |
} Aux64Info; |
} Aux64Info; |
|
|
enum AuxID { |
#define AT_NULL 0 /* Marks end of array */ |
AUX_null = 0, |
#define AT_IGNORE 1 /* No meaning, a_un is undefined */ |
AUX_ignore = 1, |
#define AT_EXECFD 2 /* Open file descriptor of object file */ |
AUX_execfd = 2, |
#define AT_PHDR 3 /* &phdr[0] */ |
AUX_phdr = 3, /* &phdr[0] */ |
#define AT_PHENT 4 /* sizeof(phdr[0]) */ |
AUX_phent = 4, /* sizeof(phdr[0]) */ |
#define AT_PHNUM 5 /* # phdr entries */ |
AUX_phnum = 5, /* # phdr entries */ |
#define AT_PAGESZ 6 /* PAGESIZE */ |
AUX_pagesz = 6, /* PAGESIZE */ |
#define AT_BASE 7 /* Interpreter base addr */ |
AUX_base = 7, /* ld.so base addr */ |
#define AT_FLAGS 8 /* Processor flags */ |
AUX_flags = 8, /* processor flags */ |
#define AT_ENTRY 9 /* Entry address of executable */ |
AUX_entry = 9, /* a.out entry */ |
#define AT_DCACHEBSIZE 10 /* Data cache block size */ |
#ifdef obsolete |
#define AT_ICACHEBSIZE 11 /* Instruction cache block size */ |
AUX_debug = 10, /* debug flag */ |
#define AT_UCACHEBSIZE 12 /* Unified cache block size */ |
AUX_count = 11, /* not really the limit */ |
|
#else |
|
AUX_dcachebsize = 10, /* min data cache block size */ |
|
AUX_icachebsize = 11, /* min instruction cache block size */ |
|
#endif |
|
AUX_ucachebsize = 12, /* min unified cache block size */ |
|
|
|
/* Vendor specific */ |
/* Vendor specific */ |
AUX_sun_uid = 2000, /* euid */ |
#define AT_MIPS_NOTELF 10 /* XXX a_val != 0 -> MIPS XCOFF executable */ |
AUX_sun_ruid = 2001, /* ruid */ |
|
AUX_sun_gid = 2002, /* egid */ |
#define AT_SUN_UID 2000 /* euid */ |
AUX_sun_rgid = 2003, /* rgid */ |
#define AT_SUN_RUID 2001 /* ruid */ |
|
#define AT_SUN_GID 2002 /* egid */ |
|
#define AT_SUN_RGID 2003 /* rgid */ |
|
|
/* Solaris kernel specific */ |
/* Solaris kernel specific */ |
AUX_sun_ldelf = 2004, /* dynamic linker's ELF header */ |
#define AT_SUN_LDELF 2004 /* dynamic linker's ELF header */ |
AUX_sun_ldshdr = 2005, /* dynamic linker's section header */ |
#define AT_SUN_LDSHDR 2005 /* dynamic linker's section header */ |
AUX_sun_ldname = 2006, /* dynamic linker's name */ |
#define AT_SUN_LDNAME 2006 /* dynamic linker's name */ |
AUX_sun_lpgsize = 2007, /* lage pagesize */ |
#define AT_SUN_LPGSIZE 2007 /* large pagesize */ |
|
|
/* Other information */ |
/* Other information */ |
AUX_sun_platform = 2008,/* sysinfo(SI_PLATFORM) */ |
#define AT_SUN_PLATFORM 2008 /* sysinfo(SI_PLATFORM) */ |
AUX_sun_hwcap = 2009, /* process hardware capabilities */ |
#define AT_SUN_HWCAP 2009 /* process hardware capabilities */ |
AUX_sun_iflush = 2010, /* do we need to flush the instruction cache? */ |
#define AT_SUN_IFLUSH 2010 /* do we need to flush the instruction cache? */ |
AUX_sun_cpu = 2011, /* cpu name */ |
#define AT_SUN_CPU 2011 /* cpu name */ |
/* ibcs2 emulation band aid */ |
/* ibcs2 emulation band aid */ |
AUX_sun_coff_entry = 2012, |
#define AT_SUN_EMUL_ENTRY 2012 /* coff entry point */ |
AUX_sun_coff_execfd = 2013, |
#define AT_SUN_EMUL_EXECFD 2013 /* coff file descriptor */ |
/* Executable's fully resolved name */ |
/* Executable's fully resolved name */ |
AUX_sun_execname = 2014 |
#define AT_SUN_EXECNAME 2014 |
}; |
|
|
|
/* |
/* |
* Note Definitions |
* Note Definitions |
*/ |
*/ |
typedef struct { |
typedef struct { |
Elf32_Word namesz; |
Elf32_Word n_namesz; |
Elf32_Word descsz; |
Elf32_Word n_descsz; |
Elf32_Word type; |
Elf32_Word n_type; |
} Elf32_Note; |
} Elf32_Nhdr; |
|
|
typedef struct { |
typedef struct { |
Elf64_Half namesz; |
Elf64_Half n_namesz; |
Elf64_Half descsz; |
Elf64_Half n_descsz; |
Elf64_Half type; |
Elf64_Half n_type; |
} Elf64_Note; |
} Elf64_Nhdr; |
|
|
#define ELF_NOTE_TYPE_OSVERSION 1 |
#define ELF_NOTE_TYPE_OSVERSION 1 |
|
|
/* NetBSD-specific note type: OS Version. desc is 4-byte NetBSD integer. */ |
/* NetBSD-specific note type: OS Version. desc is 4-byte NetBSD integer. */ |
#define ELF_NOTE_NETBSD_TYPE_OSVERSION ELF_NOTE_TYPE_OSVERSION |
#define ELF_NOTE_NETBSD_TYPE_OSVERSION ELF_NOTE_TYPE_OSVERSION |
Line 460 typedef struct {
|
Line 498 typedef struct {
|
#define ELF_NOTE_NETBSD_TYPE_EMULNAME 2 |
#define ELF_NOTE_NETBSD_TYPE_EMULNAME 2 |
|
|
/* NetBSD-specific note name and description sizes */ |
/* NetBSD-specific note name and description sizes */ |
#define ELF_NOTE_NETBSD_NAMESZ 7 |
#define ELF_NOTE_NETBSD_NAMESZ 7 |
#define ELF_NOTE_NETBSD_DESCSZ 4 |
#define ELF_NOTE_NETBSD_DESCSZ 4 |
/* NetBSD-specific note name */ |
/* NetBSD-specific note name */ |
#define ELF_NOTE_NETBSD_NAME "NetBSD\0\0" |
#define ELF_NOTE_NETBSD_NAME "NetBSD\0\0" |
|
|
/* GNU-specific note name and description sizes */ |
/* GNU-specific note name and description sizes */ |
#define ELF_NOTE_GNU_NAMESZ 4 |
#define ELF_NOTE_GNU_NAMESZ 4 |
#define ELF_NOTE_GNU_DESCSZ 4 |
#define ELF_NOTE_GNU_DESCSZ 4 |
/* GNU-specific note name */ |
/* GNU-specific note name */ |
#define ELF_NOTE_GNU_NAME "GNU\0" |
#define ELF_NOTE_GNU_NAME "GNU\0" |
|
|
/* GNU-specific OS/version value stuff */ |
/* GNU-specific OS/version value stuff */ |
#define ELF_NOTE_GNU_OSMASK (u_int32_t)0xff000000 |
#define ELF_NOTE_GNU_OSMASK (u_int32_t)0xff000000 |
#define ELF_NOTE_GNU_OSLINUX (u_int32_t)0x01000000 |
#define ELF_NOTE_GNU_OSLINUX (u_int32_t)0x01000000 |
#define ELF_NOTE_GNU_OSMACH (u_int32_t)0x00000000 |
#define ELF_NOTE_GNU_OSMACH (u_int32_t)0x00000000 |
|
|
#if defined(ELFSIZE) |
#if defined(ELFSIZE) |
#define CONCAT(x,y) __CONCAT(x,y) |
#define CONCAT(x,y) __CONCAT(x,y) |
#define ELFNAME(x) CONCAT(elf,CONCAT(ELFSIZE,CONCAT(_,x))) |
#define ELFNAME(x) CONCAT(elf,CONCAT(ELFSIZE,CONCAT(_,x))) |
#define ELFNAME2(x,y) CONCAT(x,CONCAT(_elf,CONCAT(ELFSIZE,CONCAT(_,y)))) |
#define ELFNAME2(x,y) CONCAT(x,CONCAT(_elf,CONCAT(ELFSIZE,CONCAT(_,y)))) |
#define ELFNAMEEND(x) CONCAT(x,CONCAT(_elf,ELFSIZE)) |
#define ELFNAMEEND(x) CONCAT(x,CONCAT(_elf,ELFSIZE)) |
#define ELFDEFNNAME(x) CONCAT(ELF,CONCAT(ELFSIZE,CONCAT(_,x))) |
#define ELFDEFNNAME(x) CONCAT(ELF,CONCAT(ELFSIZE,CONCAT(_,x))) |
#endif |
#endif |
|
|
#include <machine/elf_machdep.h> |
#include <machine/elf_machdep.h> |
Line 495 typedef struct {
|
Line 533 typedef struct {
|
#define Elf_RelA Elf32_RelA |
#define Elf_RelA Elf32_RelA |
#define Elf_Dyn Elf32_Dyn |
#define Elf_Dyn Elf32_Dyn |
#define Elf_Word Elf32_Word |
#define Elf_Word Elf32_Word |
|
#define Elf_Sword Elf32_Sword |
#define Elf_Addr Elf32_Addr |
#define Elf_Addr Elf32_Addr |
#define Elf_Off Elf32_Off |
#define Elf_Off Elf32_Off |
#define Elf_Note Elf32_Note |
#define Elf_Nhdr Elf32_Nhdr |
|
|
#define ELF_R_SYM ELF32_R_SYM |
#define ELF_R_SYM ELF32_R_SYM |
#define ELF_R_TYPE ELF32_R_TYPE |
#define ELF_R_TYPE ELF32_R_TYPE |
#define Elf_e_ident Elf32_e_ident |
#define ELFCLASS ELFCLASS32 |
#define Elf_e_siz Elf32_e_siz |
|
|
|
#define AuxInfo Aux32Info |
#define AuxInfo Aux32Info |
#elif defined(ELFSIZE) && (ELFSIZE == 64) |
#elif defined(ELFSIZE) && (ELFSIZE == 64) |
Line 514 typedef struct {
|
Line 552 typedef struct {
|
#define Elf_RelA Elf64_RelA |
#define Elf_RelA Elf64_RelA |
#define Elf_Dyn Elf64_Dyn |
#define Elf_Dyn Elf64_Dyn |
#define Elf_Word Elf64_Word |
#define Elf_Word Elf64_Word |
|
#define Elf_Sword Elf64_Sword |
#define Elf_Addr Elf64_Addr |
#define Elf_Addr Elf64_Addr |
#define Elf_Off Elf64_Off |
#define Elf_Off Elf64_Off |
#define Elf_Note Elf64_Note |
#define Elf_Nhdr Elf64_Nhdr |
|
|
#define ELF_R_SYM ELF64_R_SYM |
#define ELF_R_SYM ELF64_R_SYM |
#define ELF_R_TYPE ELF64_R_TYPE |
#define ELF_R_TYPE ELF64_R_TYPE |
#define Elf_e_ident Elf64_e_ident |
#define ELFCLASS ELFCLASS64 |
#define Elf_e_siz Elf64_e_siz |
|
|
|
#define AuxInfo Aux64Info |
#define AuxInfo Aux64Info |
#endif |
#endif |