Home
last modified time | relevance | path

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

123456

/third_party/elfutils/tests/
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->e_shoff, ehdr->e_flags, ehdr->e_ehsize, in main()
78 ehdr->e_phentsize, ehdr->e_phnum, ehdr->e_shentsize, in main()
79 ehdr->e_shnum, ehdr->e_shstrndx); in main()
82 ehdr->e_ident[0] = 42; in main()
83 ehdr->e_ident[4] = 1; in main()
[all …]
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->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 …]
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->e_shoff, ehdr->e_flags, ehdr->e_ehsize, in main()
87 ehdr->e_phentsize, ehdr->e_phnum, ehdr->e_shentsize, in main()
88 ehdr->e_shnum, ehdr->e_shstrndx); in main()
91 ehdr->e_ident[0] = 42; in main()
92 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.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->e_shoff, ehdr->e_flags, ehdr->e_ehsize, in main()
91 ehdr->e_phentsize, ehdr->e_phnum, ehdr->e_shentsize, in main()
92 ehdr->e_shnum, ehdr->e_shstrndx); in main()
95 ehdr->e_ident[0] = 42; in main()
96 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.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->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()
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.e_shstrndx, in list_syms()
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) == 0) in check_elf()
/third_party/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()
147 shdrs_end = ehdr.e32.e_shoff + ehdr.e32.e_shnum * ehdr.e32.e_shentsize; in elf_from_remote_memory()
154 phoff = ehdr.e64.e_phoff; in elf_from_remote_memory()
155 phnum = ehdr.e64.e_phnum; in elf_from_remote_memory()
156 phentsize = ehdr.e64.e_phentsize; in elf_from_remote_memory()
[all …]
/third_party/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 …]
/third_party/elfutils/libelf/
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->e_ident[EI_VERSION], EV_CURRENT, in ELFW()
[all …]
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->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.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.e32->e_shoff in get_shnum()
[all …]
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->e_ehsize); in __elfw2()
188 (*fctp) (elf->map_address + elf->start_offset + ehdr->e_phoff, in __elfw2()
193 memmove (elf->map_address + elf->start_offset + ehdr->e_phoff, in __elfw2()
208 ehdr->e_phoff) in __elfw2()
[all …]
Delf32_getphdr.c70 ElfW2(LIBELFBITS,Ehdr) *ehdr = elf->state.ELFW(elf,LIBELFBITS).ehdr; in ElfW2()
76 if (phnum == 0 || ehdr->e_phoff == 0) in ElfW2()
86 || ehdr->e_phoff > elf->maximum_size in ElfW2()
87 || elf->maximum_size - ehdr->e_phoff < size) in ElfW2()
97 if (unlikely (ehdr->e_phoff >= elf->maximum_size) in ElfW2()
98 || unlikely (elf->maximum_size - ehdr->e_phoff < size)) in ElfW2()
107 + elf->start_offset + ehdr->e_phoff); in ElfW2()
108 if (ehdr->e_ident[EI_DATA] == MY_ELFDATA in ElfW2()
134 if (ehdr->e_ident[EI_DATA] == MY_ELFDATA) in ElfW2()
191 elf->start_offset + ehdr->e_phoff); in ElfW2()
[all …]
/third_party/libunwind/libunwind/src/
Ddl-iterate-phdr.c36 #define IS_ELF(ehdr) ((ehdr).e_ident[EI_MAG0] == ELFMAG0 && \ argument
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->e_phoff); in dl_iterate_phdr()
84 info.dlpi_phnum = ehdr->e_phnum; in dl_iterate_phdr()
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 elf_w()
63 soff = ehdr->e_shoff; in elf_w()
65 str_soff = soff + (section * ehdr->e_shentsize); in elf_w()
66 if (str_soff + ehdr->e_shentsize > ei->size) in elf_w()
69 (unsigned long) (str_soff + ehdr->e_shentsize), in elf_w()
94 Elf_W (Ehdr) *ehdr = ei->image; in elf_w()
[all …]
/third_party/libunwind/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 …]
/third_party/elfutils/libdw/
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() argument
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, phdr); in getcfi_phdr()
[all …]
/third_party/elfutils/libasm/
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()
/third_party/elfutils/src/
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->e_ident[EI_DATA] != ELFDATA2LSB in check_elf_header()
[all …]

123456