Home
last modified time | relevance | path

Searched refs:ehdr (Results 1 - 25 of 114) sorted by relevance

12345

/third_party/elfutils/tests/
H A Dupdate2.c39 Elf32_Ehdr *ehdr; in main() local
60 ehdr = elf32_newehdr (elf); in main()
61 if (ehdr == NULL) in main()
71 printf (" %02x", ehdr->e_ident[i]); in main()
76 ehdr->e_type, ehdr->e_machine, ehdr->e_version, ehdr->e_entry, in main()
77 ehdr->e_phoff, ehdr in main()
[all...]
H A Dupdate3.c41 Elf32_Ehdr *ehdr; in main() local
69 ehdr = elf32_newehdr (elf); in main()
70 if (ehdr == NULL) in main()
80 printf (" %02x", ehdr->e_ident[i]); in main()
85 ehdr->e_type, ehdr->e_machine, ehdr->e_version, ehdr->e_entry, in main()
86 ehdr->e_phoff, ehdr in main()
[all...]
H A Dupdate1.c39 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 in main()
[all...]
H A Delfshphehdr.c1 /* Test program for adding section and program headers and ehdr updates.
68 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 in test()
[all...]
H A Dupdate4.c41 Elf32_Ehdr *ehdr; in main() local
73 ehdr = elf32_newehdr (elf); in main()
74 if (ehdr == NULL) in main()
84 printf (" %02x", ehdr->e_ident[i]); in main()
89 ehdr->e_type, ehdr->e_machine, ehdr->e_version, ehdr->e_entry, in main()
90 ehdr->e_phoff, ehdr in main()
[all...]
H A 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 in print_ehdr()
85 Elf32_Ehdr *ehdr = elf32_getehdr (elf); main() local
[all...]
H A Dalldts.c92 Elf32_Ehdr *ehdr = elf32_newehdr (elf); in main() local
93 if (ehdr == NULL) in main()
99 ehdr->e_ident[0] = 42; in main()
100 ehdr->e_ident[5] = 1; in main()
101 ehdr->e_ident[6] = 2; in main()
102 ehdr->e_type = ET_EXEC; in main()
103 ehdr->e_machine = EM_386; in main()
104 ehdr->e_version = 1; in main()
105 ehdr->e_ehsize = 1; in main()
106 ehdr in main()
[all...]
H A 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 in main()
[all...]
H A Dvendorelf.c62 GElf_Ehdr *ehdr = gelf_getehdr (elf, &ehdr_mem); in check_elf() local
63 if (ehdr == NULL) in check_elf()
70 ehdr->e_ident[EI_DATA] = class == ELFCLASS64 ? ELFDATA2LSB : ELFDATA2MSB; in check_elf()
71 ehdr->e_ident[EI_OSABI] = ELFOSABI_GNU; in check_elf()
72 ehdr->e_type = ET_LOOS + 1; in check_elf()
73 ehdr->e_machine = EM_X86_64; in check_elf()
74 ehdr->e_version = EV_CURRENT; in check_elf()
76 if (gelf_update_ehdr (elf, ehdr) == 0) in check_elf()
H A Ddwflsyms.c89 GElf_Ehdr ehdr; in elf_section_name() local
93 gelf_getehdr (elf, &ehdr); in elf_section_name()
94 return elf_strptr (elf, ehdr.e_shstrndx, shdr.sh_name); in elf_section_name()
138 GElf_Ehdr ehdr; in list_syms() local
139 gelf_getehdr (elf, &ehdr); in list_syms()
145 || ehdr.e_type == ET_REL); in list_syms()
166 || ehdr.e_type == ET_REL); in list_syms()
185 if (value != isym.st_value + bias && ehdr.e_type != ET_REL) in list_syms()
193 gelf_getehdr (melf, &ehdr); in list_syms()
194 const char *sname = elf_strptr (melf, ehdr in list_syms()
[all...]
H A Demptyfile.c93 GElf_Ehdr *ehdr = gelf_getehdr (elf, &ehdr_mem); in check_elf() local
94 if (ehdr == NULL) in check_elf()
101 ehdr->e_ident[EI_DATA] = class == ELFCLASS64 ? ELFDATA2LSB : ELFDATA2MSB; in check_elf()
102 ehdr->e_ident[EI_OSABI] = ELFOSABI_GNU; in check_elf()
103 ehdr->e_type = ET_NONE; in check_elf()
104 ehdr->e_machine = EM_X86_64; in check_elf()
105 ehdr->e_version = EV_CURRENT; in check_elf()
107 if (gelf_update_ehdr (elf, ehdr) == 0) in check_elf()
181 ehdr->e_shstrndx = ndx; in check_elf()
183 if (gelf_update_ehdr (elf, ehdr) in check_elf()
[all...]
/third_party/elfutils/libdwfl/
H A 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()
147 shdrs_end = ehdr.e32.e_shoff + ehdr.e32.e_shnum * ehdr.e32.e_shentsize; in elf_from_remote_memory()
154 phoff = ehdr in elf_from_remote_memory()
[all...]
/third_party/vixl/examples/aarch32/
H A 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) in LocateSymbols()
169 StaticSymbolVisitor(const Elf32_Ehdr* ehdr, SymbolTable* symbols) StaticSymbolVisitor() argument
240 const Elf32_Ehdr* ehdr = reinterpret_cast<const Elf32_Ehdr*>(base_addr); main() local
[all...]
/third_party/elfutils/libelf/
H A Delf_getshdrstrndx.c61 assert (offsetof (struct Elf, state.elf.ehdr) in elf_getshdrstrndx()
62 == offsetof (struct Elf, state.elf32.ehdr)); in elf_getshdrstrndx()
63 assert (sizeof (elf->state.elf.ehdr) in elf_getshdrstrndx()
64 == sizeof (elf->state.elf32.ehdr)); in elf_getshdrstrndx()
65 assert (offsetof (struct Elf, state.elf.ehdr) in elf_getshdrstrndx()
66 == offsetof (struct Elf, state.elf64.ehdr)); in elf_getshdrstrndx()
67 assert (sizeof (elf->state.elf.ehdr) in elf_getshdrstrndx()
68 == sizeof (elf->state.elf64.ehdr)); in elf_getshdrstrndx()
70 if (unlikely (elf->state.elf.ehdr == NULL)) in elf_getshdrstrndx()
80 ? elf->state.elf32.ehdr in elf_getshdrstrndx()
[all...]
H A Delf32_updatenull.c53 ELFW(default_ehdr,LIBELFBITS) (Elf *elf, ElfW2(LIBELFBITS,Ehdr) *ehdr, in ELFW()
57 if (memcmp (&ehdr->e_ident[EI_MAG0], ELFMAG, SELFMAG) != 0) in ELFW()
59 memcpy (&ehdr->e_ident[EI_MAG0], ELFMAG, SELFMAG); in ELFW()
64 update_if_changed (ehdr->e_ident[EI_CLASS], ELFW(ELFCLASS,LIBELFBITS), in ELFW()
68 if (unlikely (ehdr->e_ident[EI_DATA] == ELFDATANONE)) in ELFW()
70 ehdr->e_ident[EI_DATA] = in ELFW()
74 else if (unlikely (ehdr->e_ident[EI_DATA] >= ELFDATANUM)) in ELFW()
81 && ehdr->e_ident[EI_DATA] != ELFDATA2LSB) in ELFW()
83 && ehdr->e_ident[EI_DATA] != ELFDATA2MSB)); in ELFW()
86 update_if_changed (ehdr in ELFW()
[all...]
H A 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()
H A Dgelf_getehdr.c57 /* The following is an optimization: the ehdr element is at the same in __gelf_getehdr_rdlock()
59 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()
H A Delf32_updatefile.c130 ElfW2(LIBELFBITS,Ehdr) *ehdr = elf->state.ELFW(elf,LIBELFBITS).ehdr; in __elfw2()
147 (*fctp) ((char *) elf->map_address + elf->start_offset, ehdr, in __elfw2()
150 else if (elf->map_address + elf->start_offset != ehdr) in __elfw2()
151 memcpy (elf->map_address + elf->start_offset, ehdr, in __elfw2()
177 if (ehdr->e_phoff > ehdr->e_ehsize) in __elfw2()
178 memset (elf->map_address + elf->start_offset + ehdr->e_ehsize, in __elfw2()
179 __libelf_fill_byte, ehdr->e_phoff - ehdr in __elfw2()
[all...]
H A Delf_begin.c81 } ehdr; in get_shnum() local
102 ehdr.p = e_ident; in get_shnum()
108 ehdr.p = &ehdr_mem; in get_shnum()
147 result = ehdr.e32->e_shnum; in get_shnum()
149 if (unlikely (result == 0) && ehdr.e32->e_shoff != 0) in get_shnum()
151 if (unlikely (ehdr.e32->e_shoff >= maxsize) in get_shnum()
152 || unlikely (maxsize - ehdr.e32->e_shoff < sizeof (Elf32_Shdr))) in get_shnum()
158 || (((size_t) ((char *) (map_address + ehdr.e32->e_shoff in get_shnum()
162 result = ((Elf32_Shdr *) ((char *) map_address + ehdr.e32->e_shoff in get_shnum()
173 + ehdr in get_shnum()
344 Elf32_Ehdr *ehdr = (Elf32_Ehdr *) ((char *) map_address + offset); file_read_elf() local
448 Elf64_Ehdr *ehdr = (Elf64_Ehdr *) ((char *) map_address + offset); file_read_elf() local
599 Elf64_Ehdr ehdr; read_unmmaped_file() member
[all...]
/third_party/libunwind/libunwind/src/ia64/
H A 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 in find_gp()
100 Elf64_Ehdr *ehdr; ia64_find_unwind_table() local
[all...]
/third_party/libunwind/libunwind/src/
H A Ddl-iterate-phdr.c36 #define IS_ELF(ehdr) ((ehdr).e_ident[EI_MAG0] == ELFMAG0 && \
37 (ehdr).e_ident[EI_MAG1] == ELFMAG1 && \
38 (ehdr).e_ident[EI_MAG2] == ELFMAG2 && \
39 (ehdr).e_ident[EI_MAG3] == ELFMAG3)
71 Elf_W(Ehdr) *ehdr = (Elf_W(Ehdr) *) start; in dl_iterate_phdr()
74 if (mi.path[0] != '\0' && (flags & PROT_READ) != 0 && IS_ELF (*ehdr) in dl_iterate_phdr()
75 && dladdr (ehdr, &canonical_info) != 0 in dl_iterate_phdr()
76 && ehdr == canonical_info.dli_fbase) in dl_iterate_phdr()
79 Elf_W(Phdr) *phdr = (Elf_W(Phdr) *) (start + ehdr in dl_iterate_phdr()
[all...]
H A Delfxx.c40 Elf_W (Ehdr) *ehdr = ei->image; in Elf_W()
43 soff = ehdr->e_shoff; in Elf_W()
44 if (soff + ehdr->e_shnum * ehdr->e_shentsize > ei->size) in Elf_W()
47 (unsigned long) (soff + ehdr->e_shnum * ehdr->e_shentsize), in Elf_W()
58 Elf_W (Ehdr) *ehdr = ei->image; in string_table()
63 soff = ehdr->e_shoff; in string_table()
65 str_soff = soff + (section * ehdr->e_shentsize); in string_table()
66 if (str_soff + ehdr in string_table()
[all...]
/third_party/elfutils/libdw/
H A Ddwarf_getcfi_elf.c44 allocate_cfi (Elf *elf, const GElf_Ehdr *ehdr, GElf_Addr vaddr) in allocate_cfi() argument
61 cfi->e_machine = ehdr->e_machine; in allocate_cfi()
76 const GElf_Ehdr *ehdr, GElf_Addr *eh_frame_vaddr, in parse_eh_frame_hdr()
98 .e_ident = ehdr->e_ident, in parse_eh_frame_hdr()
128 getcfi_gnu_eh_frame (Elf *elf, const GElf_Ehdr *ehdr, const GElf_Phdr *phdr) in getcfi_gnu_eh_frame() argument
145 phdr->p_vaddr, ehdr, in getcfi_gnu_eh_frame()
152 vsize = encoded_value_size (data, ehdr->e_ident, search_table_encoding, in getcfi_gnu_eh_frame()
177 Dwarf_CFI *cfi = allocate_cfi (elf, ehdr, eh_frame_ptr); in getcfi_gnu_eh_frame()
196 getcfi_phdr (Elf *elf, const GElf_Ehdr *ehdr) in getcfi_phdr() argument
209 return getcfi_gnu_eh_frame (elf, ehdr, phd in getcfi_phdr()
75 parse_eh_frame_hdr(const uint8_t *hdr, size_t hdr_size, GElf_Addr hdr_vaddr, const GElf_Ehdr *ehdr, GElf_Addr *eh_frame_vaddr, size_t *table_entries, uint8_t *table_encoding) parse_eh_frame_hdr() argument
217 getcfi_scn_eh_frame(Elf *elf, const GElf_Ehdr *ehdr, Elf_Scn *scn, GElf_Shdr *shdr, Elf_Scn *hdr_scn, GElf_Addr hdr_vaddr) getcfi_scn_eh_frame() argument
273 getcfi_shdr(Elf *elf, const GElf_Ehdr *ehdr) getcfi_shdr() argument
325 GElf_Ehdr *ehdr = gelf_getehdr (elf, &ehdr_mem); dwarf_getcfi_elf() local
[all...]
/third_party/elfutils/libasm/
H A Dasm_begin.c70 GElf_Ehdr *ehdr; in prepare_binary_output() local
90 ehdr = gelf_getehdr (result->out.elf, &ehdr_mem); in prepare_binary_output()
92 assert (ehdr != NULL); in prepare_binary_output()
95 ehdr->e_type = ET_REL; in prepare_binary_output()
97 ehdr->e_version = EV_CURRENT; in prepare_binary_output()
100 ehdr->e_machine = ebl_get_elfmachine (ebl); in prepare_binary_output()
101 ehdr->e_ident[EI_CLASS] = class; in prepare_binary_output()
102 ehdr->e_ident[EI_DATA] = ebl_get_elfdata (ebl); in prepare_binary_output()
104 memcpy (&ehdr->e_ident[EI_MAG0], ELFMAG, SELFMAG); in prepare_binary_output()
107 (void) gelf_update_ehdr (result->out.elf, ehdr); in prepare_binary_output()
[all...]
/third_party/elfutils/src/
H A Delflint.c94 static void check_note_section (Ebl *ebl, GElf_Ehdr *ehdr,
339 check_elf_header (Ebl *ebl, GElf_Ehdr *ehdr, size_t size) in check_elf_header() argument
345 if (ehdr->e_ident[EI_MAG0] != ELFMAG0) in check_elf_header()
347 if (ehdr->e_ident[EI_MAG1] != ELFMAG1) in check_elf_header()
349 if (ehdr->e_ident[EI_MAG2] != ELFMAG2) in check_elf_header()
351 if (ehdr->e_ident[EI_MAG3] != ELFMAG3) in check_elf_header()
354 if (ehdr->e_ident[EI_CLASS] != ELFCLASS32 in check_elf_header()
355 && ehdr->e_ident[EI_CLASS] != ELFCLASS64) in check_elf_header()
357 EI_CLASS, ehdr->e_ident[EI_CLASS]); in check_elf_header()
359 if (ehdr in check_elf_header()
602 check_symtab(Ebl *ebl, GElf_Ehdr *ehdr, GElf_Shdr *shdr, int idx) check_symtab() argument
1075 is_rel_dyn(Ebl *ebl, const GElf_Ehdr *ehdr, int idx, const GElf_Shdr *shdr, bool is_rela) is_rel_dyn() argument
1249 check_reloc_shdr(Ebl *ebl, const GElf_Ehdr *ehdr, const GElf_Shdr *shdr, int idx, int reltype, GElf_Shdr **destshdrp, GElf_Shdr *destshdr_memp, struct loaded_segment **loadedp) check_reloc_shdr() argument
1371 check_one_reloc(Ebl *ebl, GElf_Ehdr *ehdr, GElf_Shdr *relshdr, int idx, size_t cnt, const GElf_Shdr *symshdr, Elf_Data *symdata, GElf_Addr r_offset, GElf_Xword r_info, const GElf_Shdr *destshdr, bool reldyn, struct loaded_segment *loaded, enum load_state *statep) check_one_reloc() argument
1492 check_rela(Ebl *ebl, GElf_Ehdr *ehdr, GElf_Shdr *shdr, int idx) check_rela() argument
1543 check_rel(Ebl *ebl, GElf_Ehdr *ehdr, GElf_Shdr *shdr, int idx) check_rel() argument
1598 check_dynamic(Ebl *ebl, GElf_Ehdr *ehdr, GElf_Shdr *shdr, int idx) check_dynamic() argument
1929 check_symtab_shndx(Ebl *ebl, GElf_Ehdr *ehdr, GElf_Shdr *shdr, int idx) check_symtab_shndx() argument
2303 check_hash(int tag, Ebl *ebl, GElf_Ehdr *ehdr, GElf_Shdr *shdr, int idx) check_hash() argument
2376 compare_hash_gnu_hash(Ebl *ebl, GElf_Ehdr *ehdr, size_t hash_idx, size_t gnu_hash_idx) compare_hash_gnu_hash() argument
2621 check_group(Ebl *ebl, GElf_Ehdr *ehdr, GElf_Shdr *shdr, int idx) check_group() argument
3443 check_attributes(Ebl *ebl, GElf_Ehdr *ehdr, GElf_Shdr *shdr, int idx) check_attributes() argument
3700 check_sections(Ebl *ebl, GElf_Ehdr *ehdr) check_sections() argument
4305 check_note_data(Ebl *ebl, const GElf_Ehdr *ehdr, Elf_Data *data, int shndx, int phndx, GElf_Off start) check_note_data() argument
4423 check_note(Ebl *ebl, GElf_Ehdr *ehdr, GElf_Phdr *phdr, int cnt) check_note() argument
4456 check_note_section(Ebl *ebl, GElf_Ehdr *ehdr, GElf_Shdr *shdr, int idx) check_note_section() argument
4492 check_program_header(Ebl *ebl, GElf_Ehdr *ehdr) check_program_header() argument
4780 GElf_Ehdr *ehdr = gelf_getehdr (elf, &ehdr_mem); process_elf_file() local
[all...]

Completed in 11 milliseconds

12345