Lines Matching defs:phdr
409 static unsigned long total_mapping_size(const struct elf_phdr *phdr, int nr)
417 if (phdr[i].p_type == PT_LOAD) {
418 min_addr = min(min_addr, ELF_PAGESTART(phdr[i].p_vaddr));
419 max_addr = max(max_addr, phdr[i].p_vaddr + phdr[i].p_memsz);
522 * @phdr: The program header to check
524 * @is_interp: True if the phdr is from the interpreter of the ELF being
529 * Inspects the program header phdr to validate its correctness and/or
538 struct elf_phdr *phdr,
665 * Find the end of the file mapping for this phdr, and
766 static int parse_elf_properties(struct file *f, const struct elf_phdr *phdr,
780 if (!IS_ENABLED(CONFIG_ARCH_USE_GNU_PROPERTY) || !phdr)
784 if (WARN_ON_ONCE(phdr->p_type != PT_GNU_PROPERTY))
788 if (phdr->p_filesz > sizeof(note))
791 pos = phdr->p_offset;
792 n = kernel_read(f, ¬e, phdr->p_filesz, &pos);
1511 static void fill_elf_note_phdr(struct elf_phdr *phdr, int sz, loff_t offset)
1513 phdr->p_type = PT_NOTE;
1514 phdr->p_offset = offset;
1515 phdr->p_vaddr = 0;
1516 phdr->p_paddr = 0;
1517 phdr->p_filesz = sz;
1518 phdr->p_memsz = 0;
1519 phdr->p_flags = 0;
1520 phdr->p_align = 4;
2064 /* Write notes phdr entry */
2103 struct elf_phdr phdr;
2105 phdr.p_type = PT_LOAD;
2106 phdr.p_offset = offset;
2107 phdr.p_vaddr = meta->start;
2108 phdr.p_paddr = 0;
2109 phdr.p_filesz = meta->dump_size;
2110 phdr.p_memsz = meta->end - meta->start;
2111 offset += phdr.p_filesz;
2112 phdr.p_flags = 0;
2114 phdr.p_flags |= PF_R;
2116 phdr.p_flags |= PF_W;
2118 phdr.p_flags |= PF_X;
2119 phdr.p_align = ELF_EXEC_PAGESIZE;
2121 if (!dump_emit(cprm, &phdr, sizeof(phdr)))