Lines Matching full:elf

5  * These are the functions used to load ELF format executables as used
36 #include <linux/elf.h>
37 #include <linux/elf-randomize.h>
157 * If the arch defines ELF_BASE_PLATFORM (in asm/elf.h), the value
231 /* Create the ELF interpreter info */ in create_elf_tables()
386 * total_size is the size of the ELF (interpreter) image. in elf_map()
389 * position with the ELF binary image. (since size < total_size) in elf_map()
391 * the end. (which unmap is needed for ELF images with holes.) in elf_map()
403 pr_info("%d (%s): Uhuuh, elf segment at %px requested but the memory is mapped already\n", in elf_map()
512 * load_elf_phdrs() - load ELF program headers
513 * @elf_ex: ELF header of the binary whose program headers should be loaded
514 * @elf_file: the opened ELF binary file
516 * Loads ELF program headers from the binary file elf_file, which has the ELF
558 * struct arch_elf_state - arch-specific ELF loading state
561 * the loading of an ELF file, throughout the checking of architecture
562 * specific ELF headers & through to the point where the ELF load is
574 * arch_elf_pt_proc() - check a PT_LOPROC..PT_HIPROC ELF program header
575 * @ehdr: The main ELF header
577 * @elf: The open ELF file
578 * @is_interp: True if the phdr is from the interpreter of the ELF being
581 * of loading the ELF.
584 * suitability for the system. Called once per ELF program header in the
585 * range PT_LOPROC to PT_HIPROC, for both the ELF being loaded and its
588 * Return: Zero to proceed with the ELF load, non-zero to fail the ELF load
593 struct file *elf, bool is_interp, in arch_elf_pt_proc() argument
601 * arch_check_elf() - check an ELF executable
602 * @ehdr: The main ELF header
603 * @has_interp: True if the ELF has an interpreter, else false.
604 * @interp_ehdr: The interpreter's ELF header
606 * of loading the ELF.
609 * of the ELF & cause an exec syscall to return an error. This is called after
612 * Return: Zero to proceed with the ELF load, non-zero to fail the ELF load
643 an ELF header */
724 * These are the functions used to load ELF style executables and shared
960 /* Not an ELF interpreter */ in load_elf_binary()
999 * Allow arch code to reject the ELF at this point, whilst it's in load_elf_binary()
1040 /* Now we do a little grungy work by mmapping the ELF image into in load_elf_binary()
1082 * Calculate the entire size of the ELF mapping in load_elf_binary()
1092 * as it would be larger than the ELF file itself. in load_elf_binary()
1112 * There are effectively two types of ET_DYN ELF in load_elf_binary()
1115 * without PT_INTERP, usually the ELF interpreter in load_elf_binary()
1182 * ELF vaddrs will be correctly offset. The result in load_elf_binary()
1313 * For architectures with ELF randomization, when executing a in load_elf_binary()
1368 * example. In addition, it may also specify (eg, PowerPC64 ELF) in load_elf_binary()
1399 * ELF core dumper
1405 /* An ELF note in memory */
1437 static void fill_elf_header(struct elfhdr *elf, int segs, in fill_elf_header() argument
1440 memset(elf, 0, sizeof(*elf)); in fill_elf_header()
1442 memcpy(elf->e_ident, ELFMAG, SELFMAG); in fill_elf_header()
1443 elf->e_ident[EI_CLASS] = ELF_CLASS; in fill_elf_header()
1444 elf->e_ident[EI_DATA] = ELF_DATA; in fill_elf_header()
1445 elf->e_ident[EI_VERSION] = EV_CURRENT; in fill_elf_header()
1446 elf->e_ident[EI_OSABI] = ELF_OSABI; in fill_elf_header()
1448 elf->e_type = ET_CORE; in fill_elf_header()
1449 elf->e_machine = machine; in fill_elf_header()
1450 elf->e_version = EV_CURRENT; in fill_elf_header()
1451 elf->e_phoff = sizeof(struct elfhdr); in fill_elf_header()
1452 elf->e_flags = flags; in fill_elf_header()
1453 elf->e_ehsize = sizeof(struct elfhdr); in fill_elf_header()
1454 elf->e_phentsize = sizeof(struct elf_phdr); in fill_elf_header()
1455 elf->e_phnum = segs; in fill_elf_header()
1815 static int fill_note_info(struct elfhdr *elf, int phdrs, in fill_note_info() argument
1863 * Override ELF e_flags with value taken from process, in fill_note_info()
1869 * Initialize the ELF file header. in fill_note_info()
1871 fill_elf_header(elf, phdrs, machine, flags); in fill_note_info()
1972 static void fill_extnum_info(struct elfhdr *elf, struct elf_shdr *shdr4extnum, in fill_extnum_info() argument
1975 elf->e_shoff = e_shoff; in fill_extnum_info()
1976 elf->e_shentsize = sizeof(*shdr4extnum); in fill_extnum_info()
1977 elf->e_shnum = 1; in fill_extnum_info()
1978 elf->e_shstrndx = SHN_UNDEF; in fill_extnum_info()
1983 shdr4extnum->sh_size = elf->e_shnum; in fill_extnum_info()
1984 shdr4extnum->sh_link = elf->e_shstrndx; in fill_extnum_info()
1999 struct elfhdr elf; in elf_core_dump() local
2008 * The number of segs are recored into ELF header as 16bit value. in elf_core_dump()
2018 * include/linux/elf.h for further information. */ in elf_core_dump()
2025 if (!fill_note_info(&elf, e_phnum, &info, cprm)) in elf_core_dump()
2030 offset += sizeof(elf); /* ELF header */ in elf_core_dump()
2058 fill_extnum_info(&elf, shdr4extnum, e_shoff, segs); in elf_core_dump()
2063 if (!dump_emit(cprm, &elf, sizeof(elf))) in elf_core_dump()
2140 /* Remove the COFF and ELF loaders. */ in exit_elf_binfmt()