Home
last modified time | relevance | path

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

12345

/illumos-gate/usr/src/cmd/sgs/liblddbg/common/
H A Delf.c38 Byte *byte = &(ehdr->e_ident[0]); in Elf_ehdr()
42 Half mach = ehdr->e_machine; in Elf_ehdr()
79 if (ehdr->e_shstrndx == SHN_XINDEX) { in Elf_ehdr()
81 EC_ADDR(ehdr->e_entry), ehdr->e_ehsize); in Elf_ehdr()
85 ehdr->e_ehsize, ehdr->e_shstrndx); in Elf_ehdr()
87 if (ehdr->e_shnum == 0) { in Elf_ehdr()
89 ehdr->e_shentsize); in Elf_ehdr()
93 ehdr->e_shentsize, ehdr->e_shnum); in Elf_ehdr()
95 if (ehdr->e_phnum == PN_XNUM) { in Elf_ehdr()
97 ehdr->e_phentsize); in Elf_ehdr()
[all …]
/illumos-gate/usr/src/cmd/sgs/elfedit/modules/common/
H A Dehdr.c243 Ehdr *ehdr; in print_ehdr() local
289 Elf_ehdr(NULL, ehdr, in print_ehdr()
388 ehdr->e_ident[i]); in print_ehdr()
444 ehdr->e_type); in print_ehdr()
463 ehdr->e_version); in print_ehdr()
486 conv_ehdr_flags(ehdr->e_machine, ehdr->e_flags, in print_ehdr()
490 ehdr->e_flags); in print_ehdr()
672 Ehdr *ehdr; in cmd_body() local
785 ehdr->e_type = type; in cmd_body()
876 ehdr->e_phoff = off; in cmd_body()
[all …]
/illumos-gate/usr/src/lib/libc/sparc/crt/
H A D_rtld.c140 if (ehdr == (Elf32_Ehdr *)-1) in __rtld()
148 if (ehdr->e_ident[EI_MAG0] != ELFMAG0 || in __rtld()
149 ehdr->e_ident[EI_MAG1] != ELFMAG1 || in __rtld()
150 ehdr->e_ident[EI_MAG2] != ELFMAG2 || in __rtld()
151 ehdr->e_ident[EI_MAG3] != ELFMAG3) in __rtld()
154 ehdr->e_ident[EI_DATA] != ELFDATA2MSB) in __rtld()
156 if (ehdr->e_type != ET_DYN) in __rtld()
158 if ((ehdr->e_machine != EM_SPARC) && in __rtld()
159 (ehdr->e_machine != EM_SPARC32PLUS)) in __rtld()
161 if (ehdr->e_version > EV_CURRENT) in __rtld()
[all …]
/illumos-gate/usr/src/lib/libc/i386/crt/
H A D_rtld.c83 Elf32_Ehdr *ehdr; /* ELF header of ld.so */ in __rtld() local
141 if (ehdr == (Elf32_Ehdr *)-1) in __rtld()
149 if (ehdr->e_ident[EI_MAG0] != ELFMAG0 || in __rtld()
150 ehdr->e_ident[EI_MAG1] != ELFMAG1 || in __rtld()
151 ehdr->e_ident[EI_MAG2] != ELFMAG2 || in __rtld()
152 ehdr->e_ident[EI_MAG3] != ELFMAG3) in __rtld()
155 ehdr->e_ident[EI_DATA] != ELFDATA2LSB) in __rtld()
157 if (ehdr->e_type != ET_DYN) in __rtld()
159 if (ehdr->e_machine != EM_386) in __rtld()
161 if (ehdr->e_version > EV_CURRENT) in __rtld()
[all …]
/illumos-gate/usr/src/boot/common/
H A Dload_elf.c54 Elf_Ehdr *ehdr; member
93 Elf_Ehdr *ehdr; in __elfN() local
114 ehdr = ef->ehdr = (Elf_Ehdr *)ef->firstpage; in __elfN()
117 if (!IS_ELF(*ehdr)) { in __elfN()
161 Elf_Ehdr *ehdr; in __elfN() local
172 ehdr = ef.ehdr; in __elfN()
284 file_addmetadata(fp, MODINFOMD_ELFHDR, sizeof (*ehdr), ehdr); in __elfN()
312 Elf_Ehdr *ehdr; in __elfN() local
337 ehdr = ef->ehdr; in __elfN()
546 chunk = ehdr->e_shnum * ehdr->e_shentsize; in __elfN()
[all …]
/illumos-gate/usr/src/cmd/mdb/common/modules/krtld/
H A Dkrtld.c141 dump_ehdr(const Ehdr *ehdr) in dump_ehdr() argument
146 ehdr->e_ident[EI_MAG0], ehdr->e_ident[EI_MAG1], in dump_ehdr()
147 ehdr->e_ident[EI_MAG2], ehdr->e_ident[EI_MAG3]); in dump_ehdr()
150 ehdr->e_ident[EI_CLASS], ehdr->e_ident[EI_DATA]); in dump_ehdr()
153 ehdr->e_machine, ehdr->e_version); in dump_ehdr()
155 mdb_printf(" e_type: %-18hu\n", ehdr->e_type); in dump_ehdr()
156 mdb_printf(" e_flags: %-18u\n", ehdr->e_flags); in dump_ehdr()
159 ehdr->e_entry, ehdr->e_ehsize, ehdr->e_shstrndx); in dump_ehdr()
162 ehdr->e_shoff, ehdr->e_shentsize, ehdr->e_shnum); in dump_ehdr()
165 ehdr->e_phoff, ehdr->e_phentsize, ehdr->e_phnum); in dump_ehdr()
/illumos-gate/usr/src/uts/common/fs/objfs/
H A Dobjfs_data.c598 Elf64_Ehdr ehdr; in objfs_data_read() local
600 Elf32_Ehdr ehdr; in objfs_data_read()
603 bzero(&ehdr, sizeof (ehdr)); in objfs_data_read()
615 ehdr.e_type = ELFCLASS64; in objfs_data_read()
621 ehdr.e_type = ELFCLASS32; in objfs_data_read()
629 ehdr.e_machine = EM_SPARCV9; in objfs_data_read()
631 ehdr.e_machine = EM_SPARC; in objfs_data_read()
634 ehdr.e_machine = EM_AMD64; in objfs_data_read()
636 ehdr.e_machine = EM_386; in objfs_data_read()
641 ehdr.e_shnum = 0; in objfs_data_read()
[all …]
/illumos-gate/usr/src/cmd/sgs/libelf/common/
H A Dgetshnum.c53 GElf_Ehdr ehdr; in elf_getshdrnum() local
57 if (gelf_getehdr(elf, &ehdr) == 0) in elf_getshdrnum()
59 if (ehdr.e_shnum > 0) { in elf_getshdrnum()
60 *shnum = ehdr.e_shnum; in elf_getshdrnum()
63 if ((ehdr.e_shnum == 0) && (ehdr.e_shoff == 0)) { in elf_getshdrnum()
H A Dgetphnum.c49 GElf_Ehdr ehdr; in elf_getphdrnum() local
53 if (gelf_getehdr(elf, &ehdr) == NULL) in elf_getphdrnum()
56 if (ehdr.e_phnum != PN_XNUM) { in elf_getphdrnum()
57 *phnum = ehdr.e_phnum; in elf_getphdrnum()
66 *phnum = ehdr.e_phnum; in elf_getphdrnum()
H A Dgetshstrndx.c47 GElf_Ehdr ehdr; in elf_getshdrstrndx() local
51 if (gelf_getehdr(elf, &ehdr) == 0) in elf_getshdrstrndx()
53 if (ehdr.e_shstrndx != SHN_XINDEX) { in elf_getshdrstrndx()
54 *shstrndx = ehdr.e_shstrndx; in elf_getshdrstrndx()
/illumos-gate/usr/src/lib/libproc/common/
H A DPgcore.c1157 Elf32_Ehdr ehdr; in Pfgcore() local
1159 bzero(&ehdr, sizeof (ehdr)); in Pfgcore()
1179 ehdr.e_ehsize = sizeof (ehdr); in Pfgcore()
1187 ehdr.e_phoff = ehdr.e_ehsize; in Pfgcore()
1201 ehdr.e_shoff = ehdr.e_phoff + ehdr.e_phentsize * nphdrs; in Pfgcore()
1204 if (gc_pwrite64(fd, &ehdr, sizeof (ehdr), 0) != 0) in Pfgcore()
1217 bzero(&ehdr, sizeof (ehdr)); in Pfgcore()
1237 ehdr.e_ehsize = sizeof (ehdr); in Pfgcore()
1245 ehdr.e_phoff = ehdr.e_ehsize; in Pfgcore()
1259 ehdr.e_shoff = ehdr.e_phoff + ehdr.e_phentsize * nphdrs; in Pfgcore()
[all …]
H A DPsymtab.c123 Elf32_Ehdr ehdr; in get_saddrs() local
151 Elf64_Ehdr ehdr; in get_saddrs() local
1054 if (Pread(P, ehdr, sizeof (*ehdr), addr) != sizeof (*ehdr)) in read_ehdr32()
1073 if (ehdr->e_shoff == 0 || ehdr->e_shentsize < sizeof (shdr0) || in read_ehdr32()
1092 uintptr_t a = addr + ehdr->e_phoff + i * ehdr->e_phentsize; in read_dynamic_phdr32()
1127 if (ehdr->e_shoff == 0 || ehdr->e_shentsize < sizeof (shdr0) || in read_ehdr64()
1146 uintptr_t a = addr + ehdr->e_phoff + i * ehdr->e_phentsize; in read_dynamic_phdr64()
1257 Elf32_Ehdr ehdr; in file_differs() local
1292 Elf64_Ehdr ehdr; in file_differs() local
1353 Elf32_Ehdr ehdr; in fake_elf() local
[all …]
H A DPsymtab_machelf32.c215 Ehdr *ehdr, uint_t phnum, Phdr *phdr) in fake_elf64() argument
264 if (ehdr->e_type == ET_DYN) in fake_elf64()
350 size += phnum * ehdr->e_phentsize; in fake_elf64()
361 if (ehdr->e_type == ET_DYN) in fake_elf64()
458 ep->e_phentsize = ehdr->e_phentsize; in fake_elf64()
516 if (ehdr->e_type == ET_DYN) in fake_elf64()
544 if (ehdr->e_type == ET_DYN) in fake_elf64()
570 if (ehdr->e_type == ET_DYN) in fake_elf64()
594 if (ehdr->e_type == ET_DYN) in fake_elf64()
626 if (ehdr->e_type == ET_DYN) { in fake_elf64()
[all …]
/illumos-gate/usr/src/uts/common/exec/elf/
H A Delf.c301 Ehdr ehdr; in elfexec() member
319 ehdrp = &bigwad->ehdr; in elfexec()
1137 if ((ehdr->e_type != ET_EXEC && ehdr->e_type != ET_DYN) || in getelfhead()
1143 !elfheadcheck(ehdr->e_ident[EI_DATA], ehdr->e_machine, in getelfhead()
1144 ehdr->e_flags)) in getelfhead()
1202 if (ehdr->e_phentsize < MINPHENTSZ || (ehdr->e_phentsize & 3)) in getelfphdr()
1244 if (ehdr->e_shentsize < MINSHDRSZ || (ehdr->e_shentsize & 3) || in getelfshdr()
1321 Ehdr *ehdr, in mapelfexec() argument
1687 Ehdr ehdr; in elf_process_obj_scns() local
2085 Ehdr *ehdr; in elfcore() local
[all …]
/illumos-gate/usr/src/cmd/sgs/ldd/common/
H A Dldd.c376 GElf_Ehdr ehdr; in elf_check() local
383 if (gelf_getehdr(elf, &ehdr) == NULL) { in elf_check()
392 if ((ehdr.e_machine != M_MACH_32) && (ehdr.e_machine != M_MACH_64) && in elf_check()
393 (ehdr.e_machine != M_MACHPLUS)) { in elf_check()
402 if (ehdr.e_ident[EI_DATA] != M_DATA) { in elf_check()
411 switch (class = ehdr.e_ident[EI_CLASS]) { in elf_check()
418 if ((ehdr.e_machine != M_MACH) && in elf_check()
442 if ((ehdr.e_type != ET_EXEC) && (ehdr.e_type != ET_DYN) && in elf_check()
443 (ehdr.e_type != ET_REL)) { in elf_check()
516 if (ehdr.e_phnum && !dynamic) { in elf_check()
[all …]
/illumos-gate/usr/src/tools/btxld/
H A Delfh.h32 #define IS_ELF(ehdr) ((ehdr).e_ident[EI_MAG0] == ELFMAG0 && \ argument
33 (ehdr).e_ident[EI_MAG1] == ELFMAG1 && \
34 (ehdr).e_ident[EI_MAG2] == ELFMAG2 && \
35 (ehdr).e_ident[EI_MAG3] == ELFMAG3)
/illumos-gate/usr/src/cmd/dis/
H A Ddis_main.c480 GElf_Ehdr ehdr; in dis_file() local
496 dis_tgt_ehdr(current, &ehdr); in dis_file()
504 switch (ehdr.e_machine) { in dis_file()
506 if (ehdr.e_ident[EI_CLASS] != ELFCLASS32 || in dis_file()
507 ehdr.e_ident[EI_DATA] != ELFDATA2MSB) { in dis_file()
518 if (ehdr.e_ident[EI_CLASS] != ELFCLASS32 || in dis_file()
519 ehdr.e_ident[EI_DATA] != ELFDATA2MSB) { in dis_file()
534 if (ehdr.e_ident[EI_CLASS] != ELFCLASS64 || in dis_file()
535 ehdr.e_ident[EI_DATA] != ELFDATA2MSB) { in dis_file()
608 ehdr.e_machine); in dis_file()
[all …]
/illumos-gate/usr/src/cmd/sgs/ld/common/
H A Dld.c146 } ehdr; member
235 Elf64_Ehdr *ehdr = elf64_getehdr(nelf); in archive() local
237 if (ehdr == NULL) in archive()
239 *class_ret = ehdr->e_ident[EI_CLASS]; in archive()
240 *mach_ret = ehdr->e_machine; in archive()
244 if (ehdr == NULL) in archive()
246 *class_ret = ehdr->e_ident[EI_CLASS]; in archive()
247 *mach_ret = ehdr->e_machine; in archive()
441 class = hdr.ehdr.e_ident[EI_CLASS]; in process_args()
462 hdr.ehdr.e_machine : in process_args()
[all …]
/illumos-gate/usr/src/lib/libdtrace/common/
H A Ddt_link.c455 Elf32_Ehdr ehdr; in dump_elf32() member
487 elf_file.ehdr.e_type = ET_REL; in dump_elf32()
489 elf_file.ehdr.e_machine = EM_SPARC; in dump_elf32()
491 elf_file.ehdr.e_machine = EM_386; in dump_elf32()
498 elf_file.ehdr.e_shnum = nshdr; in dump_elf32()
592 Elf64_Ehdr ehdr; in dump_elf64() member
624 elf_file.ehdr.e_type = ET_REL; in dump_elf64()
628 elf_file.ehdr.e_machine = EM_AMD64; in dump_elf64()
635 elf_file.ehdr.e_shnum = nshdr; in dump_elf64()
1018 GElf_Ehdr ehdr; in process_obj() local
[all …]
/illumos-gate/usr/src/cmd/sgs/elfdump/common/
H A Delfdump.c719 shdr->sh_addr, ehdr->e_machine, ehdr->e_ident, gotaddr); in unwind_eh_frame()
1038 state->ehdr = ehdr; in init_symtbl_state()
1558 ehdr->e_machine); in cap_section()
1630 ((ehdr->e_type == ET_EXEC) || (ehdr->e_type == ET_DYN))) { in cap_section()
1794 ehdr, flags)) { in cap()
1818 if (cshdr && ((ehdr->e_type == ET_EXEC) || (ehdr->e_type == ET_DYN))) { in cap()
1835 Ehdr *ehdr) in interp() argument
4498 ehdr->e_machine); in got()
4886 bgn1 = ehdr->e_shoff; in shdr_cache()
4887 end1 = ehdr->e_shoff + (ehdr->e_shentsize * ehdr->e_shnum); in shdr_cache()
[all …]
/illumos-gate/usr/src/boot/i386/libi386/
H A Delf64_freebsd.c74 Elf_Ehdr *ehdr; in elf64_exec() local
81 ehdr = (Elf_Ehdr *)&(md->md_data); in elf64_exec()
109 entry_lo = ehdr->e_entry & 0xffffffff; in elf64_exec()
110 entry_hi = (ehdr->e_entry >> 32) & 0xffffffff; in elf64_exec()
112 printf("Start @ %#llx ...\n", ehdr->e_entry); in elf64_exec()
/illumos-gate/usr/src/cmd/abi/appcert/static_prof/
H A Dstatic_prof.c621 if (c->obj->ehdr->e_type != ET_EXEC && c->obj->ehdr->e_type != ET_DYN) in find_dynamic_sect()
624 if ((c->obj->ehdr->e_shoff == 0) || (c->obj->ehdr->e_shnum == 0)) { in find_dynamic_sect()
859 Elf64_Ehdr * ehdr) in is_text_section() argument
861 Elf32_Ehdr * ehdr) in is_text_section()
905 Elf64_Ehdr * ehdr) in scan_archive_symbols() argument
907 Elf32_Ehdr * ehdr) in scan_archive_symbols()
1170 Elf64_Ehdr * ehdr, in print_symtab() argument
1173 Elf32_Ehdr * ehdr, in print_symtab()
1238 ehdr); in print_symtab()
1329 Elf64_Ehdr *ehdr; in process() local
[all …]
/illumos-gate/usr/src/cmd/mdb/common/mdb/
H A Dmdb_gelf.c611 if (ehdr->e_shoff == 0) in gelf32_init()
670 if (ehdr->e_shoff == 0) in gelf64_init()
766 } ehdr; in mdb_gelf_create() local
794 if (IOP_READ(io, &ehdr.h64, sizeof (ehdr.h64)) != in mdb_gelf_create()
795 sizeof (ehdr.h64)) { in mdb_gelf_create()
1203 gst->gst_ehdr = ehdr; in mdb_gelf_symtab_create_raw()
1348 static GElf_Ehdr ehdr; in mdb_gelf_symtab_create_mutable() local
1352 gst->gst_ehdr = &ehdr; in mdb_gelf_symtab_create_mutable()
1354 if (ehdr.e_version == 0) { in mdb_gelf_symtab_create_mutable()
1378 ehdr.e_type = ET_NONE; in mdb_gelf_symtab_create_mutable()
[all …]
/illumos-gate/usr/src/psm/stand/boot/common/
H A Dreadfile.c979 Elf32_Ehdr *ehdr = NULL; in iload32() local
1010 if (xread(fd, (char *)ehdr, sizeof (*ehdr)) != sizeof (*ehdr)) { in iload32()
1015 size = ehdr->e_shentsize * ehdr->e_shnum; in iload32()
1028 AUX(*avp, AT_SUN_LDELF, ehdr); in iload32()
1110 if (ehdr) in iload32()
1127 Elf64_Ehdr *ehdr = NULL; in iload64() local
1157 if (xread(fd, (char *)ehdr, sizeof (*ehdr)) != sizeof (*ehdr)) { in iload64()
1162 size = ehdr->e_shentsize * ehdr->e_shnum; in iload64()
1176 AUX64(*avp, AT_SUN_LDELF, ehdr); in iload64()
1220 dl_entry = load + ehdr->e_entry; in iload64()
[all …]
/illumos-gate/usr/src/lib/libdwarf/common/
H A Ddwarf_elf_load_headers.c289 ehdr->ge_ident[i] = e->e_ident[i]; in generic_ehdr_from_32()
304 ep->f_machine = ehdr->ge_machine; in generic_ehdr_from_32()
305 ep->f_ehdr = ehdr; in generic_ehdr_from_32()
322 ehdr->ge_ident[i] = e->e_ident[i]; in generic_ehdr_from_64()
337 ep->f_machine = ehdr->ge_machine; in generic_ehdr_from_64()
338 ep->f_ehdr = ehdr; in generic_ehdr_from_64()
1500 struct generic_ehdr *ehdr = 0; in elf_load_elf_header32() local
1507 ehdr = (struct generic_ehdr *)calloc(1, in elf_load_elf_header32()
1509 if (!ehdr) { in elf_load_elf_header32()
1522 struct generic_ehdr *ehdr = 0; in elf_load_elf_header64() local
[all …]

12345