Home
last modified time | relevance | path

Searched refs:ehdr (Results 1 – 25 of 116) sorted by relevance

12345

/external/elfutils/tests/
Dupdate2.c38 Elf32_Ehdr *ehdr; in main() local
59 ehdr = elf32_newehdr (elf); in main()
60 if (ehdr == NULL) in main()
70 printf (" %02x", ehdr->e_ident[i]); in main()
75 ehdr->e_type, ehdr->e_machine, ehdr->e_version, ehdr->e_entry, in main()
76 ehdr->e_phoff, ehdr->e_shoff, ehdr->e_flags, ehdr->e_ehsize, in main()
77 ehdr->e_phentsize, ehdr->e_phnum, ehdr->e_shentsize, in main()
78 ehdr->e_shnum, ehdr->e_shstrndx); in main()
81 ehdr->e_ident[0] = 42; in main()
82 ehdr->e_ident[4] = 1; in main()
[all …]
Dupdate1.c38 Elf32_Ehdr *ehdr; in main() local
58 ehdr = elf32_newehdr (elf); in main()
59 if (ehdr == NULL) in main()
69 printf (" %02x", ehdr->e_ident[i]); in main()
74 ehdr->e_type, ehdr->e_machine, ehdr->e_version, ehdr->e_entry, in main()
75 ehdr->e_phoff, ehdr->e_shoff, ehdr->e_flags, ehdr->e_ehsize, in main()
76 ehdr->e_phentsize, ehdr->e_phnum, ehdr->e_shentsize, in main()
77 ehdr->e_shnum, ehdr->e_shstrndx); in main()
80 ehdr->e_ident[0] = 42; in main()
81 ehdr->e_ident[4] = 1; in main()
[all …]
Dupdate3.c40 Elf32_Ehdr *ehdr; in main() local
68 ehdr = elf32_newehdr (elf); in main()
69 if (ehdr == NULL) in main()
79 printf (" %02x", ehdr->e_ident[i]); in main()
84 ehdr->e_type, ehdr->e_machine, ehdr->e_version, ehdr->e_entry, in main()
85 ehdr->e_phoff, ehdr->e_shoff, ehdr->e_flags, ehdr->e_ehsize, in main()
86 ehdr->e_phentsize, ehdr->e_phnum, ehdr->e_shentsize, in main()
87 ehdr->e_shnum, ehdr->e_shstrndx); in main()
90 ehdr->e_ident[0] = 42; in main()
91 ehdr->e_ident[4] = 1; in main()
[all …]
Delfshphehdr.c68 GElf_Ehdr ehdr; in test() local
69 check_elf ("gelf_getehdr", gelf_getehdr (elf, &ehdr) != NULL); in test()
70 check ("e_shnum == 0", ehdr.e_shnum == 0); in test()
71 check ("e_phnum == 0", ehdr.e_phnum == 0); in test()
72 check ("e_shoff == 0", ehdr.e_shoff == 0); in test()
73 check ("e_phoff == 0", ehdr.e_phoff == 0); in test()
84 ehdr.e_ident[EI_DATA] = ELFDATANONE; /* Ask for native encoding. */ in test()
85 ehdr.e_type = ET_EXEC; in test()
86 ehdr.e_machine = EM_386; in test()
87 ehdr.e_version = EV_NONE; /* Ask for current version. */ in test()
[all …]
Dupdate4.c40 Elf32_Ehdr *ehdr; in main() local
72 ehdr = elf32_newehdr (elf); in main()
73 if (ehdr == NULL) in main()
83 printf (" %02x", ehdr->e_ident[i]); in main()
88 ehdr->e_type, ehdr->e_machine, ehdr->e_version, ehdr->e_entry, in main()
89 ehdr->e_phoff, ehdr->e_shoff, ehdr->e_flags, ehdr->e_ehsize, in main()
90 ehdr->e_phentsize, ehdr->e_phnum, ehdr->e_shentsize, in main()
91 ehdr->e_shnum, ehdr->e_shstrndx); in main()
94 ehdr->e_ident[0] = 42; in main()
95 ehdr->e_ident[4] = 1; in main()
[all …]
Dnewfile.c26 print_ehdr (Elf32_Ehdr *ehdr) in print_ehdr() argument
31 printf (" %02x", ehdr->e_ident[n]); in print_ehdr()
37 ehdr->e_type, in print_ehdr()
38 ehdr->e_machine, in print_ehdr()
39 ehdr->e_version, in print_ehdr()
40 ehdr->e_entry, in print_ehdr()
41 ehdr->e_phoff, in print_ehdr()
42 ehdr->e_shoff, in print_ehdr()
43 ehdr->e_flags, in print_ehdr()
44 ehdr->e_ehsize, in print_ehdr()
[all …]
Dalldts.c90 Elf32_Ehdr *ehdr = elf32_newehdr (elf); in main() local
91 if (ehdr == NULL) in main()
97 ehdr->e_ident[0] = 42; in main()
98 ehdr->e_ident[5] = 1; in main()
99 ehdr->e_ident[6] = 2; in main()
100 ehdr->e_type = ET_EXEC; in main()
101 ehdr->e_machine = EM_386; in main()
102 ehdr->e_version = 1; in main()
103 ehdr->e_ehsize = 1; in main()
104 ehdr->e_shnum = 3; in main()
[all …]
Dsaridx.c194 GElf_Ehdr ehdr; in main() local
197 if (gelf_getehdr (subelf, &ehdr) == NULL) in main()
202 ehdr.e_ident[EI_CLASS] == ELFCLASS32 in main()
205 ehdr.e_ident[EI_DATA] == ELFDATA2LSB in main()
208 ehdr.e_type == ET_REL in main()
210 : (ehdr.e_type == ET_EXEC in main()
212 : (ehdr.e_type == ET_DYN in main()
216 (ehdr.e_machine >= (sizeof (machines) in main()
218 || machines[ehdr.e_machine] == NULL) in main()
220 : machines[ehdr.e_machine]); in main()
/external/libunwind/src/
Delfxx.c113 static bool elf_w (section_table_offset) (struct elf_image* ei, Elf_W(Ehdr)* ehdr, Elf_W(Off)* offs… in elf_w()
114 GET_EHDR_FIELD(ei, ehdr, e_shoff, true); in elf_w()
115 GET_EHDR_FIELD(ei, ehdr, e_shentsize, true); in elf_w()
116 GET_EHDR_FIELD(ei, ehdr, e_shnum, true); in elf_w()
119 if (ehdr->e_shoff + ehdr->e_shnum * ehdr->e_shentsize > size) { in elf_w()
121 (unsigned long) (ehdr->e_shoff + ehdr->e_shnum * ehdr->e_shentsize), in elf_w()
126 *offset = ehdr->e_shoff; in elf_w()
131 struct elf_image* ei, int section, Elf_W(Ehdr)* ehdr, Elf_W(Off)* offset) { in elf_w()
132 GET_EHDR_FIELD(ei, ehdr, e_shoff, true); in elf_w()
133 GET_EHDR_FIELD(ei, ehdr, e_shentsize, true); in elf_w()
[all …]
/external/elfutils/libdwfl/
Delf-from-memory.c107 } ehdr; in elf_from_remote_memory() local
117 .d_buf = &ehdr, in elf_from_remote_memory()
118 .d_size = sizeof ehdr, in elf_from_remote_memory()
137 phoff = ehdr.e32.e_phoff; in elf_from_remote_memory()
138 phnum = ehdr.e32.e_phnum; in elf_from_remote_memory()
139 phentsize = ehdr.e32.e_phentsize; in elf_from_remote_memory()
142 shdrs_end = ehdr.e32.e_shoff + ehdr.e32.e_shnum * ehdr.e32.e_shentsize; in elf_from_remote_memory()
149 phoff = ehdr.e64.e_phoff; in elf_from_remote_memory()
150 phnum = ehdr.e64.e_phnum; in elf_from_remote_memory()
151 phentsize = ehdr.e64.e_phentsize; in elf_from_remote_memory()
[all …]
/external/syslinux/com32/tools/
Drelocs.c21 static Elf32_Ehdr ehdr; variable
204 sec_strtab = secs[ehdr.e_shstrndx].strtab; in sec_name()
206 if (shndx < ehdr.e_shnum) { in sec_name()
254 if (fread(&ehdr, sizeof(ehdr), 1, fp) != 1) { in read_ehdr()
258 if (memcmp(ehdr.e_ident, ELFMAG, SELFMAG) != 0) { in read_ehdr()
261 if (ehdr.e_ident[EI_CLASS] != ELFCLASS32) { in read_ehdr()
264 if (ehdr.e_ident[EI_DATA] != ELFDATA2LSB) { in read_ehdr()
267 if (ehdr.e_ident[EI_VERSION] != EV_CURRENT) { in read_ehdr()
271 ehdr.e_type = elf16_to_cpu(ehdr.e_type); in read_ehdr()
272 ehdr.e_machine = elf16_to_cpu(ehdr.e_machine); in read_ehdr()
[all …]
/external/elfutils/libelf/
Delf32_updatenull.c51 ELFW(default_ehdr,LIBELFBITS) (Elf *elf, ElfW2(LIBELFBITS,Ehdr) *ehdr, in ELFW()
55 if (memcmp (&ehdr->e_ident[EI_MAG0], ELFMAG, SELFMAG) != 0) in ELFW()
57 memcpy (&ehdr->e_ident[EI_MAG0], ELFMAG, SELFMAG); in ELFW()
62 update_if_changed (ehdr->e_ident[EI_CLASS], ELFW(ELFCLASS,LIBELFBITS), in ELFW()
66 if (unlikely (ehdr->e_ident[EI_DATA] == ELFDATANONE)) in ELFW()
68 ehdr->e_ident[EI_DATA] = in ELFW()
72 else if (unlikely (ehdr->e_ident[EI_DATA] >= ELFDATANUM)) in ELFW()
79 && ehdr->e_ident[EI_DATA] != ELFDATA2LSB) in ELFW()
81 && ehdr->e_ident[EI_DATA] != ELFDATA2MSB)); in ELFW()
84 update_if_changed (ehdr->e_ident[EI_VERSION], EV_CURRENT, in ELFW()
[all …]
Delf_getshdrstrndx.c63 assert (offsetof (struct Elf, state.elf.ehdr) in elf_getshdrstrndx()
64 == offsetof (struct Elf, state.elf32.ehdr)); in elf_getshdrstrndx()
65 assert (sizeof (elf->state.elf.ehdr) in elf_getshdrstrndx()
66 == sizeof (elf->state.elf32.ehdr)); in elf_getshdrstrndx()
67 assert (offsetof (struct Elf, state.elf.ehdr) in elf_getshdrstrndx()
68 == offsetof (struct Elf, state.elf64.ehdr)); in elf_getshdrstrndx()
69 assert (sizeof (elf->state.elf.ehdr) in elf_getshdrstrndx()
70 == sizeof (elf->state.elf64.ehdr)); in elf_getshdrstrndx()
72 if (unlikely (elf->state.elf.ehdr == NULL)) in elf_getshdrstrndx()
82 ? elf->state.elf32.ehdr->e_shstrndx in elf_getshdrstrndx()
[all …]
Dgelf_update_ehdr.c58 Elf32_Ehdr *ehdr = elf->state.elf32.ehdr; in gelf_update_ehdr() local
60 if (ehdr == NULL) in gelf_update_ehdr()
78 memcpy (ehdr->e_ident, src->e_ident, EI_NIDENT); in gelf_update_ehdr()
80 ehdr->name = src->name in gelf_update_ehdr()
97 Elf64_Ehdr *ehdr = elf->state.elf64.ehdr; in gelf_update_ehdr() local
99 if (ehdr == NULL) in gelf_update_ehdr()
106 memcpy (ehdr, src, sizeof (Elf64_Ehdr)); in gelf_update_ehdr()
Dgelf_getehdr.c59 if (offsetof (struct Elf, state.elf32.ehdr) in __gelf_getehdr_rdlock()
60 != offsetof (struct Elf, state.elf64.ehdr)) in __gelf_getehdr_rdlock()
63 if (unlikely (elf->state.elf64.ehdr == NULL)) in __gelf_getehdr_rdlock()
68 Elf32_Ehdr *ehdr = elf->state.elf32.ehdr; in __gelf_getehdr_rdlock() local
71 memcpy (dest->e_ident, ehdr->e_ident, EI_NIDENT); in __gelf_getehdr_rdlock()
73 dest->name = ehdr->name in __gelf_getehdr_rdlock()
91 result = memcpy (dest, elf->state.elf64.ehdr, sizeof (*dest)); in __gelf_getehdr_rdlock()
Delf_begin.c84 } ehdr; in get_shnum() local
98 ehdr.p = e_ident; in get_shnum()
104 ehdr.p = &ehdr_mem; in get_shnum()
143 result = ehdr.e32->e_shnum; in get_shnum()
145 if (unlikely (result == 0) && ehdr.e32->e_shoff != 0) in get_shnum()
147 if (unlikely (ehdr.e32->e_shoff >= maxsize) in get_shnum()
148 || unlikely (maxsize - ehdr.e32->e_shoff < sizeof (Elf32_Shdr))) in get_shnum()
154 || (((size_t) ((char *) map_address + ehdr.e32->e_shoff)) in get_shnum()
157 result = ((Elf32_Shdr *) ((char *) map_address + ehdr.e32->e_shoff in get_shnum()
167 + ehdr.e32->e_shoff in get_shnum()
[all …]
/external/vixl/examples/aarch32/
Ddisasm-a32.cc99 explicit SectionLocator(const Elf32_Ehdr* ehdr) { in SectionLocator() argument
101 reinterpret_cast<const char*>(ehdr) + ehdr->e_shoff); in SectionLocator()
104 reinterpret_cast<const char*>(ehdr) + shdr_[ehdr->e_shstrndx].sh_offset; in SectionLocator()
105 nsections_ = ehdr->e_shnum; in SectionLocator()
122 void LocateSymbols(const Elf32_Ehdr* ehdr, in LocateSymbols() argument
128 reinterpret_cast<const char*>(ehdr) + ehdr->e_shoff); in LocateSymbols()
131 reinterpret_cast<const char*>(ehdr) + strtab->sh_offset; in LocateSymbols()
136 reinterpret_cast<const char*>(ehdr) + symtab->sh_offset); in LocateSymbols()
138 if ((sym[snum].st_shndx > 0) && (sym[snum].st_shndx < ehdr->e_shnum) && in LocateSymbols()
169 StaticSymbolVisitor(const Elf32_Ehdr* ehdr, SymbolTable* symbols) in StaticSymbolVisitor() argument
[all …]
/external/syslinux/gpxe/src/image/
Delf.c51 Elf_Ehdr *ehdr ) { in elf_load_segment() argument
98 if ( ( e_offset = ( ehdr->e_entry - dest ) ) < phdr->p_filesz ) { in elf_load_segment()
99 image->priv.phys = ehdr->e_entry; in elf_load_segment()
102 } else if ( ( e_offset = ( ehdr->e_entry - phdr->p_vaddr ) ) in elf_load_segment()
108 ( ( unsigned long ) ehdr->e_entry ) ); in elf_load_segment()
122 Elf_Ehdr ehdr; in elf_load() local
132 copy_from_user ( &ehdr, image->data, 0, sizeof ( ehdr ) ); in elf_load()
133 if ( memcmp ( &ehdr.e_ident[EI_MAG0], ELFMAG, SELFMAG ) != 0 ) { in elf_load()
142 for ( phoff = ehdr.e_phoff , phnum = ehdr.e_phnum ; phnum ; in elf_load()
143 phoff += ehdr.e_phentsize, phnum-- ) { in elf_load()
[all …]
/external/libunwind/src/ia64/
DGfind_unwind_table.c39 Elf64_Ehdr *ehdr = edi->ei.image; in find_gp() local
64 soff = ehdr->e_shoff; in find_gp()
65 str_soff = soff + (ehdr->e_shstrndx * ehdr->e_shentsize); in find_gp()
67 if (soff + ehdr->e_shnum * ehdr->e_shentsize > edi->ei.size) in find_gp()
70 soff + ehdr->e_shnum * ehdr->e_shentsize, in find_gp()
78 for (i = 0; i < ehdr->e_shnum; ++i) in find_gp()
86 shdr = (Elf64_Shdr *) (((char *) shdr) + ehdr->e_shentsize); in find_gp()
100 Elf64_Ehdr *ehdr; in ia64_find_unwind_table() local
106 ehdr = edi->ei.image; in ia64_find_unwind_table()
107 phdr = (Elf64_Phdr *) ((char *) edi->ei.image + ehdr->e_phoff); in ia64_find_unwind_table()
[all …]
/external/elfutils/libasm/
Dasm_begin.c72 GElf_Ehdr *ehdr; in prepare_binary_output() local
92 ehdr = gelf_getehdr (result->out.elf, &ehdr_mem); in prepare_binary_output()
94 assert (ehdr != NULL); in prepare_binary_output()
97 ehdr->e_type = ET_REL; in prepare_binary_output()
99 ehdr->e_version = EV_CURRENT; in prepare_binary_output()
102 ehdr->e_machine = ebl_get_elfmachine (ebl); in prepare_binary_output()
103 ehdr->e_ident[EI_CLASS] = class; in prepare_binary_output()
104 ehdr->e_ident[EI_DATA] = ebl_get_elfdata (ebl); in prepare_binary_output()
106 memcpy (&ehdr->e_ident[EI_MAG0], ELFMAG, SELFMAG); in prepare_binary_output()
109 (void) gelf_update_ehdr (result->out.elf, ehdr); in prepare_binary_output()
/external/tcpdump/
Dprint-token.c153 struct ether_header ehdr; in token_print() local
168 extract_token_addrs(trp, (char*)ESRC(&ehdr), (char*)EDST(&ehdr)); in token_print()
173 *ESRC(&ehdr) &= 0x7f; in token_print()
176 token_hdr_print(ndo, trp, length, ESRC(&ehdr), EDST(&ehdr)); in token_print()
204 token_hdr_print(ndo, trp, length, ESRC(&ehdr), EDST(&ehdr)); in token_print()
207 src.addr = ESRC(&ehdr); in token_print()
209 dst.addr = EDST(&ehdr); in token_print()
233 ESRC(&ehdr), EDST(&ehdr)); in token_print()
Dprint-ipfc.c95 struct ether_header ehdr; in ipfc_print() local
106 extract_ipfc_addrs(ipfcp, (char *)ESRC(&ehdr), (char *)EDST(&ehdr)); in ipfc_print()
109 ipfc_hdr_print(ndo, ipfcp, length, ESRC(&ehdr), EDST(&ehdr)); in ipfc_print()
111 src.addr = ESRC(&ehdr); in ipfc_print()
113 dst.addr = EDST(&ehdr); in ipfc_print()
/external/elfutils/libdw/
Ddwarf_getcfi_elf.c74 const GElf_Ehdr *ehdr, GElf_Addr *eh_frame_vaddr, in parse_eh_frame_hdr() argument
96 .e_ident = ehdr->e_ident, in parse_eh_frame_hdr()
126 getcfi_gnu_eh_frame (Elf *elf, const GElf_Ehdr *ehdr, const GElf_Phdr *phdr) in getcfi_gnu_eh_frame() argument
143 phdr->p_vaddr, ehdr, in getcfi_gnu_eh_frame()
150 vsize = encoded_value_size (data, ehdr->e_ident, search_table_encoding, in getcfi_gnu_eh_frame()
194 getcfi_phdr (Elf *elf, const GElf_Ehdr *ehdr) in getcfi_phdr() argument
207 return getcfi_gnu_eh_frame (elf, ehdr, phdr); in getcfi_phdr()
215 getcfi_scn_eh_frame (Elf *elf, const GElf_Ehdr *ehdr, in getcfi_scn_eh_frame() argument
239 hdr_vaddr, ehdr, &eh_frame_vaddr, in getcfi_scn_eh_frame()
246 vsize = encoded_value_size (hdr_data, ehdr->e_ident, in getcfi_scn_eh_frame()
[all …]
Ddwarf_begin_elf.c68 check_section (Dwarf *result, GElf_Ehdr *ehdr, Elf_Scn *scn, bool inscngrp) in check_section() argument
98 const char *scnname = elf_strptr (result->elf, ehdr->e_shstrndx, in check_section()
217 global_read (Dwarf *result, Elf *elf, GElf_Ehdr *ehdr) in global_read() argument
222 result = check_section (result, ehdr, scn, false); in global_read()
229 scngrp_read (Dwarf *result, Elf *elf, GElf_Ehdr *ehdr, Elf_Scn *scngrp) in scngrp_read() argument
278 result = check_section (result, ehdr, scn, true); in scngrp_read()
290 GElf_Ehdr *ehdr; in dwarf_begin_elf() local
295 ehdr = gelf_getehdr (elf, &ehdr_mem); in dwarf_begin_elf()
296 if (ehdr == NULL) in dwarf_begin_elf()
322 if ((BYTE_ORDER == LITTLE_ENDIAN && ehdr->e_ident[EI_DATA] == ELFDATA2MSB) in dwarf_begin_elf()
[all …]
/external/elfutils/src/
Delflint.c96 static void check_note_section (Ebl *ebl, GElf_Ehdr *ehdr,
354 check_elf_header (Ebl *ebl, GElf_Ehdr *ehdr, size_t size) in check_elf_header() argument
360 if (ehdr->e_ident[EI_MAG0] != ELFMAG0) in check_elf_header()
362 if (ehdr->e_ident[EI_MAG1] != ELFMAG1) in check_elf_header()
364 if (ehdr->e_ident[EI_MAG2] != ELFMAG2) in check_elf_header()
366 if (ehdr->e_ident[EI_MAG3] != ELFMAG3) in check_elf_header()
369 if (ehdr->e_ident[EI_CLASS] != ELFCLASS32 in check_elf_header()
370 && ehdr->e_ident[EI_CLASS] != ELFCLASS64) in check_elf_header()
372 EI_CLASS, ehdr->e_ident[EI_CLASS]); in check_elf_header()
374 if (ehdr->e_ident[EI_DATA] != ELFDATA2LSB in check_elf_header()
[all …]

12345