/external/libunwind/src/coredump/ |
D | _UCD_elf_map_image.c | 30 CD_elf_map_image(struct UCD_info *ui, coredump_phdr_t *phdr) in CD_elf_map_image() argument 34 if (phdr->backing_fd < 0) in CD_elf_map_image() 41 … ei->image = mmap(NULL, phdr->p_memsz, PROT_READ, MAP_PRIVATE, ui->coredump_fd, phdr->p_offset); in CD_elf_map_image() 47 ei->size = phdr->p_filesz; in CD_elf_map_image() 48 size_t remainder_len = phdr->p_memsz - phdr->p_filesz; in CD_elf_map_image() 51 void *remainder_base = (char*) ei->image + phdr->p_filesz; in CD_elf_map_image() 63 ei->image = mmap(NULL, phdr->backing_filesize, PROT_READ, MAP_PRIVATE, phdr->backing_fd, 0); in CD_elf_map_image() 69 ei->size = phdr->backing_filesize; in CD_elf_map_image() 81 return phdr; in CD_elf_map_image() 90 coredump_phdr_t *phdr = &ui->phdrs[i]; in _UCD_get_elf_image() local [all …]
|
D | _UCD_create.c | 315 struct coredump_phdr *phdr = &ui->phdrs[phdr_no]; in _UCD_add_backing_file_at_segment() local 316 if (phdr->backing_filename) in _UCD_add_backing_file_at_segment() 329 phdr->backing_fd = fd; in _UCD_add_backing_file_at_segment() 330 phdr->backing_filename = strdup(filename); in _UCD_add_backing_file_at_segment() 338 phdr->backing_filesize = (uoff_t)statbuf.st_size; in _UCD_add_backing_file_at_segment() 340 if (phdr->p_flags != (PF_X | PF_R)) in _UCD_add_backing_file_at_segment() 341 Debug(1, "Note: phdr[%u] is not r-x: flags are 0x%x\n", phdr_no, phdr->p_flags); in _UCD_add_backing_file_at_segment() 343 if (phdr->backing_filesize > phdr->p_memsz) in _UCD_add_backing_file_at_segment() 348 (unsigned long long)phdr->p_memsz, in _UCD_add_backing_file_at_segment() 349 (unsigned long long)phdr->backing_filesize in _UCD_add_backing_file_at_segment() [all …]
|
D | _UCD_access_mem.c | 40 coredump_phdr_t *phdr; in _UCD_access_mem() local 44 phdr = &ui->phdrs[i]; in _UCD_access_mem() 45 if (phdr->p_vaddr <= addr && addr_last < phdr->p_vaddr + phdr->p_memsz) in _UCD_access_mem() 58 if (addr_last >= phdr->p_vaddr + phdr->p_filesz) in _UCD_access_mem() 62 if (phdr->backing_fd < 0) in _UCD_access_mem() 69 filename = phdr->backing_filename; in _UCD_access_mem() 70 fileofs = addr - phdr->p_vaddr; in _UCD_access_mem() 71 fd = phdr->backing_fd; in _UCD_access_mem() 76 fileofs = phdr->p_offset + (addr - phdr->p_vaddr); in _UCD_access_mem()
|
/external/libunwind/src/dwarf/ |
D | Gfind_unwind_table.c | 37 Elf_W(Phdr) phdr; in get_dyn_gp() 38 GET_PHDR_FIELD(ei, dyn_phdr_offset, &phdr, p_offset); in get_dyn_gp() 40 Elf_W(Off) dyn_offset = phdr.p_offset; in get_dyn_gp() 62 Elf_W(Phdr) phdr; in get_eh_frame_info() 63 GET_PHDR_FIELD(ei, phdr_offset, &phdr, p_offset); in get_eh_frame_info() 64 unw_word_t hdr_offset = phdr.p_offset; in get_eh_frame_info() 67 if (sizeof(hdr) != elf_w (memory_read) (ei, ei->u.memory.start + phdr.p_offset, in get_eh_frame_info() 114 GET_PHDR_FIELD(ei, phdr_offset, &phdr, p_vaddr); in get_eh_frame_info() 115 GET_PHDR_FIELD(ei, phdr_offset, &phdr, p_offset); in get_eh_frame_info() 117 load_base + phdr.p_vaddr + addr - (uintptr_t) ei->u.memory.start - phdr.p_offset; in get_eh_frame_info() [all …]
|
/external/elfutils/libelf/ |
D | elf32_getphdr.c | 56 result = elf->state.ELFW(elf,LIBELFBITS).phdr; in ElfW2() 115 elf->state.ELFW(elf,LIBELFBITS).phdr = file_phdr; in ElfW2() 119 ElfW2(LIBELFBITS,Phdr) *phdr; in ElfW2() 123 phdr = elf->state.ELFW(elf,LIBELFBITS).phdr = in ElfW2() 125 if (elf->state.ELFW(elf,LIBELFBITS).phdr == NULL) in ElfW2() 139 memcpy (phdr, file_phdr, size); in ElfW2() 162 CONVERT_TO (phdr[cnt].p_type, notcvt[cnt].p_type); in ElfW2() 163 CONVERT_TO (phdr[cnt].p_offset, notcvt[cnt].p_offset); in ElfW2() 164 CONVERT_TO (phdr[cnt].p_vaddr, notcvt[cnt].p_vaddr); in ElfW2() 165 CONVERT_TO (phdr[cnt].p_paddr, notcvt[cnt].p_paddr); in ElfW2() [all …]
|
D | gelf_getphdr.c | 66 Elf32_Phdr *phdr = elf->state.elf32.phdr; in gelf_getphdr() local 68 if (phdr == NULL) in gelf_getphdr() 71 phdr = INTUSE(elf32_getphdr) (elf); in gelf_getphdr() 72 if (phdr == NULL) in gelf_getphdr() 91 phdr += ndx; in gelf_getphdr() 93 #define COPY(Name) result->Name = phdr->Name in gelf_getphdr() 106 Elf64_Phdr *phdr = elf->state.elf64.phdr; in gelf_getphdr() local 108 if (phdr == NULL) in gelf_getphdr() 111 phdr = INTUSE(elf64_getphdr) (elf); in gelf_getphdr() 112 if (phdr == NULL) in gelf_getphdr() [all …]
|
D | gelf_update_phdr.c | 58 Elf32_Phdr *phdr = elf->state.elf32.phdr; in gelf_update_phdr() local 74 if (phdr == NULL) in gelf_update_phdr() 76 phdr = __elf32_getphdr_wrlock (elf); in gelf_update_phdr() 77 if (phdr == NULL) in gelf_update_phdr() 94 phdr += ndx; in gelf_update_phdr() 97 phdr->name = src->name in gelf_update_phdr() 109 Elf64_Phdr *phdr = elf->state.elf64.phdr; in gelf_update_phdr() local 111 if (phdr == NULL) in gelf_update_phdr() 113 phdr = __elf64_getphdr_wrlock (elf); in gelf_update_phdr() 114 if (phdr == NULL) in gelf_update_phdr() [all …]
|
/external/elfutils/tests/ |
D | vendorelf.c | 88 GElf_Phdr phdr; in check_elf() local 89 if (gelf_getphdr (elf, 0, &phdr) == NULL) in check_elf() 96 phdr.p_type = PT_NULL; in check_elf() 97 phdr.p_offset = 0; in check_elf() 98 phdr.p_vaddr = 0; in check_elf() 99 phdr.p_paddr = 1; in check_elf() 100 phdr.p_filesz = 0; in check_elf() 101 phdr.p_memsz = 1024; in check_elf() 102 phdr.p_flags = PF_R; in check_elf() 103 phdr.p_align = 16; in check_elf() [all …]
|
D | showptable.c | 89 GElf_Phdr *phdr = gelf_getphdr (elf, cnt, &mem); in main() local 91 const char *p_type = typenames[phdr->p_type]; in main() 94 if (phdr->p_type >= PT_NUM) in main() 96 snprintf (buf, sizeof (buf), "%x", phdr->p_type); in main() 103 (unsigned long long int) phdr->p_offset, in main() 105 (unsigned long long int) phdr->p_vaddr, in main() 107 (unsigned long long int) phdr->p_paddr, in main() 109 (unsigned long long int) phdr->p_filesz, in main() 111 (unsigned long long int) phdr->p_memsz, in main() 112 (unsigned long long int) phdr->p_align); in main() [all …]
|
D | alldts.c | 109 Elf32_Phdr *phdr = elf32_newphdr (elf, 2); in main() local 110 if (phdr == NULL) in main() 116 phdr[0].p_type = PT_PHDR; in main() 117 phdr[1].p_type = PT_DYNAMIC; in main() 228 phdr[0].p_offset = ehdr->e_phoff; in main() 229 phdr[0].p_vaddr = ehdr->e_phoff; in main() 230 phdr[0].p_paddr = ehdr->e_phoff; in main() 231 phdr[0].p_flags = PF_R | PF_X; in main() 232 phdr[0].p_filesz = ehdr->e_phnum * elf32_fsize (ELF_T_PHDR, 1, EV_CURRENT); in main() 233 phdr[0].p_memsz = ehdr->e_phnum * elf32_fsize (ELF_T_PHDR, 1, EV_CURRENT); in main() [all …]
|
D | update2.c | 39 Elf32_Phdr *phdr; in main() local 91 phdr = elf32_newphdr (elf, 1); in main() 92 if (phdr == NULL) in main() 98 phdr[0].p_type = PT_PHDR; in main() 110 phdr[0].p_offset = ehdr->e_phoff; in main() 111 phdr[0].p_offset = ehdr->e_phoff; in main() 112 phdr[0].p_vaddr = ehdr->e_phoff; in main() 113 phdr[0].p_paddr = ehdr->e_phoff; in main() 114 phdr[0].p_flags = PF_R | PF_X; in main() 115 phdr[0].p_filesz = ehdr->e_phnum * elf32_fsize (ELF_T_PHDR, 1, EV_CURRENT); in main() [all …]
|
D | update3.c | 41 Elf32_Phdr *phdr; in main() local 100 phdr = elf32_newphdr (elf, 1); in main() 101 if (phdr == NULL) in main() 107 phdr[0].p_type = PT_PHDR; in main() 159 phdr[0].p_offset = ehdr->e_phoff; in main() 160 phdr[0].p_offset = ehdr->e_phoff; in main() 161 phdr[0].p_vaddr = ehdr->e_phoff; in main() 162 phdr[0].p_paddr = ehdr->e_phoff; in main() 163 phdr[0].p_flags = PF_R | PF_X; in main() 164 phdr[0].p_filesz = ehdr->e_phnum * elf32_fsize (ELF_T_PHDR, 1, EV_CURRENT); in main() [all …]
|
D | update4.c | 41 Elf32_Phdr *phdr; in main() local 104 phdr = elf32_newphdr (elf, 1); in main() 105 if (phdr == NULL) in main() 111 phdr[0].p_type = PT_PHDR; in main() 311 phdr[0].p_offset = ehdr->e_phoff; in main() 312 phdr[0].p_offset = ehdr->e_phoff; in main() 313 phdr[0].p_vaddr = ehdr->e_phoff; in main() 314 phdr[0].p_paddr = ehdr->e_phoff; in main() 315 phdr[0].p_flags = PF_R | PF_X; in main() 316 phdr[0].p_filesz = ehdr->e_phnum * elf32_fsize (ELF_T_PHDR, 1, EV_CURRENT); in main() [all …]
|
/external/u-boot/cmd/ |
D | elf.c | 38 Elf64_Phdr *phdr; /* Program header structure pointer */ in load_elf64_image_phdr() local 42 phdr = (Elf64_Phdr *)(addr + (ulong)ehdr->e_phoff); in load_elf64_image_phdr() 46 void *dst = (void *)(ulong)phdr->p_paddr; in load_elf64_image_phdr() 47 void *src = (void *)addr + phdr->p_offset; in load_elf64_image_phdr() 50 i, dst, (ulong)phdr->p_filesz); in load_elf64_image_phdr() 51 if (phdr->p_filesz) in load_elf64_image_phdr() 52 memcpy(dst, src, phdr->p_filesz); in load_elf64_image_phdr() 53 if (phdr->p_filesz != phdr->p_memsz) in load_elf64_image_phdr() 54 memset(dst + phdr->p_filesz, 0x00, in load_elf64_image_phdr() 55 phdr->p_memsz - phdr->p_filesz); in load_elf64_image_phdr() [all …]
|
/external/linux-kselftest/tools/testing/selftests/kvm/lib/ |
D | elf.c | 150 Elf64_Phdr phdr; in kvm_vm_elf_load() local 151 test_read(fd, &phdr, sizeof(phdr)); in kvm_vm_elf_load() 154 if (phdr.p_type != PT_LOAD) in kvm_vm_elf_load() 158 TEST_ASSERT(phdr.p_memsz > 0, "Unexpected loadable segment " in kvm_vm_elf_load() 161 n1, (uint64_t) phdr.p_memsz); in kvm_vm_elf_load() 162 vm_vaddr_t seg_vstart = phdr.p_vaddr; in kvm_vm_elf_load() 164 vm_vaddr_t seg_vend = phdr.p_vaddr + phdr.p_memsz - 1; in kvm_vm_elf_load() 184 if (phdr.p_filesz) { in kvm_vm_elf_load() 185 offset_rv = lseek(fd, phdr.p_offset, SEEK_SET); in kvm_vm_elf_load() 186 TEST_ASSERT(offset_rv == phdr.p_offset, in kvm_vm_elf_load() [all …]
|
/external/wpa_supplicant_8/src/eap_peer/ |
D | ikev2.c | 842 struct ikev2_payload_hdr *phdr; in ikev2_build_sar1() local 850 phdr = wpabuf_put(msg, sizeof(*phdr)); in ikev2_build_sar1() 851 phdr->next_payload = next_payload; in ikev2_build_sar1() 852 phdr->flags = 0; in ikev2_build_sar1() 891 plen = (u8 *) wpabuf_put(msg, 0) - (u8 *) phdr; in ikev2_build_sar1() 892 WPA_PUT_BE16(phdr->payload_length, plen); in ikev2_build_sar1() 901 struct ikev2_payload_hdr *phdr; in ikev2_build_ker() local 914 phdr = wpabuf_put(msg, sizeof(*phdr)); in ikev2_build_ker() 915 phdr->next_payload = next_payload; in ikev2_build_ker() 916 phdr->flags = 0; in ikev2_build_ker() [all …]
|
/external/elfutils/libdw/ |
D | dwarf_getcfi_elf.c | 126 getcfi_gnu_eh_frame (Elf *elf, const GElf_Ehdr *ehdr, const GElf_Phdr *phdr) in getcfi_gnu_eh_frame() argument 128 Elf_Data *data = elf_getdata_rawchunk (elf, phdr->p_offset, phdr->p_filesz, in getcfi_gnu_eh_frame() 142 const uint8_t *search_table = parse_eh_frame_hdr (data->d_buf, phdr->p_filesz, in getcfi_gnu_eh_frame() 143 phdr->p_vaddr, ehdr, in getcfi_gnu_eh_frame() 152 dmax = phdr->p_filesz - (search_table - (const uint8_t *) data->d_buf); in getcfi_gnu_eh_frame() 158 Dwarf_Off eh_frame_offset = eh_frame_ptr - phdr->p_vaddr + phdr->p_offset; in getcfi_gnu_eh_frame() 183 cfi->search_table_len = phdr->p_filesz; in getcfi_gnu_eh_frame() 184 cfi->search_table_vaddr = phdr->p_vaddr; in getcfi_gnu_eh_frame() 203 GElf_Phdr *phdr = gelf_getphdr (elf, i, &phdr_mem); in getcfi_phdr() local 204 if (unlikely (phdr == NULL)) in getcfi_phdr() [all …]
|
/external/wpa_supplicant_8/src/eap_server/ |
D | ikev2.c | 906 struct ikev2_payload_hdr *phdr; in ikev2_build_sai() local 914 phdr = wpabuf_put(msg, sizeof(*phdr)); in ikev2_build_sai() 915 phdr->next_payload = next_payload; in ikev2_build_sai() 916 phdr->flags = 0; in ikev2_build_sai() 956 plen = (u8 *) wpabuf_put(msg, 0) - (u8 *) phdr; in ikev2_build_sai() 957 WPA_PUT_BE16(phdr->payload_length, plen); in ikev2_build_sai() 966 struct ikev2_payload_hdr *phdr; in ikev2_build_kei() local 980 phdr = wpabuf_put(msg, sizeof(*phdr)); in ikev2_build_kei() 981 phdr->next_payload = next_payload; in ikev2_build_kei() 982 phdr->flags = 0; in ikev2_build_kei() [all …]
|
/external/elfutils/libdwfl/ |
D | core-file.c | 138 GElf_Phdr *phdr = gelf_getphdr (elf, ndx, &phdr_mem); in dwfl_report_core_segments() local 139 if (unlikely (phdr == NULL)) in dwfl_report_core_segments() 144 switch (phdr->p_type) in dwfl_report_core_segments() 147 result = dwfl_report_segment (dwfl, ndx, phdr, 0, NULL); in dwfl_report_core_segments() 153 *notes = *phdr; in dwfl_report_core_segments() 279 #define more(size) do_more (size, &phdr, align, elf, start, &ndx, &end, &end_vaddr) 301 GElf_Phdr phdr; in dwfl_elf_phdr_memory_callback() local 304 if (unlikely (gelf_getphdr (elf, ndx++, &phdr) == NULL)) in dwfl_elf_phdr_memory_callback() 306 while (phdr.p_type != PT_LOAD in dwfl_elf_phdr_memory_callback() 307 || ((phdr.p_vaddr + phdr.p_memsz + align - 1) & -align) <= vaddr); in dwfl_elf_phdr_memory_callback() [all …]
|
D | link_map.c | 545 GElf_Phdr *phdr = gelf_getphdr (mod->main.elf, i, &phdr_mem); in consider_executable() local 546 if (phdr == NULL) in consider_executable() 549 if (phdr->p_align > 1 && (align == 0 || phdr->p_align < align)) in consider_executable() 550 align = phdr->p_align; in consider_executable() 553 && phdr->p_type == PT_LOAD in consider_executable() 554 && (phdr->p_offset & -align) == (ehdr.e_phoff & -align)) in consider_executable() 561 if (ehdr.e_phoff - phdr->p_offset + phdr->p_vaddr != at_phdr) in consider_executable() 569 if (((ehdr.e_phoff - phdr->p_offset + phdr->p_vaddr) & -align) in consider_executable() 574 GElf_Addr bias = (at_phdr - (ehdr.e_phoff - phdr->p_offset in consider_executable() 575 + phdr->p_vaddr)); in consider_executable() [all …]
|
/external/libunwind/src/ |
D | elfxx.c | 258 Elf_W(Phdr) phdr; in elf_w() 259 GET_PHDR_FIELD(ei, offset, &phdr, p_type); in elf_w() 260 if (phdr.p_type == PT_LOAD) { in elf_w() 261 GET_PHDR_FIELD(ei, offset, &phdr, p_offset); in elf_w() 262 if (phdr.p_offset == mapoff) { in elf_w() 263 GET_PHDR_FIELD(ei, offset, &phdr, p_vaddr); in elf_w() 264 *load_offset = segbase - phdr.p_vaddr; in elf_w() 394 Elf_W(Phdr) *phdr = (Elf_W(Phdr) *) ((char *) ei->u.mapped.image + ehdr->e_phoff); in elf_w() 398 if (phdr[i].p_type == PT_LOAD && phdr[i].p_offset == mapoff) { in elf_w() 399 *load_offset = segbase - phdr[i].p_vaddr; in elf_w() [all …]
|
/external/libunwind_llvm/src/ |
D | AddressSpace.hpp | 516 const Elf_Phdr *phdr = &pinfo->dlpi_phdr[i]; in findUnwindSections() 517 if (phdr->p_type == PT_LOAD) { in findUnwindSections() 518 uintptr_t begin = pinfo->dlpi_addr + phdr->p_vaddr; in findUnwindSections() 520 if (pinfo->dlpi_addr == 0 && phdr->p_vaddr < image_base) in findUnwindSections() 523 uintptr_t end = begin + phdr->p_memsz; in findUnwindSections() 526 object_length = phdr->p_memsz; in findUnwindSections() 529 } else if (phdr->p_type == PT_GNU_EH_FRAME) { in findUnwindSections() 531 uintptr_t eh_frame_hdr_start = pinfo->dlpi_addr + phdr->p_vaddr; in findUnwindSections() 533 if (pinfo->dlpi_addr == 0 && phdr->p_vaddr < image_base) in findUnwindSections() 537 cbdata->sects->dwarf_index_section_length = phdr->p_memsz; in findUnwindSections() [all …]
|
/external/elfutils/libdwelf/ |
D | dwelf_elf_gnu_build_id.c | 86 GElf_Phdr *phdr = gelf_getphdr (elf, i, &phdr_mem); in find_elf_build_id() local 87 if (likely (phdr != NULL) && phdr->p_type == PT_NOTE) in find_elf_build_id() 89 phdr->p_offset, in find_elf_build_id() 90 phdr->p_filesz, in find_elf_build_id() 91 (phdr->p_align == 8 in find_elf_build_id() 94 phdr->p_vaddr, in find_elf_build_id()
|
/external/elfutils/src/ |
D | elflint.c | 499 GElf_Phdr *phdr = gelf_getphdr (ebl->elf, pcnt, &phdr_mem); in check_elf_header() local 500 if (phdr == NULL) in check_elf_header() 867 GElf_Phdr *phdr = NULL; in check_symtab() local 872 phdr = gelf_getphdr (ebl->elf, pcnt, &phdr_mem); in check_symtab() 873 if (phdr != NULL && phdr->p_type == PT_TLS) in check_symtab() 884 else if (phdr == NULL) in check_symtab() 893 < destshdr->sh_offset - phdr->p_offset) in check_symtab() 899 > (destshdr->sh_offset - phdr->p_offset in check_symtab() 906 > (destshdr->sh_offset - phdr->p_offset in check_symtab() 1034 GElf_Phdr *phdr = gelf_getphdr (ebl->elf, pcnt, &phdr_mem); in check_symtab() local [all …]
|
/external/linux-kselftest/tools/testing/selftests/powerpc/ptrace/ |
D | core-pkey.c | 199 Elf64_Phdr *phdr; in check_core_file() local 216 phdr_size = sizeof(*phdr) * ehdr->e_phnum; in check_core_file() 223 for (phdr = p + ehdr->e_phoff; in check_core_file() 224 (void *) phdr < p + ehdr->e_phoff + phdr_size; in check_core_file() 225 phdr += ehdr->e_phentsize) in check_core_file() 226 if (phdr->p_type == PT_NOTE) in check_core_file() 229 FAIL_IF((void *) phdr >= p + ehdr->e_phoff + phdr_size); in check_core_file() 232 for (nhdr = p + phdr->p_offset; in check_core_file() 233 (void *) nhdr < p + phdr->p_offset + phdr->p_filesz; in check_core_file() 238 FAIL_IF((void *) nhdr >= p + phdr->p_offset + phdr->p_filesz); in check_core_file()
|