Home
last modified time | relevance | path

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

12345

/titanic_50/usr/src/cmd/sgs/liblddbg/common/
H A Delf.c33 Elf_ehdr(Lm_list *lml, Ehdr *ehdr, Shdr *shdr0) in Elf_ehdr() argument
38 Byte *byte = &(ehdr->e_ident[0]); in Elf_ehdr()
41 uchar_t osabi = ehdr->e_ident[EI_OSABI]; in Elf_ehdr()
42 Half mach = ehdr->e_machine; in Elf_ehdr()
52 conv_ehdr_class(ehdr->e_ident[EI_CLASS], 0, &inv_buf1), in Elf_ehdr()
53 conv_ehdr_data(ehdr->e_ident[EI_DATA], 0, &inv_buf2)); in Elf_ehdr()
55 conv_ehdr_osabi(ehdr->e_ident[EI_OSABI], 0, &inv_buf1), in Elf_ehdr()
56 conv_ehdr_abivers(ehdr->e_ident[EI_OSABI], in Elf_ehdr()
57 ehdr->e_ident[EI_ABIVERSION], CONV_FMT_DECIMAL, &inv_buf2)); in Elf_ehdr()
60 conv_ehdr_vers(ehdr->e_version, 0, &inv_buf2)); in Elf_ehdr()
[all …]
/titanic_50/usr/src/cmd/sgs/elfedit/modules/common/
H A Dehdr.c243 Ehdr *ehdr; in print_ehdr() local
275 ehdr = argstate->obj_state->os_ehdr; in print_ehdr()
289 Elf_ehdr(NULL, ehdr, in print_ehdr()
310 value = conv_magic_value(ehdr->e_ident[i]); in print_ehdr()
315 value = conv_ehdr_class(ehdr->e_ident[EI_CLASS], in print_ehdr()
321 value = conv_ehdr_data(ehdr->e_ident[EI_DATA], in print_ehdr()
328 ehdr->e_ident[EI_VERSION], 0, &inv_buf); in print_ehdr()
333 value = conv_ehdr_osabi(ehdr->e_ident[EI_OSABI], in print_ehdr()
340 ehdr->e_ident[EI_OSABI], in print_ehdr()
341 ehdr->e_ident[EI_ABIVERSION], in print_ehdr()
[all …]
/titanic_50/usr/src/lib/libc/sparc/crt/
H A D_rtld.c82 Elf32_Ehdr *ehdr; /* ELF header of ld.so */ in __rtld() local
138 ehdr = (Elf32_Ehdr *)MMAP(0, sb.st_size, PROT_READ | PROT_EXEC, in __rtld()
140 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()
153 if (ehdr->e_ident[EI_CLASS] != ELFCLASS32 || in __rtld()
154 ehdr->e_ident[EI_DATA] != ELFDATA2MSB) in __rtld()
156 if (ehdr->e_type != ET_DYN) in __rtld()
[all …]
/titanic_50/usr/src/lib/libc/i386/crt/
H A D_rtld.c83 Elf32_Ehdr *ehdr; /* ELF header of ld.so */ in __rtld() local
139 ehdr = (Elf32_Ehdr *)MMAP(0, sb.st_size, PROT_READ | PROT_EXEC, in __rtld()
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()
154 if (ehdr->e_ident[EI_CLASS] != ELFCLASS32 || in __rtld()
155 ehdr->e_ident[EI_DATA] != ELFDATA2LSB) in __rtld()
157 if (ehdr->e_type != ET_DYN) in __rtld()
[all …]
/titanic_50/usr/src/cmd/mdb/common/modules/krtld/
H A Dkrtld.c143 dump_ehdr(const Ehdr *ehdr) in dump_ehdr() argument
148 ehdr->e_ident[EI_MAG0], ehdr->e_ident[EI_MAG1], in dump_ehdr()
149 ehdr->e_ident[EI_MAG2], ehdr->e_ident[EI_MAG3]); in dump_ehdr()
152 ehdr->e_ident[EI_CLASS], ehdr->e_ident[EI_DATA]); in dump_ehdr()
155 ehdr->e_machine, ehdr->e_version); in dump_ehdr()
157 mdb_printf(" e_type: %-18hu\n", ehdr->e_type); in dump_ehdr()
158 mdb_printf(" e_flags: %-18u\n", ehdr->e_flags); in dump_ehdr()
161 ehdr->e_entry, ehdr->e_ehsize, ehdr->e_shstrndx); in dump_ehdr()
164 ehdr->e_shoff, ehdr->e_shentsize, ehdr->e_shnum); in dump_ehdr()
167 ehdr->e_phoff, ehdr->e_phentsize, ehdr->e_phnum); in dump_ehdr()
/titanic_50/usr/src/uts/common/fs/objfs/
H A Dobjfs_data.c600 Elf64_Ehdr ehdr; in objfs_data_read() local
602 Elf32_Ehdr ehdr; in objfs_data_read()
605 bzero(&ehdr, sizeof (ehdr)); in objfs_data_read()
607 bcopy(ELFMAG, ehdr.e_ident, SELFMAG); in objfs_data_read()
609 ehdr.e_ident[EI_DATA] = ELFDATA2MSB; in objfs_data_read()
611 ehdr.e_ident[EI_DATA] = ELFDATA2LSB; in objfs_data_read()
613 ehdr.e_ident[EI_VERSION] = EV_CURRENT; in objfs_data_read()
616 ehdr.e_ident[EI_CLASS] = ELFCLASS64; in objfs_data_read()
617 ehdr.e_type = ELFCLASS64; in objfs_data_read()
618 ehdr.e_ehsize = sizeof (Elf64_Ehdr); in objfs_data_read()
[all …]
/titanic_50/usr/src/cmd/sgs/rtld.4.x/
H A Drtld.4.x.c223 Elf32_Ehdr *ehdr; /* ELF header of ld.so */ local
382 ehdr = (Elf32_Ehdr *)mmap(0, sb.st_size, PROT_READ | PROT_EXEC,
384 if (ehdr == (Elf32_Ehdr *)-1)
392 if (ehdr->e_ident[EI_MAG0] != ELFMAG0 ||
393 ehdr->e_ident[EI_MAG1] != ELFMAG1 ||
394 ehdr->e_ident[EI_MAG2] != ELFMAG2 ||
395 ehdr->e_ident[EI_MAG3] != ELFMAG3)
397 if (ehdr->e_ident[EI_CLASS] != ELFCLASS32 ||
398 ehdr->e_ident[EI_DATA] != ELFDATA2MSB)
400 if (ehdr->e_type != ET_DYN)
[all …]
/titanic_50/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()
/titanic_50/usr/src/uts/common/exec/elf/
H A Delf.c174 mapexec_brand(vnode_t *vp, uarg_t *args, Ehdr *ehdr, Addr *uphdr_vaddr, in mapexec_brand() argument
200 if ((error = getelfhead(vp, CRED(), ehdr, &nshdrs, &shstrndx, in mapexec_brand()
202 (error = getelfphdr(vp, CRED(), ehdr, nphdrs, &phdrbase, in mapexec_brand()
208 if ((len = elfsize(ehdr, nphdrs, phdrbase, &lddata)) == 0) { in mapexec_brand()
216 if (error = mapelfexec(vp, ehdr, nphdrs, phdrbase, &uphdr, &dynphdr, in mapexec_brand()
234 if (ehdr->e_type == ET_EXEC && *interp == 0) in mapexec_brand()
285 Ehdr ehdr; in elfexec() member
302 ehdrp = &bigwad->ehdr; in elfexec()
997 getelfhead(vnode_t *vp, cred_t *credp, Ehdr *ehdr, int *nshdrs, int *shstrndx, in getelfhead() argument
1007 if ((error = vn_rdwr(UIO_READ, vp, (caddr_t)ehdr, in getelfhead()
[all …]
/titanic_50/usr/src/lib/libproc/common/
H A DPgcore.c1101 Elf32_Ehdr ehdr; in Pfgcore() local
1103 bzero(&ehdr, sizeof (ehdr)); in Pfgcore()
1104 ehdr.e_ident[EI_MAG0] = ELFMAG0; in Pfgcore()
1105 ehdr.e_ident[EI_MAG1] = ELFMAG1; in Pfgcore()
1106 ehdr.e_ident[EI_MAG2] = ELFMAG2; in Pfgcore()
1107 ehdr.e_ident[EI_MAG3] = ELFMAG3; in Pfgcore()
1108 ehdr.e_type = ET_CORE; in Pfgcore()
1110 ehdr.e_ident[EI_CLASS] = ELFCLASS32; in Pfgcore()
1112 ehdr.e_machine = EM_SPARC; in Pfgcore()
1113 ehdr.e_ident[EI_DATA] = ELFDATA2MSB; in Pfgcore()
[all …]
H A DPsymtab.c104 Elf32_Ehdr ehdr; in get_saddrs() local
108 if (read_ehdr32(P, &ehdr, &phnum, ehdr_start) != 0) in get_saddrs()
112 a = ehdr_start + ehdr.e_phoff; in get_saddrs()
113 for (i = 0; i < phnum; i++, a += ehdr.e_phentsize) { in get_saddrs()
123 if (ehdr.e_type == ET_DYN) in get_saddrs()
132 Elf64_Ehdr ehdr; in get_saddrs() local
136 if (read_ehdr64(P, &ehdr, &phnum, ehdr_start) != 0) in get_saddrs()
140 a = ehdr_start + ehdr.e_phoff; in get_saddrs()
141 for (i = 0; i < phnum; i++, a += ehdr.e_phentsize) { in get_saddrs()
151 if (ehdr.e_type == ET_DYN) in get_saddrs()
[all …]
H A DPsymtab_machelf32.c211 Ehdr *ehdr, uint_t phnum, Phdr *phdr) in fake_elf64() argument
215 Ehdr *ehdr, uint_t phnum, Phdr *phdr) in fake_elf64()
260 if (ehdr->e_type == ET_DYN) in fake_elf64()
345 size += phnum * ehdr->e_phentsize; in fake_elf64()
356 if (ehdr->e_type == ET_DYN) in fake_elf64()
452 (void) memcpy(ep, ehdr, offsetof(Ehdr, e_phoff)); in fake_elf64()
456 ep->e_phentsize = ehdr->e_phentsize; in fake_elf64()
478 addr + ehdr->e_phoff) != phnum * ep->e_phentsize) { in fake_elf64()
514 if (ehdr->e_type == ET_DYN) in fake_elf64()
542 if (ehdr->e_type == ET_DYN) in fake_elf64()
[all …]
/titanic_50/usr/src/cmd/sgs/ld/common/
H A Dld.c81 } ehdr; member
198 Elf64_Ehdr *ehdr; in archive() local
200 if ((ehdr = elf64_getehdr(_elf)) == in archive()
203 *class_ret = ehdr->e_ident[EI_CLASS]; in archive()
204 *mach_ret = ehdr->e_machine; in archive()
206 Elf32_Ehdr *ehdr; in archive() local
208 if ((ehdr = elf32_getehdr(_elf)) == in archive()
211 *class_ret = ehdr->e_ident[EI_CLASS]; in archive()
212 *mach_ret = ehdr->e_machine; in archive()
406 if ((hdr.ehdr.e_ident[EI_MAG0] == ELFMAG0) && in process_args()
[all …]
/titanic_50/usr/src/cmd/sgs/ldd/common/
H A Dldd.c398 GElf_Ehdr ehdr; in elf_check() local
405 if (gelf_getehdr(elf, &ehdr) == NULL) { in elf_check()
414 if ((ehdr.e_machine != M_MACH_32) && (ehdr.e_machine != M_MACH_64) && in elf_check()
415 (ehdr.e_machine != M_MACHPLUS)) { in elf_check()
417 conv_ehdr_mach(ehdr.e_machine, 0, &inv_buf)); in elf_check()
424 if (ehdr.e_ident[EI_DATA] != M_DATA) { in elf_check()
426 conv_ehdr_data(ehdr.e_ident[EI_DATA], 0, &inv_buf)); in elf_check()
433 switch (class = ehdr.e_ident[EI_CLASS]) { in elf_check()
440 if ((ehdr.e_machine != M_MACH) && in elf_check()
441 ((ehdr.e_flags & M_FLAGSPLUS) == 0)) { in elf_check()
[all …]
/titanic_50/usr/src/tools/ctf/cvt/
H A Dutil.c67 GElf_Ehdr ehdr; in findelfsecidx() local
70 if (gelf_getehdr(elf, &ehdr) == NULL) in findelfsecidx()
82 if ((name = elf_strptr(elf, ehdr.e_shstrndx, in findelfsecidx()
99 GElf_Ehdr ehdr; in elf_ptrsz() local
101 if (gelf_getehdr(elf, &ehdr) == NULL) { in elf_ptrsz()
106 if (ehdr.e_ident[EI_CLASS] == ELFCLASS32) in elf_ptrsz()
108 else if (ehdr.e_ident[EI_CLASS] == ELFCLASS64) in elf_ptrsz()
111 terminate("unknown ELF class %d\n", ehdr.e_ident[EI_CLASS]); in elf_ptrsz()
/titanic_50/usr/src/cmd/dis/
H A Ddis_main.c479 GElf_Ehdr ehdr; in dis_file() local
495 dis_tgt_ehdr(current, &ehdr); in dis_file()
503 switch (ehdr.e_machine) { in dis_file()
505 if (ehdr.e_ident[EI_CLASS] != ELFCLASS32 || in dis_file()
506 ehdr.e_ident[EI_DATA] != ELFDATA2MSB) { in dis_file()
515 uint64_t flags = ehdr.e_flags & EF_SPARC_32PLUS_MASK; in dis_file()
517 if (ehdr.e_ident[EI_CLASS] != ELFCLASS32 || in dis_file()
518 ehdr.e_ident[EI_DATA] != ELFDATA2MSB) { in dis_file()
533 if (ehdr.e_ident[EI_CLASS] != ELFCLASS64 || in dis_file()
534 ehdr.e_ident[EI_DATA] != ELFDATA2MSB) { in dis_file()
[all …]
/titanic_50/usr/src/lib/libdtrace/common/
H A Ddt_link.c455 Elf32_Ehdr ehdr; in dump_elf32() member
476 elf_file.ehdr.e_ident[EI_MAG0] = ELFMAG0; in dump_elf32()
477 elf_file.ehdr.e_ident[EI_MAG1] = ELFMAG1; in dump_elf32()
478 elf_file.ehdr.e_ident[EI_MAG2] = ELFMAG2; in dump_elf32()
479 elf_file.ehdr.e_ident[EI_MAG3] = ELFMAG3; in dump_elf32()
480 elf_file.ehdr.e_ident[EI_VERSION] = EV_CURRENT; in dump_elf32()
481 elf_file.ehdr.e_ident[EI_CLASS] = ELFCLASS32; in dump_elf32()
483 elf_file.ehdr.e_ident[EI_DATA] = ELFDATA2MSB; in dump_elf32()
485 elf_file.ehdr.e_ident[EI_DATA] = ELFDATA2LSB; in dump_elf32()
487 elf_file.ehdr.e_type = ET_REL; in dump_elf32()
[all …]
/titanic_50/usr/src/cmd/sgs/elfdump/common/
H A Delfdump.c121 Ehdr *ehdr; /* ELF header for file */ member
458 sections(const char *file, Cache *cache, Word shnum, Ehdr *ehdr, uchar_t osabi) in sections() argument
483 if (ehdr->e_type == ET_REL) { in sections()
494 Elf_shdr(0, osabi, ehdr->e_machine, shdr); in sections()
540 unwind_eh_frame(Cache *cache, Word shndx, Word shnum, Phdr *uphdr, Ehdr *ehdr, in unwind_eh_frame() argument
601 &frame_ptr, frame_ptr_enc, ehdr->e_ident, B_TRUE, in unwind_eh_frame()
624 fde_cnt_enc, ehdr->e_ident, B_TRUE, shdr->sh_addr, ndx, in unwind_eh_frame()
650 &initloc, table_enc, ehdr->e_ident, B_TRUE, in unwind_eh_frame()
670 table_enc, ehdr->e_ident, B_TRUE, shdr->sh_addr, in unwind_eh_frame()
697 (ehdr->e_type != ET_REL)) { in unwind_eh_frame()
[all …]
/titanic_50/usr/src/cmd/abi/appcert/static_prof/
H A Dstatic_prof.c430 c->obj->ehdr = (Elf64_Ehdr *) ptr; in obj_elf_hdr()
432 c->obj->ehdr = (Elf32_Ehdr *) ptr; in obj_elf_hdr()
569 if (c->obj->ehdr->e_type == ET_REL) in obj_prog_hdr()
587 if ((c->obj->ehdr->e_phoff == 0) || in obj_prog_hdr()
588 (c->obj->ehdr->e_phnum == 0)) { in obj_prog_hdr()
621 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()
793 if (c->obj->ehdr->e_type == ET_REL) { in obj_app_symtab()
859 Elf64_Ehdr * ehdr) in is_text_section() argument
861 Elf32_Ehdr * ehdr) in is_text_section()
[all …]
/titanic_50/usr/src/psm/stand/boot/common/
H A Dreadfile.c1103 Elf32_Ehdr *ehdr = NULL; in iload32() local
1129 if ((ehdr = (Elf32_Ehdr *)kmem_alloc(sizeof (Elf32_Ehdr), 0)) == NULL) { in iload32()
1134 if (xread(fd, (char *)ehdr, sizeof (*ehdr)) != sizeof (*ehdr)) { in iload32()
1139 size = ehdr->e_shentsize * ehdr->e_shnum; in iload32()
1147 if (lseek(fd, ehdr->e_shoff, 0) == -1 || in iload32()
1152 AUX(*avp, AT_SUN_LDELF, ehdr); in iload32()
1157 for (i = 1; i < ehdr->e_shnum; i++) { in iload32()
1162 sp = (Elf32_Shdr *)(shdrs + (i*ehdr->e_shentsize)); in iload32()
1195 dl_entry = (uintptr_t)load + ehdr->e_entry; in iload32()
1238 if (ehdr) in iload32()
[all …]
/titanic_50/usr/src/lib/libtnfctl/
H A Dtraverse.c54 GElf_Ehdr *ehdr, ehdr_obj; in _tnfctl_traverse_object() local
76 if ((ehdr = gelf_getehdr(elf, &ehdr_obj)) == NULL) { in _tnfctl_traverse_object()
82 if ((ehdr->e_type != ET_EXEC) && (ehdr->e_type != ET_DYN)) { in _tnfctl_traverse_object()
90 if (ehdr->e_type == ET_EXEC) in _tnfctl_traverse_object()
93 strs = elf_strptr(elf, ehdr->e_shstrndx, NULL); in _tnfctl_traverse_object()
97 tnf_long, num_sections_found, ehdr->e_shnum); in _tnfctl_traverse_object()
99 for (idx = 1; idx < ehdr->e_shnum; idx++) { in _tnfctl_traverse_object()
/titanic_50/usr/src/cmd/mdb/common/mdb/
H A Dmdb_gelf.c582 gelf32_init(mdb_gelf_file_t *gf, mdb_io_t *io, const Elf32_Ehdr *ehdr) in gelf32_init() argument
587 bcopy(ehdr->e_ident, gf->gf_ehdr.e_ident, EI_NIDENT); in gelf32_init()
589 gf->gf_ehdr.e_type = ehdr->e_type; in gelf32_init()
590 gf->gf_ehdr.e_machine = ehdr->e_machine; in gelf32_init()
591 gf->gf_ehdr.e_version = ehdr->e_version; in gelf32_init()
592 gf->gf_ehdr.e_entry = ehdr->e_entry; in gelf32_init()
593 gf->gf_ehdr.e_phoff = ehdr->e_phoff; in gelf32_init()
594 gf->gf_ehdr.e_shoff = ehdr->e_shoff; in gelf32_init()
595 gf->gf_ehdr.e_flags = ehdr->e_flags; in gelf32_init()
596 gf->gf_ehdr.e_ehsize = ehdr->e_ehsize; in gelf32_init()
[all …]
/titanic_50/usr/src/cmd/sgs/librtld_db/i386/
H A Dplt32_resolution.c54 Ehdr ehdr; in rli_func() local
70 if (ps_pread(rap->rd_psp, rl->rl_base, (char *)&ehdr, in rli_func()
77 if (ehdr.e_type == ET_EXEC) in rli_func()
82 off = rl->rl_base + ehdr.e_phoff; in rli_func()
83 for (i = 0; i < ehdr.e_phnum; i++) { in rli_func()
100 off += ehdr.e_phentsize; in rli_func()

12345