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()
372 * total_size is the size of the ELF (interpreter) image. in elf_map()
375 * position with the ELF binary image. (since size < total_size) in elf_map()
377 * the end. (which unmap is needed for ELF images with holes.) in elf_map()
389 pr_info("%d (%s): Uhuuh, elf segment at %px requested but the memory is mapped already\n", in elf_map()
498 * load_elf_phdrs() - load ELF program headers
499 * @elf_ex: ELF header of the binary whose program headers should be loaded
500 * @elf_file: the opened ELF binary file
502 * Loads ELF program headers from the binary file elf_file, which has the ELF
544 * struct arch_elf_state - arch-specific ELF loading state
547 * the loading of an ELF file, throughout the checking of architecture
548 * specific ELF headers & through to the point where the ELF load is
560 * arch_elf_pt_proc() - check a PT_LOPROC..PT_HIPROC ELF program header
561 * @ehdr: The main ELF header
563 * @elf: The open ELF file
564 * @is_interp: True if the phdr is from the interpreter of the ELF being
567 * of loading the ELF.
570 * suitability for the system. Called once per ELF program header in the
571 * range PT_LOPROC to PT_HIPROC, for both the ELF being loaded and its
574 * Return: Zero to proceed with the ELF load, non-zero to fail the ELF load
579 struct file *elf, bool is_interp, in arch_elf_pt_proc() argument
587 * arch_check_elf() - check an ELF executable
588 * @ehdr: The main ELF header
589 * @has_interp: True if the ELF has an interpreter, else false.
590 * @interp_ehdr: The interpreter's ELF header
592 * of loading the ELF.
595 * of the ELF & cause an exec syscall to return an error. This is called after
598 * Return: Zero to proceed with the ELF load, non-zero to fail the ELF load
629 an ELF header */
710 * These are the functions used to load ELF style executables and shared
946 /* Not an ELF interpreter */ in load_elf_binary()
985 * Allow arch code to reject the ELF at this point, whilst it's in load_elf_binary()
1026 /* Now we do a little grungy work by mmapping the ELF image into in load_elf_binary()
1068 * Calculate the entire size of the ELF mapping in load_elf_binary()
1078 * as it would be larger than the ELF file itself. in load_elf_binary()
1099 * _are_ the ELF interpreter). The loaders must in load_elf_binary()
1161 * ELF vaddrs will be correctly offset. The result in load_elf_binary()
1290 * For architectures with ELF randomization, when executing in load_elf_binary()
1291 * a loader directly (i.e. no interpreter listed in ELF in load_elf_binary()
1329 * example. In addition, it may also specify (eg, PowerPC64 ELF) in load_elf_binary()
1359 a.out library that is given an ELF header. */
1428 * ELF core dumper
1434 /* An ELF note in memory */
1466 static void fill_elf_header(struct elfhdr *elf, int segs, in fill_elf_header() argument
1469 memset(elf, 0, sizeof(*elf)); in fill_elf_header()
1471 memcpy(elf->e_ident, ELFMAG, SELFMAG); in fill_elf_header()
1472 elf->e_ident[EI_CLASS] = ELF_CLASS; in fill_elf_header()
1473 elf->e_ident[EI_DATA] = ELF_DATA; in fill_elf_header()
1474 elf->e_ident[EI_VERSION] = EV_CURRENT; in fill_elf_header()
1475 elf->e_ident[EI_OSABI] = ELF_OSABI; in fill_elf_header()
1477 elf->e_type = ET_CORE; in fill_elf_header()
1478 elf->e_machine = machine; in fill_elf_header()
1479 elf->e_version = EV_CURRENT; in fill_elf_header()
1480 elf->e_phoff = sizeof(struct elfhdr); in fill_elf_header()
1481 elf->e_flags = flags; in fill_elf_header()
1482 elf->e_ehsize = sizeof(struct elfhdr); in fill_elf_header()
1483 elf->e_phentsize = sizeof(struct elf_phdr); in fill_elf_header()
1484 elf->e_phnum = segs; in fill_elf_header()
1834 static int fill_note_info(struct elfhdr *elf, int phdrs, in fill_note_info() argument
1871 * Initialize the ELF file header. in fill_note_info()
1873 fill_elf_header(elf, phdrs, in fill_note_info()
1878 fill_elf_header(elf, phdrs, ELF_ARCH, ELF_CORE_EFLAGS); in fill_note_info()
1982 static void fill_extnum_info(struct elfhdr *elf, struct elf_shdr *shdr4extnum, in fill_extnum_info() argument
1985 elf->e_shoff = e_shoff; in fill_extnum_info()
1986 elf->e_shentsize = sizeof(*shdr4extnum); in fill_extnum_info()
1987 elf->e_shnum = 1; in fill_extnum_info()
1988 elf->e_shstrndx = SHN_UNDEF; in fill_extnum_info()
1993 shdr4extnum->sh_size = elf->e_shnum; in fill_extnum_info()
1994 shdr4extnum->sh_link = elf->e_shstrndx; in fill_extnum_info()
2009 struct elfhdr elf; in elf_core_dump() local
2018 * The number of segs are recored into ELF header as 16bit value. in elf_core_dump()
2028 * include/linux/elf.h for further information. */ in elf_core_dump()
2035 if (!fill_note_info(&elf, e_phnum, &info, cprm)) in elf_core_dump()
2040 offset += sizeof(elf); /* ELF header */ in elf_core_dump()
2068 fill_extnum_info(&elf, shdr4extnum, e_shoff, segs); in elf_core_dump()
2073 if (!dump_emit(cprm, &elf, sizeof(elf))) in elf_core_dump()
2150 /* Remove the COFF and ELF loaders. */ in exit_elf_binfmt()