1 /* readelf.h -- This file contains structures similar to those found in
2 include/elf/internal.h. These structures however, match the layout of
3 the information in the file, rather than being optimised for internal
6 Copyright (C) 1998 Free Software Foundation, Inc.
8 This file is part of GNU Binutils.
10 This program is free software; you can redistribute it and/or modify
11 it under the terms of the GNU General Public License as published by
12 the Free Software Foundation; either version 2 of the License, or
13 (at your option) any later version.
15 This program is distributed in the hope that it will be useful,
16 but WITHOUT ANY WARRANTY; without even the implied warranty of
17 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 GNU General Public License for more details.
20 You should have received a copy of the GNU General Public License
21 along with this program; if not, write to the Free Software
22 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
28 #include "elf/common.h"
33 /* The type 'bfd_vma' is used in places where the 64 bit version of the
34 structure has a 64 bit wide field, and the 32 bit version has a 32 bit wide
35 field. It does not necessarily imply that the field contains an address. */
39 /* The ELF file header. This appears at the start of every ELF file. */
42 unsigned char e_ident
[EI_NIDENT
]; /* Magic number and other info */
43 unsigned short e_type
; /* Object file type */
44 unsigned short e_machine
; /* Architecture */
45 unsigned long e_version
; /* Object file version */
46 bfd_vma e_entry
; /* Entry point virtual address */
47 bfd_vma e_phoff
; /* Program header table file offset */
48 bfd_vma e_shoff
; /* Section header table file offset */
49 unsigned long e_flags
; /* Processor-specific flags */
50 unsigned short e_ehsize
; /* ELF header size in bytes */
51 unsigned short e_phentsize
; /* Program header table entry size */
52 unsigned short e_phnum
; /* Program header table entry count */
53 unsigned short e_shentsize
; /* Section header table entry size */
54 unsigned short e_shnum
; /* Section header table entry count */
55 unsigned short e_shstrndx
; /* Section header string table index */
59 /* Program Segment Header. (Might be wrong for 64 bit ELF formats). */
62 unsigned long p_type
; /* Segment type */
63 bfd_vma p_offset
; /* Segment file offset */
64 bfd_vma p_vaddr
; /* Segment virtual address */
65 bfd_vma p_paddr
; /* Segment physical address */
66 unsigned long p_filesz
; /* Segment size in file */
67 unsigned long p_memsz
; /* Segment size in memory */
68 unsigned long p_flags
; /* Segment flags */
69 unsigned long p_align
; /* Segment alignment */
76 unsigned long sh_name
; /* Section name (string tbl index) */
77 unsigned long sh_type
; /* Section type */
78 bfd_vma sh_flags
; /* Section flags */
79 bfd_vma sh_addr
; /* Section virtual addr at execution */
80 bfd_vma sh_offset
; /* Section file offset */
81 unsigned long sh_size
; /* Section size in bytes */
82 unsigned long sh_link
; /* Link to another section */
83 unsigned long sh_info
; /* Additional section information */
84 bfd_vma sh_addralign
; /* Section alignment */
85 bfd_vma sh_entsize
; /* Entry size if section holds table */
89 /* Symbol table entry. (Might be incorrect for 64 bit ELF formats) */
92 unsigned long st_name
; /* Symbol name (string tbl index) */
93 bfd_vma st_value
; /* Symbol value */
94 bfd_vma st_size
; /* Symbol size */
95 unsigned char st_info
; /* Symbol type and binding */
96 unsigned char st_other
; /* No defined meaning, 0 */
97 unsigned short st_shndx
; /* Section index */
101 /* Version definition sections. */
104 unsigned short vd_version
; /* Version number of structure. */
105 unsigned short vd_flags
; /* Flags (VER_FLG_*). */
106 unsigned short vd_ndx
; /* Version index. */
107 unsigned short vd_cnt
; /* Number of verdaux entries. */
108 unsigned long vd_hash
; /* Hash of name. */
109 unsigned long vd_aux
; /* Offset to verdaux entries. */
110 unsigned long vd_next
; /* Offset to next verdef. */
114 /* Auxialiary version information. */
117 unsigned long vda_name
; /* String table offset of name. */
118 unsigned long vda_next
; /* Offset to next verdaux. */
122 /* Version dependency section. */
125 unsigned short vn_version
; /* Version number of structure. */
126 unsigned short vn_cnt
; /* Number of vernaux entries. */
127 unsigned long vn_file
; /* String table offset of library name. */
128 unsigned long vn_aux
; /* Offset to vernaux entries. */
129 unsigned long vn_next
; /* Offset to next verneed. */
133 /* Auxiliary needed version information. */
136 unsigned long vna_hash
; /* Hash of dependency name. */
137 unsigned short vna_flags
; /* Flags (VER_FLG_*). */
138 unsigned short vna_other
; /* Unused. */
139 unsigned long vna_name
; /* String table offset to version name. */
140 unsigned long vna_next
; /* Offset to next vernaux. */
144 /* Relocation table entry without addend. */
147 bfd_vma r_offset
; /* Location at which to apply the action */
148 bfd_vma r_info
; /* index and type of relocation */
152 /* Relocation table entry with addend. */
155 bfd_vma r_offset
; /* Location at which to apply the action */
156 bfd_vma r_info
; /* Index and Type of relocation */
157 bfd_signed_vma r_addend
; /* Constant addend used to compute value */
161 /* Dynamic section entry. */
164 signed long d_tag
; /* Dynamic entry type */
167 bfd_vma d_val
; /* Integer value */
168 bfd_vma d_ptr
; /* Address value */
174 #define DT_VERSIONTAGIDX(tag) (DT_VERNEEDNUM - (tag)) /* Reverse order! */
176 #endif /* _READELF_H */
This page took 0.032688 seconds and 4 git commands to generate.