/titanic_44/usr/src/man/man3elf/ |
H A D | Makefile | 19 MANSECT= 3elf 21 MANFILES= elf.3elf \ 22 elf32_checksum.3elf \ 23 elf32_fsize.3elf \ 24 elf32_getehdr.3elf \ 25 elf32_getphdr.3elf \ 26 elf32_getshdr.3elf \ 27 elf32_xlatetof.3elf \ 28 elf_begin.3elf \ 29 elf_cntl.3elf \ [all …]
|
/titanic_44/usr/src/cmd/sgs/libelf/common/ |
H A D | begin.c | 53 register Elf *elf; in _elf_member() local 79 if ((elf = (Elf *)calloc(1, sizeof (Elf))) == 0) { in _elf_member() 84 elf->ed_parent = ref; in _elf_member() 85 elf->ed_fd = fd; in _elf_member() 86 elf->ed_myflags |= flags; in _elf_member() 87 elf->ed_armem = mh; in _elf_member() 88 elf->ed_fsz = mh->m_hdr.ar_size; in _elf_member() 89 elf->ed_baseoff = ref->ed_baseoff + base; in _elf_member() 90 elf->ed_memoff = base - mh->m_slide; in _elf_member() 91 elf->ed_siboff = base + elf->ed_fsz + (elf->ed_fsz & 1); in _elf_member() [all …]
|
H A D | cook.c | 112 _elf_slide(Elf * elf) in _elf_slide() argument 114 NOTE(ASSUMING_PROTECTED(*elf)) in _elf_slide() 115 Elf *par = elf->ed_parent; in _elf_slide() 118 register char *src = elf->ed_ident; in _elf_slide() 127 if (elf->ed_ident[EI_CLASS] == ELFCLASS64) in _elf_slide() 131 if ((sz = (size_t)(src - (char *)elf->ed_image) % szof) == 0) in _elf_slide() 134 elf->ed_ident -= sz; in _elf_slide() 135 elf->ed_memoff -= sz; in _elf_slide() 136 elf->ed_armem->m_slide = sz; in _elf_slide() 137 if (_elf_vm(par, elf->ed_memoff, sz + elf->ed_fsz) != OK_YES) in _elf_slide() [all …]
|
H A D | clscook.c | 92 _elf_prepscn(Elf *elf, size_t cnt) in _elf_prepscn() argument 94 NOTE(ASSUMING_PROTECTED(*elf)) in _elf_prepscn() 106 elf->ed_scntabsz = cnt; in _elf_prepscn() 108 elf->ed_hdscn = s; in _elf_prepscn() 111 s->s_elf = elf; in _elf_prepscn() 113 s->s_index = s - elf->ed_hdscn; in _elf_prepscn() 126 elf->ed_tlscn = --s; in _elf_prepscn() 135 s = elf->ed_hdscn; in _elf_prepscn() 148 Elf * elf; in _elf_cookscn() 166 elf = s->s_elf; in _elf_cookscn() [all …]
|
H A D | end.c | 39 elf_end(Elf * elf) in elf_end() argument 46 if (elf == 0) in elf_end() 49 ELFWLOCK(elf) in elf_end() 50 if (--elf->ed_activ != 0) { in elf_end() 51 rc = elf->ed_activ; in elf_end() 52 ELFUNLOCK(elf) in elf_end() 57 while (elf->ed_activ == 0) { in elf_end() 58 for (s = elf->ed_hdscn; s != 0; s = s->s_next) { in elf_end() 93 for (l = elf->ed_memlist; l; l = (Memlist *)trail) { in elf_end() 101 if (elf->ed_myflags & EDF_EHALLOC) in elf_end() [all …]
|
H A D | flag.c | 41 Elf * elf; in elf_flagdata() local 49 elf = scn->s_elf; in elf_flagdata() 51 READLOCKS(elf, scn) in elf_flagdata() 59 READUNLOCKS(elf, scn) in elf_flagdata() 65 elf_flagehdr(Elf * elf, Elf_Cmd cmd, unsigned flags) in elf_flagehdr() argument 68 if (elf == 0) in elf_flagehdr() 71 ELFWLOCK(elf) in elf_flagehdr() 72 rc = elf->ed_ehflags |= flags; in elf_flagehdr() 73 ELFUNLOCK(elf) in elf_flagehdr() 77 ELFWLOCK(elf) in elf_flagehdr() [all …]
|
H A D | newscn.c | 38 elf_newscn(Elf * elf) in elf_newscn() argument 42 if (elf == 0) in elf_newscn() 45 ELFWLOCK(elf) in elf_newscn() 50 if ((elf->ed_hdscn == 0) && (_elf_cook(elf) != OK_YES)) { in elf_newscn() 51 ELFUNLOCK(elf) in elf_newscn() 54 if (elf->ed_ehdr == 0) { in elf_newscn() 56 ELFUNLOCK(elf) in elf_newscn() 60 if (elf->ed_class == ELFCLASS32) { in elf_newscn() 63 if (elf->ed_hdscn == 0) { in elf_newscn() 65 ELFUNLOCK(elf) in elf_newscn() [all …]
|
H A D | newphdr.c | 67 elf_newphdr(Elf * elf, size_t count) in elf_newphdr() argument 74 if (elf == 0) in elf_newphdr() 76 ELFRLOCK(elf) in elf_newphdr() 77 if (elf->ed_class != ELFCLASS) { in elf_newphdr() 79 ELFUNLOCK(elf) in elf_newphdr() 82 ELFUNLOCK(elf) in elf_newphdr() 83 if (elf_getehdr(elf) == 0) { /* this cooks if necessary */ in elf_newphdr() 94 ELFWLOCK(elf) in elf_newphdr() 95 if (elf->ed_myflags & EDF_PHALLOC) { in elf_newphdr() 96 elf->ed_myflags &= ~EDF_PHALLOC; in elf_newphdr() [all …]
|
H A D | input.c | 87 _elf_vm(Elf * elf, size_t base, size_t sz) in _elf_vm() argument 89 NOTE(ASSUMING_PROTECTED(*elf)) in _elf_vm() 101 if ((base + sz) > elf->ed_fsz) { in _elf_vm() 113 if (elf->ed_vm == 0 || sz == 0) in _elf_vm() 123 if (elf->ed_parent && elf->ed_parent->ed_fd == -1) in _elf_vm() 124 elf->ed_fd = -1; in _elf_vm() 126 base += elf->ed_baseoff; in _elf_vm() 131 hdreg = &elf->ed_vm[REGNUM(base)]; in _elf_vm() 132 tlreg = &elf->ed_vm[REGNUM(tail)]; in _elf_vm() 151 iop = (Elf_Void *)(elf->ed_image + off); in _elf_vm() [all …]
|
H A D | newehdr.c | 64 elf_newehdr(Elf * elf) in elf_newehdr() argument 68 if (elf == 0) in elf_newehdr() 75 ELFWLOCK(elf) in elf_newehdr() 76 if (elf->ed_myflags & EDF_READ) { in elf_newehdr() 77 ELFUNLOCK(elf) in elf_newehdr() 78 if ((eh = (Ehdr *)getehdr(elf)) != 0) { in elf_newehdr() 79 ELFWLOCK(elf) in elf_newehdr() 80 elf->ed_ehflags |= ELF_F_DIRTY; in elf_newehdr() 81 ELFUNLOCK(elf) in elf_newehdr() 90 if (elf->ed_class == ELFCLASSNONE) in elf_newehdr() [all …]
|
H A D | getarsym.c | 177 elf_getarsym(Elf *elf, size_t *ptr) in elf_getarsym() argument 186 if (elf == NULL) in elf_getarsym() 188 ELFRLOCK(elf); in elf_getarsym() 189 if (elf->ed_kind != ELF_K_AR) { in elf_getarsym() 190 ELFUNLOCK(elf); in elf_getarsym() 194 if ((as = (Byte *)elf->ed_arsym) == 0) { in elf_getarsym() 195 ELFUNLOCK(elf); in elf_getarsym() 198 if (elf->ed_myflags & EDF_ASALLOC) { in elf_getarsym() 200 *ptr = elf->ed_arsymsz; in elf_getarsym() 201 ELFUNLOCK(elf); in elf_getarsym() [all …]
|
H A D | rawfile.c | 37 elf_rawfile(Elf *elf, size_t *ptr) in elf_rawfile() argument 42 if (elf == 0) { in elf_rawfile() 48 ELFWLOCK(elf) in elf_rawfile() 49 if ((sz = elf->ed_fsz) == 0) { in elf_rawfile() 52 ELFUNLOCK(elf) in elf_rawfile() 56 if (elf->ed_raw != 0) in elf_rawfile() 57 p = elf->ed_raw; in elf_rawfile() 58 else if (elf->ed_status == ES_COOKED) { in elf_rawfile() 59 if ((p = _elf_read(elf->ed_fd, elf->ed_baseoff, sz)) != 0) { in elf_rawfile() 60 elf->ed_raw = p; in elf_rawfile() [all …]
|
H A D | update.c | 156 _elf_upd_lib(Elf * elf) in _elf_upd_lib() argument 158 NOTE(ASSUMING_PROTECTED(*elf)) in _elf_upd_lib() 163 Ehdr * eh = elf->ed_ehdr; in _elf_upd_lib() 202 if ((s = elf->ed_hdscn) == 0) { in _elf_upd_lib() 230 if ((sz = (Lword)_elf_entsz(elf, sh->sh_type, ver)) != 0) in _elf_upd_lib() 318 sh = (Shdr *)elf->ed_hdscn->s_shdr; in _elf_upd_lib() 341 _elf_upd_usr(Elf * elf) in _elf_upd_usr() argument 343 NOTE(ASSUMING_PROTECTED(*elf)) in _elf_upd_usr() 347 Ehdr * eh = elf->ed_ehdr; in _elf_upd_usr() 387 if ((s = elf->ed_hdscn) == 0) { in _elf_upd_usr() [all …]
|
H A D | getscn.c | 38 elf_getscn(Elf * elf, size_t index) in elf_getscn() argument 45 if (elf == 0) in elf_getscn() 48 ELFRLOCK(elf) in elf_getscn() 49 tabsz = elf->ed_scntabsz; in elf_getscn() 50 if (elf->ed_hdscn == 0) { in elf_getscn() 51 ELFUNLOCK(elf) in elf_getscn() 52 ELFWLOCK(elf) in elf_getscn() 53 if ((elf->ed_hdscn == 0) && (_elf_cook(elf) != OK_YES)) { in elf_getscn() 54 ELFUNLOCK(elf); in elf_getscn() 57 ELFUNLOCK(elf); in elf_getscn() [all …]
|
H A D | getident.c | 37 elf_getident(Elf *elf, size_t *ptr) in elf_getident() argument 42 if (elf != 0) { in elf_getident() 43 ELFRLOCK(elf) in elf_getident() 44 if (elf->ed_identsz != 0) { in elf_getident() 45 if ((elf->ed_vm == 0) || (elf->ed_status != in elf_getident() 51 ELFUNLOCK(elf) in elf_getident() 52 ELFWLOCK(elf) in elf_getident() 53 if ((_elf_cook(elf) == OK_YES) && in elf_getident() 54 (_elf_vm(elf, (size_t)0, in elf_getident() 55 elf->ed_identsz) == OK_YES)) { in elf_getident() [all …]
|
H A D | cntl.c | 37 elf_cntl(Elf * elf, Elf_Cmd cmd) in elf_cntl() argument 40 if (elf == 0) in elf_cntl() 42 ELFWLOCK(elf); in elf_cntl() 48 if ((elf->ed_myflags & EDF_READ) == 0) { in elf_cntl() 50 ELFUNLOCK(elf); in elf_cntl() 53 if ((elf->ed_status != ES_FROZEN) && in elf_cntl() 54 ((_elf_cook(elf) != OK_YES) || in elf_cntl() 55 (_elf_vm(elf, (size_t)0, elf->ed_fsz) != OK_YES))) in elf_cntl() 57 elf->ed_fd = -1; in elf_cntl() 58 ELFUNLOCK(elf); in elf_cntl() [all …]
|
H A D | rand.c | 34 elf_rand(Elf * elf, size_t off) in elf_rand() argument 36 if (elf == 0) in elf_rand() 38 ELFWLOCK(elf) in elf_rand() 39 if (elf->ed_kind != ELF_K_AR) { in elf_rand() 41 ELFUNLOCK(elf) in elf_rand() 44 if ((off == 0) || (elf->ed_fsz < off)) { in elf_rand() 46 ELFUNLOCK(elf) in elf_rand() 49 elf->ed_nextoff = off; in elf_rand() 50 ELFUNLOCK(elf) in elf_rand() 60 _elf_getnextoff(Elf *elf) in _elf_getnextoff() argument [all …]
|
H A D | getdata.c | 108 #define NALIGN(elf) ((elf->ed_class == ELFCLASS32) ? Nalign32 : Nalign64) argument 109 #define ALIGN(elf) ((elf->ed_class == ELFCLASS32) ? align32 : align64) argument 116 Elf * elf; in _elf_locked_getdata() local 122 elf = scn->s_elf; in _elf_locked_getdata() 125 UPGRADELOCKS(elf, scn) in _elf_locked_getdata() 132 DOWNGRADELOCKS(elf, scn) in _elf_locked_getdata() 158 elf = scn->s_elf; in _elf_locked_getdata() 176 if (elf->ed_class == ELFCLASS32) { in _elf_locked_getdata() 182 (sz > 1) && (sz != elf32_fsize(t, 1, elf->ed_version))) { in _elf_locked_getdata() 186 } else if (elf->ed_class == ELFCLASS64) { in _elf_locked_getdata() [all …]
|
H A D | rawdata.c | 44 Elf * elf; in elf_rawdata() local 48 elf = scn->s_elf; in elf_rawdata() 49 READLOCKS(elf, scn) in elf_rawdata() 51 UPGRADELOCKS(elf, scn) in elf_rawdata() 54 DOWNGRADELOCKS(elf, scn) in elf_rawdata() 63 READUNLOCKS(elf, scn) in elf_rawdata() 69 READUNLOCKS(elf, scn) in elf_rawdata() 81 READUNLOCKS(elf, scn) in elf_rawdata() 86 READUNLOCKS(elf, scn) in elf_rawdata() 94 READUNLOCKS(elf, scn) in elf_rawdata() [all …]
|
H A D | getehdr.c | 38 getehdr(Elf * elf, int class) in getehdr() argument 41 if (elf == 0) in getehdr() 43 ELFWLOCK(elf); in getehdr() 44 if (elf->ed_class != class) { in getehdr() 46 ELFUNLOCK(elf); in getehdr() 49 if (elf->ed_ehdr == 0) in getehdr() 50 (void) _elf_cook(elf); in getehdr() 52 rc = elf->ed_ehdr; in getehdr() 53 ELFUNLOCK(elf); in getehdr() 60 elf32_getehdr(Elf * elf) in elf32_getehdr() argument [all …]
|
H A D | getphdr.c | 38 getphdr(Elf * elf, int class) in getphdr() argument 41 if (elf == 0) in getphdr() 43 ELFWLOCK(elf); in getphdr() 44 if (elf->ed_class != class) { in getphdr() 46 ELFUNLOCK(elf); in getphdr() 49 if (elf->ed_phdr == 0) in getphdr() 50 (void) _elf_cook(elf); in getphdr() 51 rc = elf->ed_phdr; in getphdr() 52 ELFUNLOCK(elf); in getphdr() 58 elf32_getphdr(Elf * elf) in elf32_getphdr() argument [all …]
|
H A D | getbase.c | 35 elf_getbase(Elf *elf) in elf_getbase() argument 38 if (elf == NULL) in elf_getbase() 40 ELFRLOCK(elf) in elf_getbase() 41 rc = elf->ed_baseoff; in elf_getbase() 42 ELFUNLOCK(elf) in elf_getbase() 55 _elf_getarhdrbase(Elf *elf) in _elf_getarhdrbase() argument 58 if (elf == NULL) in _elf_getarhdrbase() 60 ELFRLOCK(elf) in _elf_getarhdrbase() 61 if (elf->ed_parent == NULL) { in _elf_getarhdrbase() 63 ELFUNLOCK(elf); in _elf_getarhdrbase() [all …]
|
H A D | ar.c | 122 _elf_armem(Elf *elf, char *file, size_t fsz) in _elf_armem() argument 137 for (l = elf->ed_memlist, ol = l; l; ol = l, l = l->m_next) in _elf_armem() 155 if ((elf->ed_memlist == 0) || (ol->m_free == ol->m_end)) { in _elf_armem() 166 if (elf->ed_memlist == 0) in _elf_armem() 167 elf->ed_memlist = l; in _elf_armem() 203 if (j < elf->ed_arstrsz) in _elf_armem() 204 m->m_hdr.ar_name = elf->ed_arstr + j; in _elf_armem() 268 _elf_arinit(Elf * elf) in _elf_arinit() argument 270 char *base = elf->ed_ident; in _elf_arinit() 271 register char *end = base + elf->ed_fsz; in _elf_arinit() [all …]
|
/titanic_44/usr/src/pkg/manifests/ |
H A D | system-library.man3elf.inc | 17 file path=usr/share/man/man3elf/elf.3elf 18 file path=usr/share/man/man3elf/elf32_checksum.3elf 19 file path=usr/share/man/man3elf/elf32_fsize.3elf 20 file path=usr/share/man/man3elf/elf32_getehdr.3elf 21 file path=usr/share/man/man3elf/elf32_getphdr.3elf 22 file path=usr/share/man/man3elf/elf32_getshdr.3elf 23 file path=usr/share/man/man3elf/elf32_xlatetof.3elf 24 file path=usr/share/man/man3elf/elf_begin.3elf 25 file path=usr/share/man/man3elf/elf_cntl.3elf 26 file path=usr/share/man/man3elf/elf_errmsg.3elf [all …]
|
/titanic_44/usr/src/uts/intel/elfexec/ |
H A D | Makefile | 106 $(OBJS_DIR)/elf32.o: $(UTSBASE)/common/exec/elf/elf.c 107 $(COMPILE.c) -o $@ -D_ELF32_COMPAT $(UTSBASE)/common/exec/elf/elf.c 109 $(OBJS_DIR)/elf32_notes.o: $(UTSBASE)/common/exec/elf/elf_notes.c 110 $(COMPILE.c) -o $@ -D_ELF32_COMPAT $(UTSBASE)/common/exec/elf/elf_notes.c 112 $(OBJS_DIR)/old32_notes.o: $(UTSBASE)/common/exec/elf/old_notes.c 113 $(COMPILE.c) -o $@ -D_ELF32_COMPAT $(UTSBASE)/common/exec/elf/old_notes.c 115 $(LINTS_DIR)/elf32.ln: $(UTSBASE)/common/exec/elf/elf.c 116 @($(LHEAD) $(LINT.c) -Celf32 -D_ELF32_COMPAT $(UTSBASE)/common/exec/elf/elf.c $(LTAIL)) 119 $(LINTS_DIR)/elf32_notes.ln: $(UTSBASE)/common/exec/elf/elf_notes.c 120 @($(LHEAD) $(LINT.c) -Celf32_notes -D_ELF32_COMPAT $(UTSBASE)/common/exec/elf/elf_notes.c $(LTAIL)) [all …]
|