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>
149 * If the arch defines ELF_BASE_PLATFORM (in asm/elf.h), the value
223 /* Create the ELF interpreter info */ in create_elf_tables()
367 * total_size is the size of the ELF (interpreter) image. in elf_map()
370 * position with the ELF binary image. (since size < total_size) in elf_map()
372 * the end. (which unmap is needed for ELF images with holes.) in elf_map()
384 pr_info("%d (%s): Uhuuh, elf segment at %px requested but the memory is mapped already\n", in elf_map()
484 * load_elf_phdrs() - load ELF program headers
485 * @elf_ex: ELF header of the binary whose program headers should be loaded
486 * @elf_file: the opened ELF binary file
488 * Loads ELF program headers from the binary file elf_file, which has the ELF
530 * struct arch_elf_state - arch-specific ELF loading state
533 * the loading of an ELF file, throughout the checking of architecture
534 * specific ELF headers & through to the point where the ELF load is
546 * arch_elf_pt_proc() - check a PT_LOPROC..PT_HIPROC ELF program header
547 * @ehdr: The main ELF header
549 * @elf: The open ELF file
550 * @is_interp: True if the phdr is from the interpreter of the ELF being
553 * of loading the ELF.
556 * suitability for the system. Called once per ELF program header in the
557 * range PT_LOPROC to PT_HIPROC, for both the ELF being loaded and its
560 * Return: Zero to proceed with the ELF load, non-zero to fail the ELF load
565 struct file *elf, bool is_interp, in arch_elf_pt_proc() argument
573 * arch_check_elf() - check an ELF executable
574 * @ehdr: The main ELF header
575 * @has_interp: True if the ELF has an interpreter, else false.
576 * @interp_ehdr: The interpreter's ELF header
578 * of loading the ELF.
581 * of the ELF & cause an exec syscall to return an error. This is called after
584 * Return: Zero to proceed with the ELF load, non-zero to fail the ELF load
615 an ELF header */
740 * These are the functions used to load ELF style executables and shared
977 /* Not an ELF interpreter */ in load_elf_binary()
1016 * Allow arch code to reject the ELF at this point, whilst it's in load_elf_binary()
1057 /* Now we do a little grungy work by mmapping the ELF image into in load_elf_binary()
1099 * Calculate the entire size of the ELF mapping in load_elf_binary()
1109 * as it would be larger than the ELF file itself. in load_elf_binary()
1129 * There are effectively two types of ET_DYN ELF in load_elf_binary()
1132 * without PT_INTERP, usually the ELF interpreter in load_elf_binary()
1199 * ELF vaddrs will be correctly offset. The result in load_elf_binary()
1328 * For architectures with ELF randomization, when executing a in load_elf_binary()
1378 * example. In addition, it may also specify (eg, PowerPC64 ELF) in load_elf_binary()
1409 a.out library that is given an ELF header. */
1494 * ELF core dumper
1500 /* An ELF note in memory */
1532 static void fill_elf_header(struct elfhdr *elf, int segs, in fill_elf_header() argument
1535 memset(elf, 0, sizeof(*elf)); in fill_elf_header()
1537 memcpy(elf->e_ident, ELFMAG, SELFMAG); in fill_elf_header()
1538 elf->e_ident[EI_CLASS] = ELF_CLASS; in fill_elf_header()
1539 elf->e_ident[EI_DATA] = ELF_DATA; in fill_elf_header()
1540 elf->e_ident[EI_VERSION] = EV_CURRENT; in fill_elf_header()
1541 elf->e_ident[EI_OSABI] = ELF_OSABI; in fill_elf_header()
1543 elf->e_type = ET_CORE; in fill_elf_header()
1544 elf->e_machine = machine; in fill_elf_header()
1545 elf->e_version = EV_CURRENT; in fill_elf_header()
1546 elf->e_phoff = sizeof(struct elfhdr); in fill_elf_header()
1547 elf->e_flags = flags; in fill_elf_header()
1548 elf->e_ehsize = sizeof(struct elfhdr); in fill_elf_header()
1549 elf->e_phentsize = sizeof(struct elf_phdr); in fill_elf_header()
1550 elf->e_phnum = segs; in fill_elf_header()
1897 static int fill_note_info(struct elfhdr *elf, int phdrs, in fill_note_info() argument
1934 * Initialize the ELF file header. in fill_note_info()
1936 fill_elf_header(elf, phdrs, in fill_note_info()
1941 fill_elf_header(elf, phdrs, ELF_ARCH, ELF_CORE_EFLAGS); in fill_note_info()
2045 static void fill_extnum_info(struct elfhdr *elf, struct elf_shdr *shdr4extnum, in fill_extnum_info() argument
2048 elf->e_shoff = e_shoff; in fill_extnum_info()
2049 elf->e_shentsize = sizeof(*shdr4extnum); in fill_extnum_info()
2050 elf->e_shnum = 1; in fill_extnum_info()
2051 elf->e_shstrndx = SHN_UNDEF; in fill_extnum_info()
2056 shdr4extnum->sh_size = elf->e_shnum; in fill_extnum_info()
2057 shdr4extnum->sh_link = elf->e_shstrndx; in fill_extnum_info()
2072 struct elfhdr elf; in elf_core_dump() local
2081 * The number of segs are recored into ELF header as 16bit value. in elf_core_dump()
2091 * include/linux/elf.h for further information. */ in elf_core_dump()
2098 if (!fill_note_info(&elf, e_phnum, &info, cprm)) in elf_core_dump()
2103 offset += sizeof(elf); /* ELF header */ in elf_core_dump()
2131 fill_extnum_info(&elf, shdr4extnum, e_shoff, segs); in elf_core_dump()
2136 if (!dump_emit(cprm, &elf, sizeof(elf))) in elf_core_dump()
2213 /* Remove the COFF and ELF loaders. */ in exit_elf_binfmt()