/linux-6.3-rc2/drivers/soc/qcom/ |
A D | mdt_loader.c | 99 if (phdr->p_paddr + phdr->p_memsz > max_addr) in qcom_mdt_get_size() 100 max_addr = ALIGN(phdr->p_paddr + phdr->p_memsz, SZ_4K); in qcom_mdt_get_size() 230 if (phdr->p_paddr + phdr->p_memsz > max_addr) in qcom_mdt_pas_init() 231 max_addr = ALIGN(phdr->p_paddr + phdr->p_memsz, SZ_4K); in qcom_mdt_pas_init() 323 if (phdr->p_filesz > phdr->p_memsz) { in __qcom_mdt_load() 333 if (phdr->p_filesz && phdr->p_offset < fw->size && in __qcom_mdt_load() 334 phdr->p_offset + phdr->p_filesz <= fw->size) { in __qcom_mdt_load() 336 if (phdr->p_offset + phdr->p_filesz > fw->size) { in __qcom_mdt_load() 343 memcpy(ptr, fw->data + phdr->p_offset, phdr->p_filesz); in __qcom_mdt_load() 351 if (phdr->p_memsz > phdr->p_filesz) in __qcom_mdt_load() [all …]
|
A D | smem.c | 293 void *p = phdr; in phdr_to_last_uncached_entry() 302 void *p = phdr; in phdr_to_first_cached_entry() 311 void *p = phdr; in phdr_to_last_cached_entry() 319 void *p = phdr; in phdr_to_first_uncached_entry() 321 return p + sizeof(*phdr); in phdr_to_first_uncached_entry() 373 p_end = (void *)phdr + part->size; in qcom_smem_alloc_private() 418 le16_to_cpu(phdr->host0), le16_to_cpu(phdr->host1)); in qcom_smem_alloc_private() 556 p_end = (void *)phdr + part->size; in qcom_smem_get_private() 629 le16_to_cpu(phdr->host0), le16_to_cpu(phdr->host1)); in qcom_smem_get_private() 698 phdr = part->virt_base; in qcom_smem_get_free_space() [all …]
|
/linux-6.3-rc2/arch/s390/kernel/ |
A 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() 36 if (phdr->p_type != PT_LOAD) 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() 48 if (entry - phdr->p_paddr < phdr->p_memsz) { in kexec_file_add_kernel_elf() 72 const Elf_Phdr *phdr; in s390_elf_load() local 95 if (phdr->p_type == PT_INTERP) in s390_elf_load() 98 if (phdr->p_offset > kernel_len) in s390_elf_load() [all …]
|
A D | crash_dump.c | 507 phdr->p_filesz = end - start; in loads_init() 508 phdr->p_type = PT_LOAD; in loads_init() 509 phdr->p_offset = start; in loads_init() 510 phdr->p_vaddr = start; in loads_init() 511 phdr->p_paddr = start; in loads_init() 512 phdr->p_memsz = end - start; in loads_init() 514 phdr->p_align = PAGE_SIZE; in loads_init() 515 phdr++; in loads_init() 536 memset(phdr, 0, sizeof(*phdr)); in notes_init() 537 phdr->p_type = PT_NOTE; in notes_init() [all …]
|
/linux-6.3-rc2/fs/ |
A D | binfmt_elf_fdpic.c | 161 phdr = params->phdrs; in elf_fdpic_fetch_phdrs() 817 phdr->p_offset + phdr->p_filesz < stop) in elf_fdpic_map_file() 823 phdr->p_vaddr + phdr->p_filesz <= in elf_fdpic_map_file() 844 phdr->p_vaddr + phdr->p_memsz <= in elf_fdpic_map_file() 947 if (top < phdr->p_vaddr + phdr->p_memsz) in elf_fdpic_map_file_constdisp_on_uclinux() 948 top = phdr->p_vaddr + phdr->p_memsz; in elf_fdpic_map_file_constdisp_on_uclinux() 980 if (phdr->p_filesz < phdr->p_memsz) { in elf_fdpic_map_file_constdisp_on_uclinux() 982 phdr->p_memsz - phdr->p_filesz)) in elf_fdpic_map_file_constdisp_on_uclinux() 1122 excess = phdr->p_memsz - phdr->p_filesz; in elf_fdpic_map_file_by_direct_mmap() 1267 phdr->p_vaddr = 0; in fill_elf_note_phdr() [all …]
|
/linux-6.3-rc2/kernel/ |
A D | kexec_elf.c | 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() 401 const struct elf_phdr *phdr; in kexec_elf_load() local 403 phdr = &elf_info->proghdrs[i]; in kexec_elf_load() 404 if (phdr->p_type != PT_LOAD) in kexec_elf_load() 407 size = phdr->p_filesz; in kexec_elf_load() 408 if (size > phdr->p_memsz) in kexec_elf_load() 409 size = phdr->p_memsz; in kexec_elf_load() 413 kbuf->memsz = phdr->p_memsz; in kexec_elf_load() [all …]
|
A D | kexec_file.c | 1274 phdr->p_offset = phdr->p_paddr = notes_addr; in crash_prepare_elf64_headers() 1275 phdr->p_filesz = phdr->p_memsz = sizeof(note_buf_t); in crash_prepare_elf64_headers() 1277 phdr++; in crash_prepare_elf64_headers() 1283 phdr->p_filesz = phdr->p_memsz = VMCOREINFO_NOTE_SIZE; in crash_prepare_elf64_headers() 1285 phdr++; in crash_prepare_elf64_headers() 1292 phdr->p_filesz = phdr->p_memsz = _end - _text; in crash_prepare_elf64_headers() 1293 phdr->p_offset = phdr->p_paddr = __pa_symbol(_text); in crash_prepare_elf64_headers() 1295 phdr++; in crash_prepare_elf64_headers() 1309 phdr->p_filesz = phdr->p_memsz = mend - mstart + 1; in crash_prepare_elf64_headers() 1313 phdr, phdr->p_vaddr, phdr->p_paddr, phdr->p_filesz, in crash_prepare_elf64_headers() [all …]
|
/linux-6.3-rc2/arch/ia64/kernel/ |
A 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()
|
/linux-6.3-rc2/tools/testing/selftests/kvm/lib/ |
A D | elf.c | 148 Elf64_Phdr phdr; in kvm_vm_elf_load() local 149 test_read(fd, &phdr, sizeof(phdr)); in kvm_vm_elf_load() 152 if (phdr.p_type != PT_LOAD) in kvm_vm_elf_load() 159 n1, (uint64_t) phdr.p_memsz); in kvm_vm_elf_load() 161 vm_vaddr_t seg_vend = phdr.p_vaddr + phdr.p_memsz - 1; in kvm_vm_elf_load() 181 if (phdr.p_filesz) { in kvm_vm_elf_load() 182 offset_rv = lseek(fd, phdr.p_offset, SEEK_SET); in kvm_vm_elf_load() 183 TEST_ASSERT(offset_rv == phdr.p_offset, in kvm_vm_elf_load() 189 (intmax_t) phdr.p_offset); in kvm_vm_elf_load() 190 test_read(fd, addr_gva2hva(vm, phdr.p_vaddr), in kvm_vm_elf_load() [all …]
|
/linux-6.3-rc2/arch/arm64/kernel/ |
A D | elfcore.c | 96 struct elf_phdr phdr; in elf_core_write_extra_phdrs() local 98 phdr.p_type = PT_AARCH64_MEMTAG_MTE; in elf_core_write_extra_phdrs() 99 phdr.p_offset = offset; in elf_core_write_extra_phdrs() 100 phdr.p_vaddr = m->start; in elf_core_write_extra_phdrs() 101 phdr.p_paddr = 0; in elf_core_write_extra_phdrs() 102 phdr.p_filesz = mte_vma_tag_dump_size(m); in elf_core_write_extra_phdrs() 103 phdr.p_memsz = m->end - m->start; in elf_core_write_extra_phdrs() 104 offset += phdr.p_filesz; in elf_core_write_extra_phdrs() 105 phdr.p_flags = 0; in elf_core_write_extra_phdrs() 106 phdr.p_align = 0; in elf_core_write_extra_phdrs() [all …]
|
/linux-6.3-rc2/tools/perf/util/ |
A 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() 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() 193 phdr->p_type = bswap_32(phdr->p_type); in filename__read_build_id() 194 phdr->p_offset = bswap_64(phdr->p_offset); in filename__read_build_id() [all …]
|
/linux-6.3-rc2/arch/x86/um/ |
A 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()
|
/linux-6.3-rc2/fs/proc/ |
A D | vmcore.c | 878 phdr.p_vaddr = phdr.p_paddr = 0; in merge_note_headers_elf64() 879 phdr.p_filesz = phdr.p_memsz = phdr_sz; in merge_note_headers_elf64() 884 memcpy(tmp, &phdr, sizeof(phdr)); in merge_note_headers_elf64() 1069 phdr.p_vaddr = phdr.p_paddr = 0; in merge_note_headers_elf32() 1070 phdr.p_filesz = phdr.p_memsz = phdr_sz; in merge_note_headers_elf32() 1075 memcpy(tmp, &phdr, sizeof(phdr)); in merge_note_headers_elf32() 1406 phdr->p_filesz = phdr->p_memsz; in vmcoredd_update_program_headers() 1411 end = roundup(phdr->p_offset + phdr->p_memsz, in vmcoredd_update_program_headers() 1414 phdr->p_offset = vmcore_off + (phdr->p_offset - start); in vmcoredd_update_program_headers() 1426 phdr->p_filesz = phdr->p_memsz; in vmcoredd_update_program_headers() [all …]
|
/linux-6.3-rc2/drivers/media/common/siano/ |
A 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()
|
/linux-6.3-rc2/lib/ |
A D | buildid.c | 73 Elf32_Phdr *phdr; in get_build_id_32() local 81 phdr = (Elf32_Phdr *)(page_addr + sizeof(Elf32_Ehdr)); in get_build_id_32() 84 if (phdr[i].p_type == PT_NOTE && in get_build_id_32() 86 page_addr + phdr[i].p_offset, in get_build_id_32() 87 phdr[i].p_filesz)) in get_build_id_32() 98 Elf64_Phdr *phdr; in get_build_id_64() local 106 phdr = (Elf64_Phdr *)(page_addr + sizeof(Elf64_Ehdr)); in get_build_id_64() 109 if (phdr[i].p_type == PT_NOTE && in get_build_id_64() 111 page_addr + phdr[i].p_offset, in get_build_id_64() 112 phdr[i].p_filesz)) in get_build_id_64()
|
/linux-6.3-rc2/drivers/media/usb/siano/ |
A D | smsusb.c | 102 surb->cb->size = phdr->msg_length; 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() 130 phdr->msg_type, phdr->msg_length); in smsusb_onresponse() 210 struct sms_msg_hdr *phdr; in smsusb_sendrequest() local 219 if (!phdr) in smsusb_sendrequest() 223 smscore_translate_msg(phdr->msg_type), phdr->msg_type, in smsusb_sendrequest() 224 phdr->msg_length); in smsusb_sendrequest() 229 phdr, size, &dummy, 1000); in smsusb_sendrequest() [all …]
|
/linux-6.3-rc2/drivers/remoteproc/ |
A D | remoteproc_elf_helpers.h | 70 ELF_GEN_FIELD_GET_SET(phdr, p_paddr, u64) in ELF_GEN_FIELD_GET_SET() 71 ELF_GEN_FIELD_GET_SET(phdr, p_vaddr, u64) in ELF_GEN_FIELD_GET_SET() 72 ELF_GEN_FIELD_GET_SET(phdr, p_filesz, u64) in ELF_GEN_FIELD_GET_SET() 73 ELF_GEN_FIELD_GET_SET(phdr, p_memsz, u64) in ELF_GEN_FIELD_GET_SET() 74 ELF_GEN_FIELD_GET_SET(phdr, p_type, u32) in ELF_GEN_FIELD_GET_SET() 75 ELF_GEN_FIELD_GET_SET(phdr, p_offset, u64) in ELF_GEN_FIELD_GET_SET() 76 ELF_GEN_FIELD_GET_SET(phdr, p_flags, u32) in ELF_GEN_FIELD_GET_SET() 77 ELF_GEN_FIELD_GET_SET(phdr, p_align, u64) in ELF_GEN_FIELD_GET_SET() 97 ELF_STRUCT_SIZE(phdr)
|
A D | remoteproc_coredump.c | 237 void *phdr; in rproc_coredump() local 289 phdr = data + elf_hdr_get_e_phoff(class, ehdr); in rproc_coredump() 294 memset(phdr, 0, elf_size_of_phdr(class)); in rproc_coredump() 295 elf_phdr_set_p_type(class, phdr, PT_LOAD); in rproc_coredump() 296 elf_phdr_set_p_offset(class, phdr, offset); in rproc_coredump() 297 elf_phdr_set_p_vaddr(class, phdr, segment->da); in rproc_coredump() 298 elf_phdr_set_p_paddr(class, phdr, segment->da); in rproc_coredump() 300 elf_phdr_set_p_memsz(class, phdr, segment->size); in rproc_coredump() 302 elf_phdr_set_p_align(class, phdr, 0); in rproc_coredump() 308 offset += elf_phdr_get_p_filesz(class, phdr); in rproc_coredump() [all …]
|
/linux-6.3-rc2/arch/powerpc/kernel/ |
A D | fadump.c | 778 phdr->p_offset = phdr->p_paddr; in fadump_update_elfcore_header() 1096 phdr->p_flags = 0; in fadump_create_elfcore_headers() 1097 phdr->p_vaddr = 0; in fadump_create_elfcore_headers() 1098 phdr->p_align = 0; in fadump_create_elfcore_headers() 1101 phdr->p_paddr = 0; in fadump_create_elfcore_headers() 1103 phdr->p_memsz = 0; in fadump_create_elfcore_headers() 1111 phdr->p_flags = 0; in fadump_create_elfcore_headers() 1112 phdr->p_vaddr = 0; in fadump_create_elfcore_headers() 1113 phdr->p_align = 0; in fadump_create_elfcore_headers() 1116 phdr->p_offset = phdr->p_paddr; in fadump_create_elfcore_headers() [all …]
|
/linux-6.3-rc2/arch/riscv/kernel/ |
A D | elf_kexec.c | 44 const struct elf_phdr *phdr; in riscv_kexec_elf_load() local 49 phdr = &elf_info->proghdrs[i]; in riscv_kexec_elf_load() 50 if (phdr->p_type != PT_LOAD) in riscv_kexec_elf_load() 53 size = phdr->p_filesz; in riscv_kexec_elf_load() 54 if (size > phdr->p_memsz) in riscv_kexec_elf_load() 55 size = phdr->p_memsz; in riscv_kexec_elf_load() 59 kbuf.buf_align = phdr->p_align; in riscv_kexec_elf_load() 61 kbuf.memsz = phdr->p_memsz; in riscv_kexec_elf_load() 82 const struct elf_phdr *phdr; in elf_find_pbase() local 87 phdr = &elf_info->proghdrs[i]; in elf_find_pbase() [all …]
|
/linux-6.3-rc2/tools/testing/selftests/sgx/ |
A D | load.c | 232 Elf64_Phdr *phdr = &phdr_tbl[i]; in encl_load() local 234 if (phdr->p_type == PT_LOAD) in encl_load() 244 Elf64_Phdr *phdr = &phdr_tbl[i]; in encl_load() local 245 unsigned int flags = phdr->p_flags; in encl_load() 247 if (phdr->p_type != PT_LOAD) in encl_load() 255 phdr->p_flags); in encl_load() 262 phdr->p_flags); in encl_load() 267 src_offset = phdr->p_offset & PAGE_MASK; in encl_load() 273 seg->prot = (phdr->p_flags & PF_R) ? PROT_READ : 0; in encl_load() 274 seg->prot |= (phdr->p_flags & PF_W) ? PROT_WRITE : 0; in encl_load() [all …]
|
/linux-6.3-rc2/arch/powerpc/platforms/powernv/ |
A D | opal-core.c | 307 Elf64_Phdr *phdr; in create_opalcore() local 380 phdr = (Elf64_Phdr *)bufp; in create_opalcore() 382 phdr->p_type = cpu_to_be32(PT_NOTE); in create_opalcore() 383 phdr->p_flags = 0; in create_opalcore() 384 phdr->p_align = 0; in create_opalcore() 385 phdr->p_paddr = phdr->p_vaddr = 0; in create_opalcore() 387 phdr->p_filesz = phdr->p_memsz = cpu_to_be64(cpu_notes_size); in create_opalcore() 394 phdr = (Elf64_Phdr *)bufp; in create_opalcore() 398 phdr->p_align = 0; in create_opalcore() 408 phdr->p_paddr = cpu_to_be64(paddr); in create_opalcore() [all …]
|
/linux-6.3-rc2/net/dsa/ |
A D | tag_qca.c | 18 __be16 *phdr; in qca_tag_xmit() local 24 phdr = dsa_etype_header_pos_tx(skb); in qca_tag_xmit() 31 *phdr = htons(hdr); in qca_tag_xmit() 42 __be16 *phdr; in qca_tag_rcv() local 53 phdr = dsa_etype_header_pos_rx(skb); in qca_tag_rcv() 54 hdr = ntohs(*phdr); in qca_tag_rcv()
|
/linux-6.3-rc2/tools/testing/selftests/powerpc/ptrace/ |
A 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()
|
/linux-6.3-rc2/arch/x86/boot/compressed/ |
A D | misc.c | 284 Elf64_Phdr *phdrs, *phdr; in parse_elf() local 287 Elf32_Phdr *phdrs, *phdr; in parse_elf() 308 phdr = &phdrs[i]; in parse_elf() 310 switch (phdr->p_type) { in parse_elf() 313 if ((phdr->p_align % 0x200000) != 0) in parse_elf() 318 dest += (phdr->p_paddr - LOAD_PHYSICAL_ADDR); in parse_elf() 320 dest = (void *)(phdr->p_paddr); in parse_elf() 322 memmove(dest, output + phdr->p_offset, phdr->p_filesz); in parse_elf()
|