/kernel/linux/linux-5.10/drivers/soc/qcom/ |
D | mdt_loader.c | 20 static bool mdt_phdr_valid(const struct elf32_phdr *phdr) in mdt_phdr_valid() argument 22 if (phdr->p_type != PT_LOAD) in mdt_phdr_valid() 25 if ((phdr->p_flags & QCOM_MDT_TYPE_MASK) == QCOM_MDT_TYPE_HASH) in mdt_phdr_valid() 28 if (!phdr->p_memsz) in mdt_phdr_valid() 43 const struct elf32_phdr *phdr; in qcom_mdt_get_size() local 53 phdr = &phdrs[i]; in qcom_mdt_get_size() 55 if (!mdt_phdr_valid(phdr)) in qcom_mdt_get_size() 58 if (phdr->p_paddr < min_addr) in qcom_mdt_get_size() 59 min_addr = phdr->p_paddr; in qcom_mdt_get_size() 61 if (phdr->p_paddr + phdr->p_memsz > max_addr) in qcom_mdt_get_size() [all …]
|
D | smem.c | 278 phdr_to_last_uncached_entry(struct smem_partition_header *phdr) in phdr_to_last_uncached_entry() argument 280 void *p = phdr; in phdr_to_last_uncached_entry() 282 return p + le32_to_cpu(phdr->offset_free_uncached); in phdr_to_last_uncached_entry() 286 phdr_to_first_cached_entry(struct smem_partition_header *phdr, in phdr_to_first_cached_entry() argument 289 void *p = phdr; in phdr_to_first_cached_entry() 292 return p + le32_to_cpu(phdr->size) - ALIGN(sizeof(*e), cacheline); in phdr_to_first_cached_entry() 296 phdr_to_last_cached_entry(struct smem_partition_header *phdr) in phdr_to_last_cached_entry() argument 298 void *p = phdr; in phdr_to_last_cached_entry() 300 return p + le32_to_cpu(phdr->offset_free_cached); in phdr_to_last_cached_entry() 304 phdr_to_first_uncached_entry(struct smem_partition_header *phdr) in phdr_to_first_uncached_entry() argument [all …]
|
/kernel/linux/linux-5.10/arch/s390/kernel/ |
D | kexec_elf.c | 21 const Elf_Phdr *phdr; in kexec_file_add_kernel_elf() local 34 phdr = (void *)ehdr + ehdr->e_phoff; in kexec_file_add_kernel_elf() 35 for (i = 0; i < ehdr->e_phnum; i++, phdr++) { in kexec_file_add_kernel_elf() 36 if (phdr->p_type != PT_LOAD) in kexec_file_add_kernel_elf() 39 buf.buffer = kernel + phdr->p_offset; in kexec_file_add_kernel_elf() 40 buf.bufsz = phdr->p_filesz; in kexec_file_add_kernel_elf() 42 buf.mem = ALIGN(phdr->p_paddr, phdr->p_align); in kexec_file_add_kernel_elf() 45 buf.memsz = phdr->p_memsz; in kexec_file_add_kernel_elf() 46 data->memsz = ALIGN(data->memsz, phdr->p_align) + buf.memsz; in kexec_file_add_kernel_elf() 48 if (entry - phdr->p_paddr < phdr->p_memsz) { in kexec_file_add_kernel_elf() [all …]
|
D | crash_dump.c | 560 static void loads_init(Elf64_Phdr *phdr, u64 loads_offset) in loads_init() argument 566 phdr->p_filesz = end - start; in loads_init() 567 phdr->p_type = PT_LOAD; in loads_init() 568 phdr->p_offset = start; in loads_init() 569 phdr->p_vaddr = start; in loads_init() 570 phdr->p_paddr = start; in loads_init() 571 phdr->p_memsz = end - start; in loads_init() 572 phdr->p_flags = PF_R | PF_W | PF_X; in loads_init() 573 phdr->p_align = PAGE_SIZE; in loads_init() 574 phdr++; in loads_init() [all …]
|
/kernel/linux/linux-5.10/fs/ |
D | binfmt_elf_fdpic.c | 141 struct elf32_phdr *phdr; in elf_fdpic_fetch_phdrs() local 161 phdr = params->phdrs; in elf_fdpic_fetch_phdrs() 162 for (loop = 0; loop < params->hdr.e_phnum; loop++, phdr++) { in elf_fdpic_fetch_phdrs() 163 if (phdr->p_type != PT_GNU_STACK) in elf_fdpic_fetch_phdrs() 166 if (phdr->p_flags & PF_X) in elf_fdpic_fetch_phdrs() 171 params->stack_size = phdr->p_memsz; in elf_fdpic_fetch_phdrs() 186 struct elf_phdr *phdr; in load_elf_fdpic_binary() local 229 phdr = exec_params.phdrs; in load_elf_fdpic_binary() 231 for (i = 0; i < exec_params.hdr.e_phnum; i++, phdr++) { in load_elf_fdpic_binary() 232 switch (phdr->p_type) { in load_elf_fdpic_binary() [all …]
|
/kernel/linux/linux-5.10/arch/ia64/kernel/ |
D | elfcore.c | 23 struct elf_phdr phdr = gate_phdrs[i]; in elf_core_write_extra_phdrs() local 25 if (phdr.p_type == PT_LOAD) { in elf_core_write_extra_phdrs() 26 phdr.p_memsz = PAGE_ALIGN(phdr.p_memsz); in elf_core_write_extra_phdrs() 27 phdr.p_filesz = phdr.p_memsz; in elf_core_write_extra_phdrs() 29 ofs = phdr.p_offset = offset; in elf_core_write_extra_phdrs() 30 offset += phdr.p_filesz; in elf_core_write_extra_phdrs() 32 phdr.p_offset = ofs; in elf_core_write_extra_phdrs() 35 phdr.p_offset += ofs; in elf_core_write_extra_phdrs() 37 phdr.p_paddr = 0; /* match other core phdrs */ in elf_core_write_extra_phdrs() 38 if (!dump_emit(cprm, &phdr, sizeof(phdr))) in elf_core_write_extra_phdrs()
|
/kernel/linux/linux-5.10/kernel/ |
D | kexec_elf.c | 185 static bool elf_is_phdr_sane(const struct elf_phdr *phdr, size_t buf_len) in elf_is_phdr_sane() argument 188 if (phdr->p_offset + phdr->p_filesz < phdr->p_offset) { in elf_is_phdr_sane() 191 } else if (phdr->p_offset + phdr->p_filesz > buf_len) { in elf_is_phdr_sane() 194 } else if (phdr->p_paddr + phdr->p_memsz < phdr->p_paddr) { in elf_is_phdr_sane() 207 struct elf_phdr *phdr = (struct elf_phdr *) &elf_info->proghdrs[idx]; in elf_read_phdr() local 215 phdr->p_type = elf32_to_cpu(elf_info->ehdr, buf_phdr->p_type); in elf_read_phdr() 216 phdr->p_flags = elf32_to_cpu(elf_info->ehdr, buf_phdr->p_flags); in elf_read_phdr() 220 phdr->p_offset = elf64_to_cpu(ehdr, buf_phdr->p_offset); in elf_read_phdr() 221 phdr->p_paddr = elf64_to_cpu(ehdr, buf_phdr->p_paddr); in elf_read_phdr() 222 phdr->p_vaddr = elf64_to_cpu(ehdr, buf_phdr->p_vaddr); in elf_read_phdr() [all …]
|
D | kexec_file.c | 1237 Elf64_Phdr *phdr; in crash_prepare_elf64_headers() local 1265 phdr = (Elf64_Phdr *)(ehdr + 1); in crash_prepare_elf64_headers() 1281 phdr->p_type = PT_NOTE; in crash_prepare_elf64_headers() 1283 phdr->p_offset = phdr->p_paddr = notes_addr; in crash_prepare_elf64_headers() 1284 phdr->p_filesz = phdr->p_memsz = sizeof(note_buf_t); in crash_prepare_elf64_headers() 1286 phdr++; in crash_prepare_elf64_headers() 1290 phdr->p_type = PT_NOTE; in crash_prepare_elf64_headers() 1291 phdr->p_offset = phdr->p_paddr = paddr_vmcoreinfo_note(); in crash_prepare_elf64_headers() 1292 phdr->p_filesz = phdr->p_memsz = VMCOREINFO_NOTE_SIZE; in crash_prepare_elf64_headers() 1294 phdr++; in crash_prepare_elf64_headers() [all …]
|
/kernel/linux/linux-5.10/tools/testing/selftests/kvm/lib/ |
D | elf.c | 149 Elf64_Phdr phdr; in kvm_vm_elf_load() local 150 test_read(fd, &phdr, sizeof(phdr)); in kvm_vm_elf_load() 153 if (phdr.p_type != PT_LOAD) in kvm_vm_elf_load() 157 TEST_ASSERT(phdr.p_memsz > 0, "Unexpected loadable segment " in kvm_vm_elf_load() 160 n1, (uint64_t) phdr.p_memsz); in kvm_vm_elf_load() 161 vm_vaddr_t seg_vstart = phdr.p_vaddr; in kvm_vm_elf_load() 163 vm_vaddr_t seg_vend = phdr.p_vaddr + phdr.p_memsz - 1; in kvm_vm_elf_load() 183 if (phdr.p_filesz) { in kvm_vm_elf_load() 184 offset_rv = lseek(fd, phdr.p_offset, SEEK_SET); in kvm_vm_elf_load() 185 TEST_ASSERT(offset_rv == phdr.p_offset, in kvm_vm_elf_load() [all …]
|
/kernel/linux/linux-5.10/tools/perf/util/ |
D | symbol-minimal.c | 117 Elf32_Phdr *phdr; in filename__read_build_id() local 137 for (i = 0, phdr = buf; i < ehdr.e_phnum; i++, phdr++) { in filename__read_build_id() 142 phdr->p_type = bswap_32(phdr->p_type); in filename__read_build_id() 143 phdr->p_offset = bswap_32(phdr->p_offset); in filename__read_build_id() 144 phdr->p_filesz = bswap_32(phdr->p_filesz); in filename__read_build_id() 147 if (phdr->p_type != PT_NOTE) in filename__read_build_id() 150 buf_size = phdr->p_filesz; in filename__read_build_id() 151 offset = phdr->p_offset; in filename__read_build_id() 168 Elf64_Phdr *phdr; in filename__read_build_id() local 188 for (i = 0, phdr = buf; i < ehdr.e_phnum; i++, phdr++) { in filename__read_build_id() [all …]
|
/kernel/linux/linux-5.10/arch/x86/um/ |
D | elfcore.c | 26 struct elf_phdr phdr = phdrp[i]; in elf_core_write_extra_phdrs() local 28 if (phdr.p_type == PT_LOAD) { in elf_core_write_extra_phdrs() 29 ofs = phdr.p_offset = offset; in elf_core_write_extra_phdrs() 30 offset += phdr.p_filesz; in elf_core_write_extra_phdrs() 32 phdr.p_offset += ofs; in elf_core_write_extra_phdrs() 34 phdr.p_paddr = 0; /* match other core phdrs */ in elf_core_write_extra_phdrs() 35 if (!dump_emit(cprm, &phdr, sizeof(phdr))) in elf_core_write_extra_phdrs()
|
/kernel/linux/linux-5.10/drivers/remoteproc/ |
D | remoteproc_elf_helpers.h | 69 ELF_GEN_FIELD_GET_SET(phdr, p_paddr, u64) 70 ELF_GEN_FIELD_GET_SET(phdr, p_vaddr, u64) 71 ELF_GEN_FIELD_GET_SET(phdr, p_filesz, u64) 72 ELF_GEN_FIELD_GET_SET(phdr, p_memsz, u64) 73 ELF_GEN_FIELD_GET_SET(phdr, p_type, u32) 74 ELF_GEN_FIELD_GET_SET(phdr, p_offset, u64) 75 ELF_GEN_FIELD_GET_SET(phdr, p_flags, u32) 76 ELF_GEN_FIELD_GET_SET(phdr, p_align, u64) 93 ELF_STRUCT_SIZE(phdr)
|
D | remoteproc_coredump.c | 233 void *phdr; in rproc_coredump() local 285 phdr = data + elf_hdr_get_e_phoff(class, ehdr); in rproc_coredump() 290 memset(phdr, 0, elf_size_of_phdr(class)); in rproc_coredump() 291 elf_phdr_set_p_type(class, phdr, PT_LOAD); in rproc_coredump() 292 elf_phdr_set_p_offset(class, phdr, offset); in rproc_coredump() 293 elf_phdr_set_p_vaddr(class, phdr, segment->da); in rproc_coredump() 294 elf_phdr_set_p_paddr(class, phdr, segment->da); in rproc_coredump() 295 elf_phdr_set_p_filesz(class, phdr, segment->size); in rproc_coredump() 296 elf_phdr_set_p_memsz(class, phdr, segment->size); in rproc_coredump() 297 elf_phdr_set_p_flags(class, phdr, PF_R | PF_W | PF_X); in rproc_coredump() [all …]
|
D | qcom_q6v5_mss.c | 862 static bool q6v5_phdr_valid(const struct elf32_phdr *phdr) in q6v5_phdr_valid() argument 864 if (phdr->p_type != PT_LOAD) in q6v5_phdr_valid() 867 if ((phdr->p_flags & QCOM_MDT_TYPE_MASK) == QCOM_MDT_TYPE_HASH) in q6v5_phdr_valid() 870 if (!phdr->p_memsz) in q6v5_phdr_valid() 1094 const struct elf32_phdr *phdr; in q6v5_mpss_load() local 1137 phdr = &phdrs[i]; in q6v5_mpss_load() 1139 if (!q6v5_phdr_valid(phdr)) in q6v5_mpss_load() 1142 if (phdr->p_flags & QCOM_MDT_RELOCATABLE) in q6v5_mpss_load() 1145 if (phdr->p_paddr < min_addr) in q6v5_mpss_load() 1146 min_addr = phdr->p_paddr; in q6v5_mpss_load() [all …]
|
/kernel/linux/linux-5.10/drivers/media/common/siano/ |
D | smsendian.c | 85 struct sms_msg_hdr *phdr = (struct sms_msg_hdr *)msg; in smsendian_handle_message_header() local 87 phdr->msg_type = le16_to_cpu((__force __le16)phdr->msg_type); in smsendian_handle_message_header() 88 phdr->msg_length = le16_to_cpu((__force __le16)phdr->msg_length); in smsendian_handle_message_header() 89 phdr->msg_flags = le16_to_cpu((__force __le16)phdr->msg_flags); in smsendian_handle_message_header()
|
/kernel/linux/linux-5.10/fs/proc/ |
D | vmcore.c | 834 Elf64_Phdr phdr; in merge_note_headers_elf64() local 857 phdr.p_type = PT_NOTE; in merge_note_headers_elf64() 858 phdr.p_flags = 0; in merge_note_headers_elf64() 861 phdr.p_offset = roundup(note_off, PAGE_SIZE); in merge_note_headers_elf64() 862 phdr.p_vaddr = phdr.p_paddr = 0; in merge_note_headers_elf64() 863 phdr.p_filesz = phdr.p_memsz = phdr_sz; in merge_note_headers_elf64() 864 phdr.p_align = 0; in merge_note_headers_elf64() 868 memcpy(tmp, &phdr, sizeof(phdr)); in merge_note_headers_elf64() 869 tmp += sizeof(phdr); in merge_note_headers_elf64() 884 elfnotes_orig_sz = phdr.p_memsz; in merge_note_headers_elf64() [all …]
|
D | kcore.c | 366 struct elf_phdr *phdrs, *phdr; in read_kcore() local 378 phdr = &phdrs[1]; in read_kcore() 380 phdr->p_type = PT_LOAD; in read_kcore() 381 phdr->p_flags = PF_R | PF_W | PF_X; in read_kcore() 382 phdr->p_offset = kc_vaddr_to_offset(m->addr) + data_offset; in read_kcore() 384 phdr->p_vaddr = (size_t)m->vaddr; in read_kcore() 386 phdr->p_vaddr = (size_t)m->addr; in read_kcore() 388 phdr->p_paddr = __pa(m->addr); in read_kcore() 390 phdr->p_paddr = __pa_symbol(m->addr); in read_kcore() 392 phdr->p_paddr = (elf_addr_t)-1; in read_kcore() [all …]
|
/kernel/linux/linux-5.10/drivers/media/usb/siano/ |
D | smsusb.c | 98 struct sms_msg_hdr *phdr = (struct sms_msg_hdr *)surb->cb->p; in smsusb_onresponse() local 100 smsendian_handle_message_header(phdr); in smsusb_onresponse() 101 if (urb->actual_length >= phdr->msg_length) { in smsusb_onresponse() 102 surb->cb->size = phdr->msg_length; in smsusb_onresponse() 105 (phdr->msg_flags & MSG_HDR_FLAG_SPLIT_MSG)) { in smsusb_onresponse() 109 ((phdr->msg_flags >> 8) & 3); in smsusb_onresponse() 112 if (((int) phdr->msg_length + in smsusb_onresponse() 115 phdr->msg_length, in smsusb_onresponse() 123 memcpy((char *) phdr + surb->cb->offset, in smsusb_onresponse() 124 phdr, sizeof(struct sms_msg_hdr)); in smsusb_onresponse() [all …]
|
/kernel/linux/linux-5.10/arch/powerpc/kernel/ |
D | fadump.c | 757 struct elf_phdr *phdr; in fadump_update_elfcore_header() local 762 phdr = (struct elf_phdr *)bufp; in fadump_update_elfcore_header() 764 if (phdr->p_type == PT_NOTE) { in fadump_update_elfcore_header() 765 phdr->p_paddr = __pa(fw_dump.cpu_notes_buf_vaddr); in fadump_update_elfcore_header() 766 phdr->p_offset = phdr->p_paddr; in fadump_update_elfcore_header() 767 phdr->p_filesz = fw_dump.cpu_notes_buf_size; in fadump_update_elfcore_header() 768 phdr->p_memsz = fw_dump.cpu_notes_buf_size; in fadump_update_elfcore_header() 1063 struct elf_phdr *phdr; in fadump_create_elfcore_headers() local 1078 phdr = (struct elf_phdr *)bufp; in fadump_create_elfcore_headers() 1080 phdr->p_type = PT_NOTE; in fadump_create_elfcore_headers() [all …]
|
/kernel/linux/linux-5.10/net/dsa/ |
D | tag_qca.c | 34 __be16 *phdr; in qca_tag_xmit() local 40 phdr = (__be16 *)(skb->data + 2 * ETH_ALEN); in qca_tag_xmit() 46 *phdr = htons(hdr); in qca_tag_xmit() 57 __be16 *phdr; in qca_tag_rcv() local 66 phdr = (__be16 *)(skb->data - 2); in qca_tag_rcv() 67 hdr = ntohs(*phdr); in qca_tag_rcv()
|
/kernel/linux/linux-5.10/arch/powerpc/platforms/powernv/ |
D | opal-core.c | 307 Elf64_Phdr *phdr; in create_opalcore() local 378 phdr = (Elf64_Phdr *)bufp; in create_opalcore() 380 phdr->p_type = cpu_to_be32(PT_NOTE); in create_opalcore() 381 phdr->p_flags = 0; in create_opalcore() 382 phdr->p_align = 0; in create_opalcore() 383 phdr->p_paddr = phdr->p_vaddr = 0; in create_opalcore() 384 phdr->p_offset = cpu_to_be64(hdr_size); in create_opalcore() 385 phdr->p_filesz = phdr->p_memsz = cpu_to_be64(cpu_notes_size); in create_opalcore() 392 phdr = (Elf64_Phdr *)bufp; in create_opalcore() 394 phdr->p_type = cpu_to_be32(PT_LOAD); in create_opalcore() [all …]
|
/kernel/linux/linux-5.10/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()
|
/kernel/linux/linux-5.10/arch/powerpc/oprofile/cell/ |
D | vma_map.c | 113 Elf32_Phdr phdr; in create_vma_map() local 154 if (copy_from_user(&phdr, phdr_start + i, sizeof(phdr))) in create_vma_map() 157 if (phdr.p_type != PT_LOAD) in create_vma_map() 159 if (phdr.p_flags & (1 << 27)) in create_vma_map() 162 map = vma_map_add(map, phdr.p_vaddr, phdr.p_memsz, in create_vma_map() 163 phdr.p_offset, 0, 0); in create_vma_map()
|
/kernel/linux/linux-5.10/arch/x86/boot/compressed/ |
D | misc.c | 275 Elf64_Phdr *phdrs, *phdr; in parse_elf() local 278 Elf32_Phdr *phdrs, *phdr; in parse_elf() 301 phdr = &phdrs[i]; in parse_elf() 303 switch (phdr->p_type) { in parse_elf() 306 if ((phdr->p_align % 0x200000) != 0) in parse_elf() 311 dest += (phdr->p_paddr - LOAD_PHYSICAL_ADDR); in parse_elf() 313 dest = (void *)(phdr->p_paddr); in parse_elf() 315 memmove(dest, output + phdr->p_offset, phdr->p_filesz); in parse_elf()
|
/kernel/linux/linux-5.10/drivers/media/platform/sti/c8sectpfe/ |
D | c8sectpfe-core.c | 1020 static void load_imem_segment(struct c8sectpfei *fei, Elf32_Phdr *phdr, in load_imem_segment() argument 1024 const u8 *imem_src = fw->data + phdr->p_offset; in load_imem_segment() 1037 phdr->p_paddr, phdr->p_filesz, in load_imem_segment() 1038 dest, phdr->p_memsz + phdr->p_memsz / 3); in load_imem_segment() 1040 for (i = 0; i < phdr->p_filesz; i++) { in load_imem_segment() 1056 static void load_dmem_segment(struct c8sectpfei *fei, Elf32_Phdr *phdr, in load_dmem_segment() argument 1066 seg_num, phdr->p_paddr, phdr->p_filesz, in load_dmem_segment() 1067 dst, phdr->p_memsz); in load_dmem_segment() 1069 memcpy((void __force *)dst, (void *)fw->data + phdr->p_offset, in load_dmem_segment() 1070 phdr->p_filesz); in load_dmem_segment() [all …]
|