Lines Matching defs:elf
33 #include <linux/elf.h>
34 #include <linux/elf-fdpic.h>
214 /* binfmt_elf handles non-fdpic elf except on nommu */
486 * If the arch defines ELF_BASE_PLATFORM (in asm/elf.h), the value
1233 static inline void fill_elf_fdpic_header(struct elfhdr *elf, int segs)
1235 memcpy(elf->e_ident, ELFMAG, SELFMAG);
1236 elf->e_ident[EI_CLASS] = ELF_CLASS;
1237 elf->e_ident[EI_DATA] = ELF_DATA;
1238 elf->e_ident[EI_VERSION] = EV_CURRENT;
1239 elf->e_ident[EI_OSABI] = ELF_OSABI;
1240 memset(elf->e_ident+EI_PAD, 0, EI_NIDENT-EI_PAD);
1242 elf->e_type = ET_CORE;
1243 elf->e_machine = ELF_ARCH;
1244 elf->e_version = EV_CURRENT;
1245 elf->e_entry = 0;
1246 elf->e_phoff = sizeof(struct elfhdr);
1247 elf->e_shoff = 0;
1248 elf->e_flags = ELF_FDPIC_CORE_EFLAGS;
1249 elf->e_ehsize = sizeof(struct elfhdr);
1250 elf->e_phentsize = sizeof(struct elf_phdr);
1251 elf->e_phnum = segs;
1252 elf->e_shentsize = 0;
1253 elf->e_shnum = 0;
1254 elf->e_shstrndx = 0;
1374 * In order to add the specific thread information for the elf file format,
1420 static void fill_extnum_info(struct elfhdr *elf, struct elf_shdr *shdr4extnum,
1423 elf->e_shoff = e_shoff;
1424 elf->e_shentsize = sizeof(*shdr4extnum);
1425 elf->e_shnum = 1;
1426 elf->e_shstrndx = SHN_UNDEF;
1431 shdr4extnum->sh_size = elf->e_shnum;
1432 shdr4extnum->sh_link = elf->e_shstrndx;
1466 struct elfhdr *elf = NULL;
1481 elf = kmalloc(sizeof(*elf), GFP_KERNEL);
1482 if (!elf)
1514 * include/linux/elf.h for further information. */
1518 fill_elf_fdpic_header(elf, e_phnum);
1538 offset = sizeof(*elf); /* ELF header */
1560 fill_extnum_info(elf, shdr4extnum, e_shoff, segs);
1565 if (!dump_emit(cprm, elf, sizeof(*elf)))
1647 kfree(elf);