/external/elfutils/tests/ |
D | update2.c | 38 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 …]
|
D | update1.c | 38 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 …]
|
D | update3.c | 40 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 …]
|
D | elfshphehdr.c | 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.e_machine = EM_386; in test() 87 ehdr.e_version = EV_NONE; /* Ask for current version. */ in test() [all …]
|
D | update4.c | 40 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 …]
|
D | newfile.c | 26 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 …]
|
D | alldts.c | 90 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 …]
|
D | saridx.c | 194 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()
|
D | emptyfile.c | 92 GElf_Ehdr *ehdr = gelf_getehdr (elf, &ehdr_mem); in check_elf() local 93 if (ehdr == NULL) in check_elf() 100 ehdr->e_ident[EI_DATA] = class == ELFCLASS64 ? ELFDATA2LSB : ELFDATA2MSB; in check_elf() 101 ehdr->e_ident[EI_OSABI] = ELFOSABI_GNU; in check_elf() 102 ehdr->e_type = ET_NONE; in check_elf() 103 ehdr->e_machine = EM_X86_64; in check_elf() 104 ehdr->e_version = EV_CURRENT; in check_elf() 106 if (gelf_update_ehdr (elf, ehdr) == 0) in check_elf() 180 ehdr->e_shstrndx = ndx; in check_elf() 182 if (gelf_update_ehdr (elf, ehdr) == 0) in check_elf()
|
/external/u-boot/drivers/remoteproc/ |
D | rproc-elf-loader.c | 14 Elf32_Ehdr *ehdr; local 27 ehdr = (Elf32_Ehdr *)addr; 28 class = ehdr->e_ident[EI_CLASS]; 30 if (!IS_ELF(*ehdr) || ehdr->e_type != ET_EXEC || class != ELFCLASS32) { 37 if (ehdr->e_ident[EI_DATA] != ELFDATA2LSB) { 39 if (ehdr->e_ident[EI_DATA] != ELFDATA2MSB) { 45 if (size < ehdr->e_shoff + sizeof(Elf32_Shdr)) { 50 if (memcmp(ehdr->e_ident, ELFMAG, SELFMAG)) { 55 if (ehdr->e_phnum == 0) { 60 if (ehdr->e_phoff > size) { [all …]
|
/external/libunwind/src/ |
D | elfxx.c | 113 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/ |
D | elf-from-memory.c | 107 } 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 …]
|
/external/u-boot/cmd/ |
D | elf.c | 38 Elf64_Ehdr *ehdr; /* Elf header structure pointer */ in load_elf64_image_phdr() local 42 ehdr = (Elf64_Ehdr *)addr; in load_elf64_image_phdr() 43 phdr = (Elf64_Phdr *)(addr + (ulong)ehdr->e_phoff); in load_elf64_image_phdr() 46 for (i = 0; i < ehdr->e_phnum; ++i) { in load_elf64_image_phdr() 62 if (ehdr->e_machine == EM_PPC64 && (ehdr->e_flags & in load_elf64_image_phdr() 69 uintptr_t addr = ehdr->e_entry; in load_elf64_image_phdr() 74 return ehdr->e_entry; in load_elf64_image_phdr() 79 Elf64_Ehdr *ehdr; /* Elf header structure pointer */ in load_elf64_image_shdr() local 85 ehdr = (Elf64_Ehdr *)addr; in load_elf64_image_shdr() 88 shdr = (Elf64_Shdr *)(addr + (ulong)ehdr->e_shoff + in load_elf64_image_shdr() [all …]
|
/external/vixl/examples/aarch32/ |
D | disasm-a32.cc | 99 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/elfutils/libelf/ |
D | elf32_updatenull.c | 55 ELFW(default_ehdr,LIBELFBITS) (Elf *elf, ElfW2(LIBELFBITS,Ehdr) *ehdr, in ELFW() 59 if (memcmp (&ehdr->e_ident[EI_MAG0], ELFMAG, SELFMAG) != 0) in ELFW() 61 memcpy (&ehdr->e_ident[EI_MAG0], ELFMAG, SELFMAG); in ELFW() 66 update_if_changed (ehdr->e_ident[EI_CLASS], ELFW(ELFCLASS,LIBELFBITS), in ELFW() 70 if (unlikely (ehdr->e_ident[EI_DATA] == ELFDATANONE)) in ELFW() 72 ehdr->e_ident[EI_DATA] = in ELFW() 76 else if (unlikely (ehdr->e_ident[EI_DATA] >= ELFDATANUM)) in ELFW() 83 && ehdr->e_ident[EI_DATA] != ELFDATA2LSB) in ELFW() 85 && ehdr->e_ident[EI_DATA] != ELFDATA2MSB)); in ELFW() 88 update_if_changed (ehdr->e_ident[EI_VERSION], EV_CURRENT, in ELFW() [all …]
|
D | elf_getshdrstrndx.c | 63 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 …]
|
D | gelf_update_ehdr.c | 58 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()
|
D | gelf_getehdr.c | 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()
|
D | elf_begin.c | 83 } ehdr; in get_shnum() local 97 ehdr.p = e_ident; in get_shnum() 103 ehdr.p = &ehdr_mem; in get_shnum() 142 result = ehdr.e32->e_shnum; in get_shnum() 144 if (unlikely (result == 0) && ehdr.e32->e_shoff != 0) in get_shnum() 146 if (unlikely (ehdr.e32->e_shoff >= maxsize) in get_shnum() 147 || unlikely (maxsize - ehdr.e32->e_shoff < sizeof (Elf32_Shdr))) in get_shnum() 153 || (((size_t) ((char *) map_address + ehdr.e32->e_shoff)) in get_shnum() 156 result = ((Elf32_Shdr *) ((char *) map_address + ehdr.e32->e_shoff in get_shnum() 167 + ehdr.e32->e_shoff in get_shnum() [all …]
|
/external/libunwind/src/ia64/ |
D | Gfind_unwind_table.c | 39 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/ |
D | asm_begin.c | 72 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/ |
D | print-token.c | 153 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()
|
D | print-ipfc.c | 95 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/ |
D | dwarf_getcfi_elf.c | 74 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 …]
|
/external/elfutils/src/ |
D | elflint.c | 95 static void check_note_section (Ebl *ebl, GElf_Ehdr *ehdr, 340 check_elf_header (Ebl *ebl, GElf_Ehdr *ehdr, size_t size) in check_elf_header() argument 346 if (ehdr->e_ident[EI_MAG0] != ELFMAG0) in check_elf_header() 348 if (ehdr->e_ident[EI_MAG1] != ELFMAG1) in check_elf_header() 350 if (ehdr->e_ident[EI_MAG2] != ELFMAG2) in check_elf_header() 352 if (ehdr->e_ident[EI_MAG3] != ELFMAG3) in check_elf_header() 355 if (ehdr->e_ident[EI_CLASS] != ELFCLASS32 in check_elf_header() 356 && ehdr->e_ident[EI_CLASS] != ELFCLASS64) in check_elf_header() 358 EI_CLASS, ehdr->e_ident[EI_CLASS]); in check_elf_header() 360 if (ehdr->e_ident[EI_DATA] != ELFDATA2LSB in check_elf_header() [all …]
|