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>
165 * If the arch defines ELF_BASE_PLATFORM (in asm/elf.h), the value
238 /* Create the ELF interpreter info */ in create_elf_tables()
376 * total_size is the size of the ELF (interpreter) image. in elf_map()
379 * position with the ELF binary image. (since size < total_size) in elf_map()
381 * the end. (which unmap is needed for ELF images with holes.) in elf_map()
393 pr_info("%d (%s): Uhuuh, elf segment at %px requested but the memory is mapped already\n", in elf_map()
449 * load_elf_phdrs() - load ELF program headers
450 * @elf_ex: ELF header of the binary whose program headers should be loaded
451 * @elf_file: the opened ELF binary file
453 * Loads ELF program headers from the binary file elf_file, which has the ELF
501 * struct arch_elf_state - arch-specific ELF loading state
504 * the loading of an ELF file, throughout the checking of architecture
505 * specific ELF headers & through to the point where the ELF load is
517 * arch_elf_pt_proc() - check a PT_LOPROC..PT_HIPROC ELF program header
518 * @ehdr: The main ELF header
520 * @elf: The open ELF file
521 * @is_interp: True if the phdr is from the interpreter of the ELF being
524 * of loading the ELF.
527 * suitability for the system. Called once per ELF program header in the
528 * range PT_LOPROC to PT_HIPROC, for both the ELF being loaded and its
531 * Return: Zero to proceed with the ELF load, non-zero to fail the ELF load
536 struct file *elf, bool is_interp, in arch_elf_pt_proc() argument
544 * arch_check_elf() - check an ELF executable
545 * @ehdr: The main ELF header
546 * @has_interp: True if the ELF has an interpreter, else false.
547 * @interp_ehdr: The interpreter's ELF header
549 * of loading the ELF.
552 * of the ELF & cause an exec syscall to return an error. This is called after
555 * Return: Zero to proceed with the ELF load, non-zero to fail the ELF load
586 an ELF header */
711 * These are the functions used to load ELF style executables and shared
949 /* Not an ELF interpreter */ in load_elf_binary()
988 * Allow arch code to reject the ELF at this point, whilst it's in load_elf_binary()
1029 /* Now we do a little grungy work by mmapping the ELF image into in load_elf_binary()
1084 * This bss-zeroing can fail if the ELF in load_elf_binary()
1110 * size of the ELF mapping (total_size). (Note that in load_elf_binary()
1117 * _are_ the ELF interpreter). The loaders must in load_elf_binary()
1150 * ELF vaddrs will be correctly offset. The result in load_elf_binary()
1305 * For architectures with ELF randomization, when executing in load_elf_binary()
1306 * a loader directly (i.e. no interpreter listed in ELF in load_elf_binary()
1336 * example. In addition, it may also specify (eg, PowerPC64 ELF) in load_elf_binary()
1367 a.out library that is given an ELF header. */
1452 * ELF core dumper
1458 /* An ELF note in memory */
1490 static void fill_elf_header(struct elfhdr *elf, int segs, in fill_elf_header() argument
1493 memset(elf, 0, sizeof(*elf)); in fill_elf_header()
1495 memcpy(elf->e_ident, ELFMAG, SELFMAG); in fill_elf_header()
1496 elf->e_ident[EI_CLASS] = ELF_CLASS; in fill_elf_header()
1497 elf->e_ident[EI_DATA] = ELF_DATA; in fill_elf_header()
1498 elf->e_ident[EI_VERSION] = EV_CURRENT; in fill_elf_header()
1499 elf->e_ident[EI_OSABI] = ELF_OSABI; in fill_elf_header()
1501 elf->e_type = ET_CORE; in fill_elf_header()
1502 elf->e_machine = machine; in fill_elf_header()
1503 elf->e_version = EV_CURRENT; in fill_elf_header()
1504 elf->e_phoff = sizeof(struct elfhdr); in fill_elf_header()
1505 elf->e_flags = flags; in fill_elf_header()
1506 elf->e_ehsize = sizeof(struct elfhdr); in fill_elf_header()
1507 elf->e_phentsize = sizeof(struct elf_phdr); in fill_elf_header()
1508 elf->e_phnum = segs; in fill_elf_header()
1824 static int fill_note_info(struct elfhdr *elf, int phdrs, in fill_note_info() argument
1865 * Initialize the ELF file header. in fill_note_info()
1867 fill_elf_header(elf, phdrs, in fill_note_info()
1992 * In order to add the specific thread information for the elf file format,
2037 /* Allocate space for ELF notes */ in elf_note_info_init()
2053 static int fill_note_info(struct elfhdr *elf, int phdrs, in fill_note_info() argument
2085 fill_elf_header(elf, phdrs, ELF_ARCH, ELF_CORE_EFLAGS); in fill_note_info()
2169 static void fill_extnum_info(struct elfhdr *elf, struct elf_shdr *shdr4extnum, in fill_extnum_info() argument
2172 elf->e_shoff = e_shoff; in fill_extnum_info()
2173 elf->e_shentsize = sizeof(*shdr4extnum); in fill_extnum_info()
2174 elf->e_shnum = 1; in fill_extnum_info()
2175 elf->e_shstrndx = SHN_UNDEF; in fill_extnum_info()
2180 shdr4extnum->sh_size = elf->e_shnum; in fill_extnum_info()
2181 shdr4extnum->sh_link = elf->e_shstrndx; in fill_extnum_info()
2196 struct elfhdr elf; in elf_core_dump() local
2205 * The number of segs are recored into ELF header as 16bit value. in elf_core_dump()
2215 * include/linux/elf.h for further information. */ in elf_core_dump()
2222 if (!fill_note_info(&elf, e_phnum, &info, cprm)) in elf_core_dump()
2227 offset += sizeof(elf); /* Elf header */ in elf_core_dump()
2254 fill_extnum_info(&elf, shdr4extnum, e_shoff, segs); in elf_core_dump()
2259 if (!dump_emit(cprm, &elf, sizeof(elf))) in elf_core_dump()
2337 /* Remove the COFF and ELF loaders. */ in exit_elf_binfmt()