📄 elf_file.h
字号:
#define DT_GNU_CONFLICTSZ 0x6ffffdf6 /* Size of conflict section */#define DT_GNU_LIBLISTSZ 0x6ffffdf7 /* Size of library list */#define DT_CHECKSUM 0x6ffffdf8#define DT_PLTPADSZ 0x6ffffdf9#define DT_MOVEENT 0x6ffffdfa#define DT_MOVESZ 0x6ffffdfb#define DT_FEATURE_1 0x6ffffdfc /* Feature selection (DTF_*). */#define DT_POSFLAG_1 0x6ffffdfd /* Flags for DT_* entries, effecting the following DT_* entry. */#define DT_SYMINSZ 0x6ffffdfe /* Size of syminfo table (in bytes) */#define DT_SYMINENT 0x6ffffdff /* Entry size of syminfo */#define DT_VALRNGHI 0x6ffffdff#define DT_VALTAGIDX(tag) (DT_VALRNGHI - (tag)) /* Reverse order! */#define DT_VALNUM 12/* DT_* entries which fall between DT_ADDRRNGHI & DT_ADDRRNGLO use the Dyn.d_un.d_ptr field of the Elf*_Dyn structure. If any adjustment is made to the ELF object after it has been built these entries will need to be adjusted. */#define DT_ADDRRNGLO 0x6ffffe00#define DT_GNU_CONFLICT 0x6ffffef8 /* Start of conflict section */#define DT_GNU_LIBLIST 0x6ffffef9 /* Library list */#define DT_CONFIG 0x6ffffefa /* Configuration information. */#define DT_DEPAUDIT 0x6ffffefb /* Dependency auditing. */#define DT_AUDIT 0x6ffffefc /* Object auditing. */#define DT_PLTPAD 0x6ffffefd /* PLT padding. */#define DT_MOVETAB 0x6ffffefe /* Move table. */#define DT_SYMINFO 0x6ffffeff /* Syminfo table. */#define DT_ADDRRNGHI 0x6ffffeff#define DT_ADDRTAGIDX(tag) (DT_ADDRRNGHI - (tag)) /* Reverse order! */#define DT_ADDRNUM 10/* The versioning entry types. The next are defined as part of the GNU extension. */#define DT_VERSYM 0x6ffffff0#define DT_RELACOUNT 0x6ffffff9#define DT_RELCOUNT 0x6ffffffa/* These were chosen by Sun. */#define DT_FLAGS_1 0x6ffffffb /* State flags, see DF_1_* below. */#define DT_VERDEF 0x6ffffffc /* Address of version definition table */#define DT_VERDEFNUM 0x6ffffffd /* Number of version definitions */#define DT_VERNEED 0x6ffffffe /* Address of table with needed versions */#define DT_VERNEEDNUM 0x6fffffff /* Number of needed versions */#define DT_VERSIONTAGIDX(tag) (DT_VERNEEDNUM - (tag)) /* Reverse order! */#define DT_VERSIONTAGNUM 16/* Sun added these machine-independent extensions in the "processor-specific" range. Be compatible. */#define DT_AUXILIARY 0x7ffffffd /* Shared object to load before self */#define DT_FILTER 0x7fffffff /* Shared object to get values from */#define DT_EXTRATAGIDX(tag) ((Elf32_Word)-((Elf32_Sword) (tag) <<1>>1)-1)#define DT_EXTRANUM 3/* Values of `d_un.d_val' in the DT_FLAGS entry. */#define DF_ORIGIN 0x00000001 /* Object may use DF_ORIGIN */#define DF_SYMBOLIC 0x00000002 /* Symbol resolutions starts here */#define DF_TEXTREL 0x00000004 /* Object contains text relocations */#define DF_BIND_NOW 0x00000008 /* No lazy binding for this object */#define DF_STATIC_TLS 0x00000010 /* Module uses the static TLS model *//* State flags selectable in the `d_un.d_val' element of the DT_FLAGS_1 entry in the dynamic section. */#define DF_1_NOW 0x00000001 /* Set RTLD_NOW for this object. */#define DF_1_GLOBAL 0x00000002 /* Set RTLD_GLOBAL for this object. */#define DF_1_GROUP 0x00000004 /* Set RTLD_GROUP for this object. */#define DF_1_NODELETE 0x00000008 /* Set RTLD_NODELETE for this object.*/#define DF_1_LOADFLTR 0x00000010 /* Trigger filtee loading at runtime.*/#define DF_1_INITFIRST 0x00000020 /* Set RTLD_INITFIRST for this object*/#define DF_1_NOOPEN 0x00000040 /* Set RTLD_NOOPEN for this object. */#define DF_1_ORIGIN 0x00000080 /* $ORIGIN must be handled. */#define DF_1_DIRECT 0x00000100 /* Direct binding enabled. */#define DF_1_TRANS 0x00000200#define DF_1_INTERPOSE 0x00000400 /* Object is used to interpose. */#define DF_1_NODEFLIB 0x00000800 /* Ignore default lib search path. */#define DF_1_NODUMP 0x00001000 /* Object can't be dldump'ed. */#define DF_1_CONFALT 0x00002000 /* Configuration alternative created.*/#define DF_1_ENDFILTEE 0x00004000 /* Filtee terminates filters search. */#define DF_1_DISPRELDNE 0x00008000 /* Disp reloc applied at build time. */#define DF_1_DISPRELPND 0x00010000 /* Disp reloc applied at run-time. *//* Flags for the feature selection in DT_FEATURE_1. */#define DTF_1_PARINIT 0x00000001#define DTF_1_CONFEXP 0x00000002/* Flags in the DT_POSFLAG_1 entry effecting only the next DT_* entry. */#define DF_P1_LAZYLOAD 0x00000001 /* Lazyload following object. */#define DF_P1_GROUPPERM 0x00000002 /* Symbols from next object are not generally available. *//* Version definition sections. */typedef struct{ Elf32_Half vd_version; /* Version revision */ Elf32_Half vd_flags; /* Version information */ Elf32_Half vd_ndx; /* Version Index */ Elf32_Half vd_cnt; /* Number of associated aux entries */ Elf32_Word vd_hash; /* Version name hash value */ Elf32_Word vd_aux; /* Offset in bytes to verdaux array */ Elf32_Word vd_next; /* Offset in bytes to next verdef entry */} Elf32_Verdef;typedef struct{ Elf64_Half vd_version; /* Version revision */ Elf64_Half vd_flags; /* Version information */ Elf64_Half vd_ndx; /* Version Index */ Elf64_Half vd_cnt; /* Number of associated aux entries */ Elf64_Word vd_hash; /* Version name hash value */ Elf64_Word vd_aux; /* Offset in bytes to verdaux array */ Elf64_Word vd_next; /* Offset in bytes to next verdef entry */} Elf64_Verdef;/* Legal values for vd_version (version revision). */#define VER_DEF_NONE 0 /* No version */#define VER_DEF_CURRENT 1 /* Current version */#define VER_DEF_NUM 2 /* Given version number *//* Legal values for vd_flags (version information flags). */#define VER_FLG_BASE 0x1 /* Version definition of file itself */#define VER_FLG_WEAK 0x2 /* Weak version identifier *//* Versym symbol index values. */#define VER_NDX_LOCAL 0 /* Symbol is local. */#define VER_NDX_GLOBAL 1 /* Symbol is global. */#define VER_NDX_LORESERVE 0xff00 /* Beginning of reserved entries. */#define VER_NDX_ELIMINATE 0xff01 /* Symbol is to be eliminated. *//* Auxialiary version information. */typedef struct{ Elf32_Word vda_name; /* Version or dependency names */ Elf32_Word vda_next; /* Offset in bytes to next verdaux entry */} Elf32_Verdaux;typedef struct{ Elf64_Word vda_name; /* Version or dependency names */ Elf64_Word vda_next; /* Offset in bytes to next verdaux entry */} Elf64_Verdaux;/* Version dependency section. */typedef struct{ Elf32_Half vn_version; /* Version of structure */ Elf32_Half vn_cnt; /* Number of associated aux entries */ Elf32_Word vn_file; /* Offset of filename for this dependency */ Elf32_Word vn_aux; /* Offset in bytes to vernaux array */ Elf32_Word vn_next; /* Offset in bytes to next verneed entry */} Elf32_Verneed;typedef struct{ Elf64_Half vn_version; /* Version of structure */ Elf64_Half vn_cnt; /* Number of associated aux entries */ Elf64_Word vn_file; /* Offset of filename for this dependency */ Elf64_Word vn_aux; /* Offset in bytes to vernaux array */ Elf64_Word vn_next; /* Offset in bytes to next verneed entry */} Elf64_Verneed;/* Legal values for vn_version (version revision). */#define VER_NEED_NONE 0 /* No version */#define VER_NEED_CURRENT 1 /* Current version */#define VER_NEED_NUM 2 /* Given version number *//* Auxiliary needed version information. */typedef struct{ Elf32_Word vna_hash; /* Hash value of dependency name */ Elf32_Half vna_flags; /* Dependency specific information */ Elf32_Half vna_other; /* Unused */ Elf32_Word vna_name; /* Dependency name string offset */ Elf32_Word vna_next; /* Offset in bytes to next vernaux entry */} Elf32_Vernaux;typedef struct{ Elf64_Word vna_hash; /* Hash value of dependency name */ Elf64_Half vna_flags; /* Dependency specific information */ Elf64_Half vna_other; /* Unused */ Elf64_Word vna_name; /* Dependency name string offset */ Elf64_Word vna_next; /* Offset in bytes to next vernaux entry */} Elf64_Vernaux;/* Legal values for vna_flags. */#define VER_FLG_WEAK 0x2 /* Weak version identifier *//* Auxiliary vector. *//* This vector is normally only used by the program interpreter. The usual definition in an ABI supplement uses the name auxv_t. The vector is not usually defined in a standard <elf.h> file, but it can't hurt. We rename it to avoid conflicts. The sizes of these types are an arrangement between the exec server and the program interpreter, so we don't fully specify them here. */typedef struct{ int a_type; /* Entry type */ union { long int a_val; /* Integer value */ void *a_ptr; /* Pointer value */ void (*a_fcn) (void); /* Function pointer value */ } a_un;} Elf32_auxv_t;typedef struct{ long int a_type; /* Entry type */ union { long int a_val; /* Integer value */ void *a_ptr; /* Pointer value */ void (*a_fcn) (void); /* Function pointer value */ } a_un;} Elf64_auxv_t;/* Legal values for a_type (entry type). */#define AT_NULL 0 /* End of vector */#define AT_IGNORE 1 /* Entry should be ignored */#define AT_EXECFD 2 /* File descriptor of program */#define AT_PHDR 3 /* Program headers for program */#define AT_PHENT 4 /* Size of program header entry */#define AT_PHNUM 5 /* Number of program headers */#define AT_PAGESZ 6 /* System page size */#define AT_BASE 7 /* Base address of interpreter */#define AT_FLAGS 8 /* Flags */#define AT_ENTRY 9 /* Entry point of program */#define AT_NOTELF 10 /* Program is not ELF */#define AT_UID 11 /* Real uid */#define AT_EUID 12 /* Effective uid */#define AT_GID 13 /* Real gid */#define AT_EGID 14 /* Effective gid */#define AT_CLKTCK 17 /* Frequency of times() *//* Some more special a_type values describing the hardware. */#define AT_PLATFORM 15 /* String identifying platform. */#define AT_HWCAP 16 /* Machine dependent hints about processor capabilities. *//* This entry gives some information about the FPU initialization performed by the kernel. */#define AT_FPUCW 18 /* Used FPU control word. *//* Cache block sizes. */#define AT_DCACHEBSIZE 19 /* Data cache block size. */#define AT_ICACHEBSIZE 20 /* Instruction cache block size. */#define AT_UCACHEBSIZE 21 /* Unified cache block size. *//* A special ignored value for PPC, used by the kernel to control the interpretation of the AUXV. Must be > 16. */#define AT_IGNOREPPC 22 /* Entry should be ignored. */#define AT_SECURE 23 /* Boolean, was exec setuid-like? *//* Pointer to the global system page used for system calls and other nice things. */#define AT_SYSINFO 32#define AT_SYSINFO_EHDR 33/* Note section contents. Each entry in the note section begins with a header of a fixed form. */typedef struct{ Elf32_Word n_namesz; /* Length of the note's name. */ Elf32_Word n_descsz; /* Length of the note's descriptor. */ Elf32_Word n_type; /* Type of the note. */} Elf32_Nhdr;typedef struct{ Elf64_Word n_namesz; /* Length of the note's name. */ Elf64_Word n_descsz; /* Length of the note's descriptor. */ Elf64_Word n_type; /* Type of the note. */} Elf64_Nhdr;/* Known names of notes. *//* Solaris entries in the note section have this name. */#define ELF_NOTE_SOLARIS "SUNW Solaris"/* Note entries for GNU systems have this name. */#define ELF_NOTE_GNU "GNU"/* Defined types of notes for Solaris. *//* Value of descriptor (one word) is desired pagesize for the binary. */#define ELF_NOTE_PAGESIZE_HINT 1/* Defined note types for GNU systems. *//* ABI information. The descriptor consists of words: word 0: OS descriptor word 1: major version of the ABI word 2: minor version of the ABI word 3: subminor version of the ABI*/#define ELF_NOTE_ABI 1/* Known OSes. These value can appear in word 0 of an ELF_NOTE_ABI note section entry. */#define ELF_NOTE_OS_LINUX 0#define ELF_NOTE_OS_GNU 1
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -