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>
168 * If the arch defines ELF_BASE_PLATFORM (in asm/elf.h), the value
242 /* 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()
458 * load_elf_phdrs() - load ELF program headers
459 * @elf_ex: ELF header of the binary whose program headers should be loaded
460 * @elf_file: the opened ELF binary file
462 * Loads ELF program headers from the binary file elf_file, which has the ELF
504 * struct arch_elf_state - arch-specific ELF loading state
507 * the loading of an ELF file, throughout the checking of architecture
508 * specific ELF headers & through to the point where the ELF load is
520 * arch_elf_pt_proc() - check a PT_LOPROC..PT_HIPROC ELF program header
521 * @ehdr: The main ELF header
523 * @elf: The open ELF file
524 * @is_interp: True if the phdr is from the interpreter of the ELF being
527 * of loading the ELF.
530 * suitability for the system. Called once per ELF program header in the
531 * range PT_LOPROC to PT_HIPROC, for both the ELF being loaded and its
534 * Return: Zero to proceed with the ELF load, non-zero to fail the ELF load
539 struct file *elf, bool is_interp, in arch_elf_pt_proc() argument
547 * arch_check_elf() - check an ELF executable
548 * @ehdr: The main ELF header
549 * @has_interp: True if the ELF has an interpreter, else false.
550 * @interp_ehdr: The interpreter's ELF header
552 * of loading the ELF.
555 * of the ELF & cause an exec syscall to return an error. This is called after
558 * Return: Zero to proceed with the ELF load, non-zero to fail the ELF load
589 an ELF header */
714 * These are the functions used to load ELF style executables and shared
951 /* Not an ELF interpreter */ in load_elf_binary()
990 * Allow arch code to reject the ELF at this point, whilst it's in load_elf_binary()
1032 /* Now we do a little grungy work by mmapping the ELF image into in load_elf_binary()
1063 * This bss-zeroing can fail if the ELF in load_elf_binary()
1102 * _are_ the ELF interpreter). The loaders must in load_elf_binary()
1135 * ELF vaddrs will be correctly offset. The result in load_elf_binary()
1141 * Calculate the entire size of the ELF mapping in load_elf_binary()
1151 * as it would be larger than the ELF file itself. in load_elf_binary()
1306 * For architectures with ELF randomization, when executing in load_elf_binary()
1307 * a loader directly (i.e. no interpreter listed in ELF in load_elf_binary()
1337 * example. In addition, it may also specify (eg, PowerPC64 ELF) in load_elf_binary()
1368 a.out library that is given an ELF header. */
1453 * ELF core dumper
1459 /* An ELF note in memory */
1491 static void fill_elf_header(struct elfhdr *elf, int segs, in fill_elf_header() argument
1494 memset(elf, 0, sizeof(*elf)); in fill_elf_header()
1496 memcpy(elf->e_ident, ELFMAG, SELFMAG); in fill_elf_header()
1497 elf->e_ident[EI_CLASS] = ELF_CLASS; in fill_elf_header()
1498 elf->e_ident[EI_DATA] = ELF_DATA; in fill_elf_header()
1499 elf->e_ident[EI_VERSION] = EV_CURRENT; in fill_elf_header()
1500 elf->e_ident[EI_OSABI] = ELF_OSABI; in fill_elf_header()
1502 elf->e_type = ET_CORE; in fill_elf_header()
1503 elf->e_machine = machine; in fill_elf_header()
1504 elf->e_version = EV_CURRENT; in fill_elf_header()
1505 elf->e_phoff = sizeof(struct elfhdr); in fill_elf_header()
1506 elf->e_flags = flags; in fill_elf_header()
1507 elf->e_ehsize = sizeof(struct elfhdr); in fill_elf_header()
1508 elf->e_phentsize = sizeof(struct elf_phdr); in fill_elf_header()
1509 elf->e_phnum = segs; in fill_elf_header()
1856 static int fill_note_info(struct elfhdr *elf, int phdrs, in fill_note_info() argument
1893 * Initialize the ELF file header. in fill_note_info()
1895 fill_elf_header(elf, phdrs, in fill_note_info()
1900 fill_elf_header(elf, phdrs, ELF_ARCH, ELF_CORE_EFLAGS); in fill_note_info()
2004 static void fill_extnum_info(struct elfhdr *elf, struct elf_shdr *shdr4extnum, in fill_extnum_info() argument
2007 elf->e_shoff = e_shoff; in fill_extnum_info()
2008 elf->e_shentsize = sizeof(*shdr4extnum); in fill_extnum_info()
2009 elf->e_shnum = 1; in fill_extnum_info()
2010 elf->e_shstrndx = SHN_UNDEF; in fill_extnum_info()
2015 shdr4extnum->sh_size = elf->e_shnum; in fill_extnum_info()
2016 shdr4extnum->sh_link = elf->e_shstrndx; in fill_extnum_info()
2031 struct elfhdr elf; in elf_core_dump() local
2040 * The number of segs are recored into ELF header as 16bit value. in elf_core_dump()
2050 * include/linux/elf.h for further information. */ in elf_core_dump()
2057 if (!fill_note_info(&elf, e_phnum, &info, cprm)) in elf_core_dump()
2062 offset += sizeof(elf); /* ELF header */ in elf_core_dump()
2090 fill_extnum_info(&elf, shdr4extnum, e_shoff, segs); in elf_core_dump()
2095 if (!dump_emit(cprm, &elf, sizeof(elf))) in elf_core_dump()
2172 /* Remove the COFF and ELF loaders. */ in exit_elf_binfmt()