Home
last modified time | relevance | path

Searched refs:ehdr (Results 1 – 25 of 66) sorted by relevance

123

/freebsd/contrib/elftoolchain/libelf/
H A Dlibelf_ehdr.c108 void *ehdr; in _libelf_ehdr() local
141 return (ehdr); in _libelf_ehdr()
160 e->e_u.e_elf.e_ehdr.e_ehdr32 = ehdr; in _libelf_ehdr()
161 EHDR_INIT(ehdr,32); in _libelf_ehdr()
163 e->e_u.e_elf.e_ehdr.e_ehdr64 = ehdr; in _libelf_ehdr()
164 EHDR_INIT(ehdr,64); in _libelf_ehdr()
171 return (ehdr); in _libelf_ehdr()
179 phnum = ((Elf32_Ehdr *) ehdr)->e_phnum; in _libelf_ehdr()
180 shnum = ((Elf32_Ehdr *) ehdr)->e_shnum; in _libelf_ehdr()
181 shoff = ((Elf32_Ehdr *) ehdr)->e_shoff; in _libelf_ehdr()
[all …]
H A Delf_scn.c58 _libelf_load_section_headers(Elf *e, void *ehdr) in _libelf_load_section_headers() argument
70 assert(ehdr != NULL); in _libelf_load_section_headers()
91 eh32 = (Elf32_Ehdr *) ehdr; in _libelf_load_section_headers()
95 eh64 = (Elf64_Ehdr *) ehdr; in _libelf_load_section_headers()
148 void *ehdr; in elf_getscn() local
157 if ((ehdr = _libelf_ehdr(e, ec, 0)) == NULL) in elf_getscn()
162 _libelf_load_section_headers(e, ehdr) == 0) in elf_getscn()
193 void *ehdr; in elf_newscn() local
206 if ((ehdr = _libelf_ehdr(e, ec, 0)) == NULL) in elf_newscn()
221 _libelf_load_section_headers(e, ehdr) == 0) in elf_newscn()
H A Dlibelf_phdr.c44 void *ehdr, *phdr; in _libelf_getphdr() local
63 if ((ehdr = _libelf_ehdr(e, ec, 0)) == NULL) in _libelf_getphdr()
69 eh32 = (Elf32_Ehdr *) ehdr; in _libelf_getphdr()
72 eh64 = (Elf64_Ehdr *) ehdr; in _libelf_getphdr()
115 void *ehdr, *newphdr, *oldphdr; in _libelf_newphdr() local
123 if ((ehdr = _libelf_ehdr(e, ec, 0)) == NULL) { in _libelf_newphdr()
H A Delf_update.c517 void *ehdr, *phdr; in _libelf_resync_elf() local
533 eh32 = ehdr; in _libelf_resync_elf()
534 eh64 = ehdr; in _libelf_resync_elf()
605 ehdr)) in _libelf_resync_elf()
851 void *ehdr; in _libelf_write_ehdr() local
861 assert(ehdr != NULL); in _libelf_write_ehdr()
872 src.d_buf = ehdr; in _libelf_write_ehdr()
895 void *ehdr; in _libelf_write_phdr() local
907 assert(ehdr != NULL); in _libelf_write_phdr()
957 void *ehdr; in _libelf_write_shdr() local
[all …]
H A Delf_flag.c84 void *ehdr; in elf_flagehdr() local
97 ehdr = e->e_u.e_elf.e_ehdr.e_ehdr32; in elf_flagehdr()
99 ehdr = e->e_u.e_elf.e_ehdr.e_ehdr64; in elf_flagehdr()
101 if (ehdr == NULL) { in elf_flagehdr()
H A Dgelf_ehdr.c122 void *ehdr; in gelf_update_ehdr() local
137 if ((ehdr = _libelf_ehdr(e, ec, 0)) == NULL) in gelf_update_ehdr()
143 eh64 = (Elf64_Ehdr *) ehdr; in gelf_update_ehdr()
148 eh32 = (Elf32_Ehdr *) ehdr; in gelf_update_ehdr()
/freebsd/sys/kern/
H A Dkern_dump.c289 Elf_Ehdr ehdr; in dumpsys_generic() local
300 bzero(&ehdr, sizeof(ehdr)); in dumpsys_generic()
301 ehdr.e_ident[EI_MAG0] = ELFMAG0; in dumpsys_generic()
302 ehdr.e_ident[EI_MAG1] = ELFMAG1; in dumpsys_generic()
313 ehdr.e_type = ET_CORE; in dumpsys_generic()
314 ehdr.e_machine = EM_VALUE; in dumpsys_generic()
315 ehdr.e_phoff = sizeof(ehdr); in dumpsys_generic()
316 ehdr.e_flags = 0; in dumpsys_generic()
317 ehdr.e_ehsize = sizeof(ehdr); in dumpsys_generic()
327 hdrsz = ehdr.e_phoff + ehdr.e_phnum * ehdr.e_phentsize; in dumpsys_generic()
[all …]
/freebsd/stand/common/
H A Dload_elf.c52 Elf_Ehdr *ehdr; member
155 CONVERT_SWITCH(ehdr, ehdr, HEADER_FIELDS); in elf_header_convert()
271 Elf_Ehdr *ehdr; in __elfN() local
306 ehdr = ef->ehdr = (Elf_Ehdr *)ef->firstpage; in __elfN()
371 Elf_Ehdr *ehdr; in __elfN() local
382 ehdr = ef.ehdr; in __elfN()
489 file_addmetadata(fp, MODINFOMD_ELFHDR, sizeof(*ehdr), ehdr); in __elfN()
535 Elf_Ehdr *ehdr; local
560 ehdr = ef->ehdr;
708 chunk = (size_t)ehdr->e_shnum * (size_t)ehdr->e_shentsize;
[all …]
/freebsd/lib/libc/gen/
H A Dnlist.c98 __elf_is_okay__(Elf_Ehdr *ehdr) in __elf_is_okay__() argument
107 if (IS_ELF(*ehdr) && in __elf_is_okay__()
109 ehdr->e_ident[EI_DATA] == ELF_TARG_DATA && in __elf_is_okay__()
113 if (ehdr->e_machine == ELF_TARG_MACH && in __elf_is_okay__()
114 ehdr->e_version == ELF_TARG_VER) in __elf_is_okay__()
131 Elf_Ehdr ehdr; in __elf_fdnlist() local
141 !__elf_is_okay__(&ehdr) || in __elf_fdnlist()
146 shdr_size = ehdr.e_shentsize * ehdr.e_shnum; in __elf_fdnlist()
156 (off_t)ehdr.e_shoff); in __elf_fdnlist()
167 for (i = 0; i < ehdr.e_shnum; i++) { in __elf_fdnlist()
[all …]
/freebsd/sys/compat/linux/
H A Dlinux_vdso.c105 Elf_Ehdr *ehdr; in __elfN() local
110 ehdr = (Elf_Ehdr *)base; in __elfN()
112 MPASS(IS_ELF(*ehdr)); in __elfN()
114 MPASS(ehdr->e_ident[EI_DATA] == ELF_TARG_DATA); in __elfN()
115 MPASS(ehdr->e_ident[EI_VERSION] == EV_CURRENT); in __elfN()
116 MPASS(ehdr->e_shentsize == sizeof(Elf_Shdr)); in __elfN()
117 MPASS(ehdr->e_shoff != 0); in __elfN()
118 MPASS(ehdr->e_type == ET_DYN); in __elfN()
120 shdr = (const Elf_Shdr *)(base + ehdr->e_shoff); in __elfN()
123 for (i = 0; i < ehdr->e_shnum; i++) { in __elfN()
[all …]
/freebsd/usr.bin/gcore/
H A Delfcore.c469 Elf_Ehdr *ehdr, binhdr; in elf_puthdr() local
481 ehdr = (Elf_Ehdr *)hdr; in elf_puthdr()
492 ehdr->e_ident[EI_PAD] = 0; in elf_puthdr()
493 ehdr->e_type = ET_CORE; in elf_puthdr()
495 ehdr->e_version = EV_CURRENT; in elf_puthdr()
496 ehdr->e_entry = 0; in elf_puthdr()
502 ehdr->e_shstrndx = SHN_UNDEF; in elf_puthdr()
505 ehdr->e_shnum = 0; in elf_puthdr()
507 ehdr->e_phnum = PN_XNUM; in elf_puthdr()
508 ehdr->e_shnum = 1; in elf_puthdr()
[all …]
/freebsd/cddl/contrib/opensolaris/lib/libdtrace/common/
H A Ddt_link.c467 Elf32_Ehdr ehdr; in dump_elf32() member
500 elf_file.ehdr.e_type = ET_REL; in dump_elf32()
502 elf_file.ehdr.e_machine = EM_ARM; in dump_elf32()
504 elf_file.ehdr.e_machine = EM_PPC; in dump_elf32()
531 elf_file.ehdr.e_shnum = nshdr; in dump_elf32()
621 Elf64_Ehdr ehdr; in dump_elf64() member
654 elf_file.ehdr.e_type = ET_REL; in dump_elf64()
659 elf_file.ehdr.e_flags = 2; in dump_elf64()
688 elf_file.ehdr.e_shnum = nshdr; in dump_elf64()
1197 GElf_Ehdr ehdr; in process_obj() local
[all …]
/freebsd/cddl/contrib/opensolaris/tools/ctf/cvt/
H A Dutil.c68 GElf_Ehdr ehdr; in findelfsecidx() local
71 if (gelf_getehdr(elf, &ehdr) == NULL) in findelfsecidx()
83 if ((name = elf_strptr(elf, ehdr.e_shstrndx, in findelfsecidx()
100 GElf_Ehdr ehdr; in elf_ptrsz() local
102 if (gelf_getehdr(elf, &ehdr) == NULL) { in elf_ptrsz()
107 if (ehdr.e_ident[EI_CLASS] == ELFCLASS32) in elf_ptrsz()
109 else if (ehdr.e_ident[EI_CLASS] == ELFCLASS64) in elf_ptrsz()
112 terminate("unknown ELF class %d\n", ehdr.e_ident[EI_CLASS]); in elf_ptrsz()
/freebsd/usr.bin/ldd/
H A Dldd.c295 if (gelf_xlatetom(elf, &dst, &src, ehdr->e_ident[EI_DATA]) == NULL) { in has_freebsd_abi_tag()
369 if (gelf_xlatetom(elf, &dst, &src, ehdr->e_ident[EI_DATA]) == NULL) { in is_pie()
393 GElf_Ehdr ehdr; in is_executable() local
418 if (gelf_getehdr(elf, &ehdr) == NULL) { in is_executable()
431 freebsd = ehdr.e_ident[EI_OSABI] == ELFOSABI_FREEBSD; in is_executable()
432 for (i = 0; i < ehdr.e_phnum; i++) { in is_executable()
440 if (ehdr.e_ident[EI_OSABI] == ELFOSABI_NONE && !freebsd) in is_executable()
441 freebsd = has_freebsd_abi_tag(fname, elf, &ehdr, in is_executable()
446 if (ehdr.e_type == ET_DYN) in is_executable()
447 pie = is_pie(fname, elf, &ehdr, phdr.p_offset, in is_executable()
[all …]
/freebsd/stand/i386/libi386/
H A Delf64_freebsd.c71 Elf_Ehdr *ehdr; in elf64_exec() local
78 ehdr = (Elf_Ehdr *)&(md->md_data); in elf64_exec()
106 entry_lo = ehdr->e_entry & 0xffffffff; in elf64_exec()
107 entry_hi = (ehdr->e_entry >> 32) & 0xffffffff; in elf64_exec()
109 printf("Start @ %#llx ...\n", ehdr->e_entry); in elf64_exec()
H A Delf32_freebsd.c54 Elf_Ehdr *ehdr; in elf32_exec() local
60 ehdr = (Elf_Ehdr *)&(md->md_data); in elf32_exec()
65 entry = ehdr->e_entry & 0xffffff; in elf32_exec()
/freebsd/sys/x86/xen/
H A Dpv.c274 Elf_Ehdr *ehdr; in xen_pvh_parse_symtab() local
278 ehdr = (Elf_Ehdr *)(&end + 1); in xen_pvh_parse_symtab()
279 if (memcmp(ehdr->e_ident, ELFMAG, SELFMAG) || in xen_pvh_parse_symtab()
280 ehdr->e_ident[EI_CLASS] != ELF_TARG_CLASS || in xen_pvh_parse_symtab()
281 ehdr->e_version > 1) { in xen_pvh_parse_symtab()
287 shdr = (Elf_Shdr *)((uint8_t *)ehdr + ehdr->e_shoff); in xen_pvh_parse_symtab()
289 for (i = 1; i < ehdr->e_shnum; i++) { in xen_pvh_parse_symtab()
294 ksymtab = (uintptr_t)((uint8_t *)ehdr + shdr[i].sh_offset); in xen_pvh_parse_symtab()
299 kstrtab = (uintptr_t)((uint8_t *)ehdr + shdr[j].sh_offset); in xen_pvh_parse_symtab()
/freebsd/sys/powerpc/ofw/
H A Dofw_initrd.c61 Elf_Ehdr ehdr; in ofw_initrd_probe_and_attach() local
96 memcpy(&ehdr, taste, sizeof(ehdr)); in ofw_initrd_probe_and_attach()
98 if (IS_ELF(ehdr)) { in ofw_initrd_probe_and_attach()
/freebsd/usr.sbin/crunch/crunchide/
H A Dexec_elf32.c224 Elf_Ehdr ehdr; in ELFNAMEEND() local
242 if (xreadatoff(fd, &ehdr, 0, sizeof ehdr, fn) != sizeof ehdr) in ELFNAMEEND()
245 data = ehdr.e_ident[EI_DATA]; in ELFNAMEEND()
246 shnum = xe16toh(ehdr.e_shnum); in ELFNAMEEND()
248 shdrsize = shnum * xe16toh(ehdr.e_shentsize); in ELFNAMEEND()
251 if (xreadatoff(fd, shdrp, xewtoh(ehdr.e_shoff), shdrsize, fn) != in ELFNAMEEND()
268 if (i == xe16toh(ehdr.e_shstrndx)) in ELFNAMEEND()
303 shdrshdr.sh_offset = ehdr.e_shoff; in ELFNAMEEND()
464 ehdr.e_shoff != shdrshdr.sh_offset) { in ELFNAMEEND()
465 ehdr.e_shoff = shdrshdr.sh_offset; in ELFNAMEEND()
[all …]
/freebsd/contrib/elftoolchain/brandelf/
H A Dbrandelf.c93 GElf_Ehdr ehdr; in main() local
185 if (gelf_getehdr(elf, &ehdr) == NULL) { in main()
194 argv[0], iselftype(ehdr.e_ident[EI_OSABI]), in main()
195 ehdr.e_ident[EI_OSABI]); in main()
216 ehdr.e_ident[EI_OSABI] = (unsigned char) type; in main()
217 if (gelf_update_ehdr(elf, &ehdr) == 0) { in main()
/freebsd/contrib/elftoolchain/elfdump/
H A Delfdump.c119 GElf_Ehdr ehdr; /* ELF header. */ member
1287 ed->ehdr.e_ident[0], ed->ehdr.e_ident[1], in elf_print_ehdr()
1288 ed->ehdr.e_ident[2], ed->ehdr.e_ident[3]); in elf_print_ehdr()
1295 elf_version_str(ed->ehdr.e_version)); in elf_print_ehdr()
1299 PRT(" e_ehsize: %6d", ed->ehdr.e_ehsize); in elf_print_ehdr()
1313 ei_abis[ed->ehdr.e_ident[EI_OSABI]]); in elf_print_ehdr()
1320 PRT("\te_flags: %u\n", ed->ehdr.e_flags); in elf_print_ehdr()
1323 PRT("\te_phnum: %u\n", ed->ehdr.e_phnum); in elf_print_ehdr()
1325 PRT("\te_shnum: %u\n", ed->ehdr.e_shnum); in elf_print_ehdr()
1565 st_type(ed->ehdr.e_machine, in elf_print_symtab()
[all …]
/freebsd/stand/userboot/userboot/
H A Delf64_freebsd.c88 Elf_Ehdr *ehdr; in elf64_exec() local
100 ehdr = (Elf_Ehdr *)&(md->md_data); in elf64_exec()
138 printf("Start @ %#"PRIx64" ...\n", ehdr->e_entry); in elf64_exec()
161 CALLBACK(exec, ehdr->e_entry); in elf64_exec()
H A Delf32_freebsd.c57 Elf_Ehdr *ehdr; in elf32_exec() local
65 ehdr = (Elf_Ehdr *)&(md->md_data); in elf32_exec()
70 entry = ehdr->e_entry & 0xffffff; in elf32_exec()
/freebsd/stand/efi/loader/arch/arm64/
H A Dexec.c65 Elf_Ehdr *ehdr; in elf64_exec() local
72 ehdr = (Elf_Ehdr *)&(md->md_data); in elf64_exec()
73 entry = efi_translate(ehdr->e_entry); in elf64_exec()
/freebsd/usr.bin/elfctl/
H A Delfctl.c91 GElf_Ehdr ehdr; in main() local
162 if (gelf_getehdr(elf, &ehdr) == NULL) { in main()
168 if (ehdr.e_ident[EI_DATA] == HOST_ENDIAN) { in main()
170 } else if (ehdr.e_ident[EI_DATA] == SWAP_ENDIAN) { in main()
179 if (!print_file_features(elf, ehdr.e_phnum, fd, in main()
184 } else if (!edit_file_features(elf, ehdr.e_phnum, fd, in main()

123