| /illumos-gate/usr/src/man/man3elf/ |
| H A D | Manlink | 16 elf32_checksum.3elf 17 elf64_checksum.3elf 18 elf32_fsize.3elf 19 elf64_fsize.3elf 20 elf32_getehdr.3elf 21 elf32_newehdr.3elf 22 elf64_getehdr.3elf 23 elf64_newehdr.3elf 24 elf32_getphdr.3elf 25 elf32_newphdr.3elf [all …]
|
| 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 …]
|
| /illumos-gate/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 link path=usr/share/man/man3elf/elf32_newehdr.3elf target=elf32_getehdr.3elf 24 link path=usr/share/man/man3elf/elf32_newphdr.3elf target=elf32_getphdr.3elf 25 file path=usr/share/man/man3elf/elf32_xlatetof.3elf 26 link path=usr/share/man/man3elf/elf32_xlatetom.3elf target=elf32_xlatetof.3elf [all …]
|
| H A D | system-test-elftest.p5m | 21 dir path=opt/elf-tests 22 file path=opt/elf-tests/README mode=0444 23 dir path=opt/elf-tests/bin 24 file path=opt/elf-tests/bin/elftest mode=0555 25 dir path=opt/elf-tests/runfiles 26 file path=opt/elf-tests/runfiles/default.run mode=0444 27 dir path=opt/elf-tests/tests 28 dir path=opt/elf-tests/tests/assert-deflib 29 file path=opt/elf-tests/tests/assert-deflib/link.c mode=0444 30 file path=opt/elf-tests/tests/assert-deflib/test-deflib mode=0555 [all …]
|
| /illumos-gate/usr/src/cmd/sgs/libelf/common/ |
| H A D | begin.c | 51 register Elf *elf; in _elf_member() local 77 if ((elf = (Elf *)calloc(1, sizeof (Elf))) == 0) { in _elf_member() 82 elf->ed_parent = ref; in _elf_member() 83 elf->ed_fd = fd; in _elf_member() 84 elf->ed_myflags |= flags; in _elf_member() 85 elf->ed_armem = mh; in _elf_member() 86 elf->ed_fsz = mh->m_hdr.ar_size; in _elf_member() 87 elf->ed_baseoff = ref->ed_baseoff + base; in _elf_member() 88 elf->ed_memoff = base - mh->m_slide; in _elf_member() 89 elf->ed_siboff = base + elf->ed_fsz + (elf->ed_fsz & 1); in _elf_member() [all …]
|
| H A D | cook.c | 108 _elf_slide(Elf * elf) in _elf_slide() argument 110 Elf *par = elf->ed_parent; in _elf_slide() 113 register char *src = elf->ed_ident; in _elf_slide() 122 if (elf->ed_ident[EI_CLASS] == ELFCLASS64) in _elf_slide() 126 if ((sz = (size_t)(src - (char *)elf->ed_image) % szof) == 0) in _elf_slide() 129 elf->ed_ident -= sz; in _elf_slide() 130 elf->ed_memoff -= sz; in _elf_slide() 131 elf->ed_armem->m_slide = sz; in _elf_slide() 132 if (_elf_vm(par, elf->ed_memoff, sz + elf->ed_fsz) != OK_YES) in _elf_slide() 140 if ((elf->ed_vm == 0) && ((elf->ed_myflags & EDF_WRITE) == 0) && in _elf_slide() [all …]
|
| H A D | clscook.c | 92 _elf_prepscn(Elf *elf, size_t cnt) in _elf_prepscn() argument 104 elf->ed_scntabsz = cnt; in _elf_prepscn() 106 elf->ed_hdscn = s; in _elf_prepscn() 109 s->s_elf = elf; in _elf_prepscn() 111 s->s_index = s - elf->ed_hdscn; in _elf_prepscn() 124 elf->ed_tlscn = --s; in _elf_prepscn() 133 s = elf->ed_hdscn; in _elf_prepscn() 144 Elf * elf; in _elf_cookscn() local 161 elf = s->s_elf; in _elf_cookscn() 167 d->db_data.d_version = elf->ed_version; in _elf_cookscn() [all …]
|
| H A D | flag.c | 39 Elf * elf; in elf_flagdata() local 47 elf = scn->s_elf; in elf_flagdata() 49 READLOCKS(elf, scn) in elf_flagdata() 57 READUNLOCKS(elf, scn) in elf_flagdata() 63 elf_flagehdr(Elf * elf, Elf_Cmd cmd, unsigned flags) in elf_flagehdr() argument 66 if (elf == 0) in elf_flagehdr() 69 ELFWLOCK(elf) in elf_flagehdr() 70 rc = elf->ed_ehflags |= flags; in elf_flagehdr() 71 ELFUNLOCK(elf) in elf_flagehdr() 75 ELFWLOCK(elf) in elf_flagehdr() [all …]
|
| H A D | newscn.c | 36 elf_newscn(Elf * elf) in elf_newscn() argument 40 if (elf == 0) in elf_newscn() 43 ELFWLOCK(elf) in elf_newscn() 48 if ((elf->ed_hdscn == 0) && (_elf_cook(elf) != OK_YES)) { in elf_newscn() 49 ELFUNLOCK(elf) in elf_newscn() 52 if (elf->ed_ehdr == 0) { in elf_newscn() 54 ELFUNLOCK(elf) in elf_newscn() 58 if (elf->ed_class == ELFCLASS32) { in elf_newscn() 61 if (elf->ed_hdscn == 0) { in elf_newscn() 63 ELFUNLOCK(elf) in elf_newscn() [all …]
|
| H A D | end.c | 37 elf_end(Elf *elf) in elf_end() argument 44 if (elf == NULL) in elf_end() 47 ELFWLOCK(elf) in elf_end() 48 if (--elf->ed_activ != 0) { in elf_end() 49 rc = elf->ed_activ; in elf_end() 50 ELFUNLOCK(elf) in elf_end() 54 while (elf->ed_activ == 0) { in elf_end() 55 for (s = elf->ed_hdscn; s != NULL; s = s->s_next) { in elf_end() 90 for (l = elf->ed_memlist; l != NULL; in elf_end() 99 if (elf->ed_myflags & EDF_EHALLOC) in elf_end() [all …]
|
| H A D | newphdr.c | 65 elf_newphdr(Elf * elf, size_t count) in elf_newphdr() argument 72 if (elf == 0) in elf_newphdr() 74 ELFRLOCK(elf) in elf_newphdr() 75 if (elf->ed_class != ELFCLASS) { in elf_newphdr() 77 ELFUNLOCK(elf) in elf_newphdr() 80 ELFUNLOCK(elf) in elf_newphdr() 81 if (elf_getehdr(elf) == 0) { /* this cooks if necessary */ in elf_newphdr() 92 ELFWLOCK(elf) in elf_newphdr() 93 if (elf->ed_myflags & EDF_PHALLOC) { in elf_newphdr() 94 elf->ed_myflags &= ~EDF_PHALLOC; in elf_newphdr() [all …]
|
| H A D | input.c | 83 _elf_vm(Elf * elf, size_t base, size_t sz) in _elf_vm() argument 96 if ((base + sz) > elf->ed_fsz) { in _elf_vm() 108 if (elf->ed_vm == 0 || sz == 0) in _elf_vm() 118 if (elf->ed_parent && elf->ed_parent->ed_fd == -1) in _elf_vm() 119 elf->ed_fd = -1; in _elf_vm() 121 base += elf->ed_baseoff; in _elf_vm() 126 hdreg = &elf->ed_vm[REGNUM(base)]; in _elf_vm() 127 tlreg = &elf->ed_vm[REGNUM(tail)]; in _elf_vm() 146 iop = (Elf_Void *)(elf->ed_image + off); in _elf_vm() 150 if (elf->ed_imagesz - off < sz) in _elf_vm() [all …]
|
| H A D | newehdr.c | 62 elf_newehdr(Elf * elf) in elf_newehdr() argument 66 if (elf == 0) in elf_newehdr() 73 ELFWLOCK(elf) in elf_newehdr() 74 if (elf->ed_myflags & EDF_READ) { in elf_newehdr() 75 ELFUNLOCK(elf) in elf_newehdr() 76 if ((eh = (Ehdr *)getehdr(elf)) != 0) { in elf_newehdr() 77 ELFWLOCK(elf) in elf_newehdr() 78 elf->ed_ehflags |= ELF_F_DIRTY; in elf_newehdr() 79 ELFUNLOCK(elf) in elf_newehdr() 88 if (elf->ed_class == ELFCLASSNONE) in elf_newehdr() [all …]
|
| H A D | update.c | 160 _elf_upd_lib(Elf * elf) in _elf_upd_lib() argument 166 Ehdr * eh = elf->ed_ehdr; in _elf_upd_lib() 205 if ((s = elf->ed_hdscn) == 0) { in _elf_upd_lib() 233 if ((sz = (Lword)_elf_entsz(elf, sh->sh_type, ver)) != 0) in _elf_upd_lib() 321 sh = (Shdr *)elf->ed_hdscn->s_shdr; in _elf_upd_lib() 344 _elf_upd_usr(Elf * elf) in _elf_upd_usr() argument 349 Ehdr * eh = elf->ed_ehdr; in _elf_upd_usr() 389 if ((s = elf->ed_hdscn) == 0) { in _elf_upd_usr() 437 sh = (Shdr *)elf->ed_hdscn->s_shdr; in _elf_upd_usr() 458 wrt(Elf * elf, Xword outsz, unsigned fill, int update_cmd) in wrt() argument [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 | 35 elf_rawfile(Elf *elf, size_t *ptr) in elf_rawfile() argument 40 if (elf == 0) { in elf_rawfile() 46 ELFWLOCK(elf) in elf_rawfile() 47 if ((sz = elf->ed_fsz) == 0) { in elf_rawfile() 50 ELFUNLOCK(elf) in elf_rawfile() 54 if (elf->ed_raw != 0) in elf_rawfile() 55 p = elf->ed_raw; in elf_rawfile() 56 else if (elf->ed_status == ES_COOKED) { in elf_rawfile() 57 if ((p = _elf_read(elf->ed_fd, elf->ed_baseoff, sz)) != 0) { in elf_rawfile() 58 elf->ed_raw = p; in elf_rawfile() [all …]
|
| H A D | getdata.c | 106 #define NALIGN(elf) ((elf->ed_class == ELFCLASS32) ? Nalign32 : Nalign64) argument 107 #define ALIGN(elf) ((elf->ed_class == ELFCLASS32) ? align32 : align64) argument 114 Elf * elf; in _elf_locked_getdata() local 120 elf = scn->s_elf; in _elf_locked_getdata() 123 UPGRADELOCKS(elf, scn) in _elf_locked_getdata() 130 DOWNGRADELOCKS(elf, scn) in _elf_locked_getdata() 156 elf = scn->s_elf; in _elf_locked_getdata() 174 if (elf->ed_class == ELFCLASS32) { in _elf_locked_getdata() 180 (sz > 1) && (sz != elf32_fsize(t, 1, elf->ed_version))) { in _elf_locked_getdata() 184 } else if (elf->ed_class == ELFCLASS64) { in _elf_locked_getdata() [all …]
|
| H A D | getscn.c | 36 elf_getscn(Elf * elf, size_t index) in elf_getscn() argument 43 if (elf == 0) in elf_getscn() 46 ELFRLOCK(elf) in elf_getscn() 47 tabsz = elf->ed_scntabsz; in elf_getscn() 48 if (elf->ed_hdscn == 0) { in elf_getscn() 49 ELFUNLOCK(elf) in elf_getscn() 50 ELFWLOCK(elf) in elf_getscn() 51 if ((elf->ed_hdscn == 0) && (_elf_cook(elf) != OK_YES)) { in elf_getscn() 52 ELFUNLOCK(elf); in elf_getscn() 55 ELFUNLOCK(elf); in elf_getscn() [all …]
|
| H A D | getident.c | 35 elf_getident(Elf *elf, size_t *ptr) in elf_getident() argument 40 if (elf != 0) { in elf_getident() 41 ELFRLOCK(elf) in elf_getident() 42 if (elf->ed_identsz != 0) { in elf_getident() 43 if ((elf->ed_vm == 0) || (elf->ed_status != in elf_getident() 49 ELFUNLOCK(elf) in elf_getident() 50 ELFWLOCK(elf) in elf_getident() 51 if ((_elf_cook(elf) == OK_YES) && in elf_getident() 52 (_elf_vm(elf, (size_t)0, in elf_getident() 53 elf->ed_identsz) == OK_YES)) { in elf_getident() [all …]
|
| H A D | cntl.c | 35 elf_cntl(Elf * elf, Elf_Cmd cmd) in elf_cntl() argument 38 if (elf == 0) in elf_cntl() 40 ELFWLOCK(elf); in elf_cntl() 46 if ((elf->ed_myflags & EDF_READ) == 0) { in elf_cntl() 48 ELFUNLOCK(elf); in elf_cntl() 51 if ((elf->ed_status != ES_FROZEN) && in elf_cntl() 52 ((_elf_cook(elf) != OK_YES) || in elf_cntl() 53 (_elf_vm(elf, (size_t)0, elf->ed_fsz) != OK_YES))) in elf_cntl() 55 elf->ed_fd = -1; in elf_cntl() 56 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 | rawdata.c | 42 Elf * elf; in elf_rawdata() local 46 elf = scn->s_elf; in elf_rawdata() 47 READLOCKS(elf, scn) in elf_rawdata() 49 UPGRADELOCKS(elf, scn) in elf_rawdata() 52 DOWNGRADELOCKS(elf, scn) in elf_rawdata() 61 READUNLOCKS(elf, scn) in elf_rawdata() 67 READUNLOCKS(elf, scn) in elf_rawdata() 79 READUNLOCKS(elf, scn) in elf_rawdata() 84 READUNLOCKS(elf, scn) in elf_rawdata() 92 READUNLOCKS(elf, scn) in elf_rawdata() [all …]
|
| H A D | getehdr.c | 36 getehdr(Elf * elf, int class) in getehdr() argument 39 if (elf == 0) in getehdr() 41 ELFWLOCK(elf); in getehdr() 42 if (elf->ed_class != class) { in getehdr() 44 ELFUNLOCK(elf); in getehdr() 47 if (elf->ed_ehdr == 0) in getehdr() 48 (void) _elf_cook(elf); in getehdr() 50 rc = elf->ed_ehdr; in getehdr() 51 ELFUNLOCK(elf); in getehdr() 58 elf32_getehdr(Elf * elf) in elf32_getehdr() argument [all …]
|
| H A D | getphdr.c | 36 getphdr(Elf * elf, int class) in getphdr() argument 39 if (elf == 0) in getphdr() 41 ELFWLOCK(elf); in getphdr() 42 if (elf->ed_class != class) { in getphdr() 44 ELFUNLOCK(elf); in getphdr() 47 if (elf->ed_phdr == 0) in getphdr() 48 (void) _elf_cook(elf); in getphdr() 49 rc = elf->ed_phdr; in getphdr() 50 ELFUNLOCK(elf); in getphdr() 56 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 …]
|