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>
158 * If the arch defines ELF_BASE_PLATFORM (in asm/elf.h), the value
232 /* Create the ELF interpreter info */ in create_elf_tables()
387 * total_size is the size of the ELF (interpreter) image. in elf_map()
390 * position with the ELF binary image. (since size < total_size) in elf_map()
392 * the end. (which unmap is needed for ELF images with holes.) in elf_map()
404 pr_info("%d (%s): Uhuuh, elf segment at %px requested but the memory is mapped already\n", in elf_map()
513 * load_elf_phdrs() - load ELF program headers
514 * @elf_ex: ELF header of the binary whose program headers should be loaded
515 * @elf_file: the opened ELF binary file
517 * Loads ELF program headers from the binary file elf_file, which has the ELF
559 * struct arch_elf_state - arch-specific ELF loading state
562 * the loading of an ELF file, throughout the checking of architecture
563 * specific ELF headers & through to the point where the ELF load is
575 * arch_elf_pt_proc() - check a PT_LOPROC..PT_HIPROC ELF program header
576 * @ehdr: The main ELF header
578 * @elf: The open ELF file
579 * @is_interp: True if the phdr is from the interpreter of the ELF being
582 * of loading the ELF.
585 * suitability for the system. Called once per ELF program header in the
586 * range PT_LOPROC to PT_HIPROC, for both the ELF being loaded and its
589 * Return: Zero to proceed with the ELF load, non-zero to fail the ELF load
594 struct file *elf, bool is_interp, in arch_elf_pt_proc() argument
602 * arch_check_elf() - check an ELF executable
603 * @ehdr: The main ELF header
604 * @has_interp: True if the ELF has an interpreter, else false.
605 * @interp_ehdr: The interpreter's ELF header
607 * of loading the ELF.
610 * of the ELF & cause an exec syscall to return an error. This is called after
613 * Return: Zero to proceed with the ELF load, non-zero to fail the ELF load
644 an ELF header */
725 * These are the functions used to load ELF style executables and shared
961 /* Not an ELF interpreter */ in load_elf_binary()
1000 * Allow arch code to reject the ELF at this point, whilst it's in load_elf_binary()
1041 /* Now we do a little grungy work by mmapping the ELF image into in load_elf_binary()
1083 * Calculate the entire size of the ELF mapping in load_elf_binary()
1093 * as it would be larger than the ELF file itself. in load_elf_binary()
1113 * There are effectively two types of ET_DYN ELF in load_elf_binary()
1116 * without PT_INTERP, usually the ELF interpreter in load_elf_binary()
1183 * ELF vaddrs will be correctly offset. The result in load_elf_binary()
1314 * For architectures with ELF randomization, when executing a in load_elf_binary()
1369 * example. In addition, it may also specify (eg, PowerPC64 ELF) in load_elf_binary()
1400 * ELF core dumper
1406 /* An ELF note in memory */
1438 static void fill_elf_header(struct elfhdr *elf, int segs, in fill_elf_header() argument
1441 memset(elf, 0, sizeof(*elf)); in fill_elf_header()
1443 memcpy(elf->e_ident, ELFMAG, SELFMAG); in fill_elf_header()
1444 elf->e_ident[EI_CLASS] = ELF_CLASS; in fill_elf_header()
1445 elf->e_ident[EI_DATA] = ELF_DATA; in fill_elf_header()
1446 elf->e_ident[EI_VERSION] = EV_CURRENT; in fill_elf_header()
1447 elf->e_ident[EI_OSABI] = ELF_OSABI; in fill_elf_header()
1449 elf->e_type = ET_CORE; in fill_elf_header()
1450 elf->e_machine = machine; in fill_elf_header()
1451 elf->e_version = EV_CURRENT; in fill_elf_header()
1452 elf->e_phoff = sizeof(struct elfhdr); in fill_elf_header()
1453 elf->e_flags = flags; in fill_elf_header()
1454 elf->e_ehsize = sizeof(struct elfhdr); in fill_elf_header()
1455 elf->e_phentsize = sizeof(struct elf_phdr); in fill_elf_header()
1456 elf->e_phnum = segs; in fill_elf_header()
1816 static int fill_note_info(struct elfhdr *elf, int phdrs, in fill_note_info() argument
1864 * Override ELF e_flags with value taken from process, in fill_note_info()
1870 * Initialize the ELF file header. in fill_note_info()
1872 fill_elf_header(elf, phdrs, machine, flags); in fill_note_info()
1971 static void fill_extnum_info(struct elfhdr *elf, struct elf_shdr *shdr4extnum, in fill_extnum_info() argument
1974 elf->e_shoff = e_shoff; in fill_extnum_info()
1975 elf->e_shentsize = sizeof(*shdr4extnum); in fill_extnum_info()
1976 elf->e_shnum = 1; in fill_extnum_info()
1977 elf->e_shstrndx = SHN_UNDEF; in fill_extnum_info()
1982 shdr4extnum->sh_size = elf->e_shnum; in fill_extnum_info()
1983 shdr4extnum->sh_link = elf->e_shstrndx; in fill_extnum_info()
1998 struct elfhdr elf; in elf_core_dump() local
2007 * The number of segs are recored into ELF header as 16bit value. in elf_core_dump()
2017 * include/linux/elf.h for further information. */ in elf_core_dump()
2024 if (!fill_note_info(&elf, e_phnum, &info, cprm)) in elf_core_dump()
2029 offset += sizeof(elf); /* ELF header */ in elf_core_dump()
2057 fill_extnum_info(&elf, shdr4extnum, e_shoff, segs); in elf_core_dump()
2062 if (!dump_emit(cprm, &elf, sizeof(elf))) in elf_core_dump()
2139 /* Remove the COFF and ELF loaders. */ in exit_elf_binfmt()