/illumos-gate/usr/src/cmd/mdb/tools/findfp/common/ |
H A D | findsym.c | 38 findelfsym(Elf *elf, uintptr_t addr, char **symnamep, offset_t *offp) argument 45 if ((symtabidx = findelfsecidx(elf, ".symtab")) < 0) 48 if ((scn = elf_getscn(elf, symtabidx)) == NULL || 68 if ((*symnamep = elf_strptr(elf, shdr.sh_link,
|
/illumos-gate/usr/src/cmd/sgs/dump/common/ |
H A D | fcns.c | 46 ar_sym_read(Elf *elf, char *filename) argument 52 if ((arsym = elf_getarsym(elf, &ptr)) == NULL) { 58 is64 = (_elf_getarsymwordsize(elf) == 8);
|
/illumos-gate/usr/src/cmd/sgs/libelf/common/ |
H A D | cook.c | 112 _elf_slide(Elf * elf) argument 114 NOTE(ASSUMING_PROTECTED(*elf)) 115 Elf *par = elf->ed_parent; 118 register char *src = elf->ed_ident; 127 if (elf->ed_ident[EI_CLASS] == ELFCLASS64) 131 if ((sz = (size_t)(src - (char *)elf->ed_image) % szof) == 0) 134 elf->ed_ident -= sz; 135 elf->ed_memoff -= sz; 136 elf->ed_armem->m_slide = sz; 137 if (_elf_vm(par, elf 163 _elf_cook(Elf * elf) argument 234 Elf * elf = s->s_elf; local [all...] |
H A D | flag.c | 41 Elf * elf; local 49 elf = scn->s_elf; 51 READLOCKS(elf, scn) 59 READUNLOCKS(elf, scn) 65 elf_flagehdr(Elf * elf, Elf_Cmd cmd, unsigned flags) argument 68 if (elf == 0) 71 ELFWLOCK(elf) 72 rc = elf->ed_ehflags |= flags; 73 ELFUNLOCK(elf) 77 ELFWLOCK(elf) 88 elf_flagelf(Elf * elf, Elf_Cmd cmd, unsigned flags) argument 111 elf_flagphdr(Elf * elf, Elf_Cmd cmd, unsigned flags) argument 137 Elf * elf; local 164 Elf * elf; local [all...] |
H A D | newphdr.c | 67 elf_newphdr(Elf * elf, size_t count) argument 74 if (elf == 0) 76 ELFRLOCK(elf) 77 if (elf->ed_class != ELFCLASS) { 79 ELFUNLOCK(elf) 82 ELFUNLOCK(elf) 83 if (elf_getehdr(elf) == 0) { /* this cooks if necessary */ 94 ELFWLOCK(elf) 95 if (elf->ed_myflags & EDF_PHALLOC) { 96 elf [all...] |
H A D | strptr.c | 38 elf_strptr(Elf * elf, size_t ndx, size_t off) argument 44 if (elf == 0) 46 if ((s = elf_getscn(elf, ndx)) == 0) { 50 READLOCKS(elf, s) 51 if (elf->ed_class == ELFCLASS32) { 56 READUNLOCKS(elf, s) 59 } else if (elf->ed_class == ELFCLASS64) { 64 READUNLOCKS(elf, s) 69 READUNLOCKS(elf, s) 81 if (elf [all...] |
H A D | begin.c | 53 register Elf *elf; local 79 if ((elf = (Elf *)calloc(1, sizeof (Elf))) == 0) { 84 elf->ed_parent = ref; 85 elf->ed_fd = fd; 86 elf->ed_myflags |= flags; 87 elf->ed_armem = mh; 88 elf->ed_fsz = mh->m_hdr.ar_size; 89 elf->ed_baseoff = ref->ed_baseoff + base; 90 elf->ed_memoff = base - mh->m_slide; 91 elf 113 Elf *elf; local 133 _elf_config(Elf * elf) argument 201 Elf *elf; local 302 register Elf *elf; local [all...] |
H A D | checksum.c | 40 * Routines for generating a checksum for an elf image. Typically used to create 101 elf_checksum(Elf * elf) argument 110 if ((ehdr = getehdr(elf)) == 0) 127 if ((elf->ed_myflags & (EDF_MEMORY | EDF_WRITE)) != 0) 133 if ((scn = elf_getscn(elf, shnum)) == 0)
|
H A D | getarsym.c | 177 elf_getarsym(Elf *elf, size_t *ptr) argument 186 if (elf == NULL) 188 ELFRLOCK(elf); 189 if (elf->ed_kind != ELF_K_AR) { 190 ELFUNLOCK(elf); 194 if ((as = (Byte *)elf->ed_arsym) == 0) { 195 ELFUNLOCK(elf); 198 if (elf->ed_myflags & EDF_ASALLOC) { 200 *ptr = elf->ed_arsymsz; 201 ELFUNLOCK(elf); 242 _elf_getarsymwordsize(Elf *elf) argument [all...] |
H A D | getdata.c | 108 #define NALIGN(elf) ((elf->ed_class == ELFCLASS32) ? Nalign32 : Nalign64) 109 #define ALIGN(elf) ((elf->ed_class == ELFCLASS32) ? align32 : align64) 116 Elf * elf; local 122 elf = scn->s_elf; 125 UPGRADELOCKS(elf, scn) 132 DOWNGRADELOCKS(elf, scn) 158 elf = scn->s_elf; 176 if (elf 301 Elf * elf; local [all...] |
H A D | ar.c | 122 _elf_armem(Elf *elf, char *file, size_t fsz) argument 137 for (l = elf->ed_memlist, ol = l; l; ol = l, l = l->m_next) 155 if ((elf->ed_memlist == 0) || (ol->m_free == ol->m_end)) { 166 if (elf->ed_memlist == 0) 167 elf->ed_memlist = l; 203 if (j < elf->ed_arstrsz) 204 m->m_hdr.ar_name = elf->ed_arstr + j; 268 _elf_arinit(Elf * elf) argument 270 char *base = elf->ed_ident; 271 register char *end = base + elf [all...] |
H A D | input.c | 52 * An elf descriptor has a bit array to manage this. Each bit 87 _elf_vm(Elf * elf, size_t base, size_t sz) argument 89 NOTE(ASSUMING_PROTECTED(*elf)) 101 if ((base + sz) > elf->ed_fsz) { 113 if (elf->ed_vm == 0 || sz == 0) 123 if (elf->ed_parent && elf->ed_parent->ed_fd == -1) 124 elf->ed_fd = -1; 126 base += elf->ed_baseoff; 131 hdreg = &elf 200 _elf_inmap(Elf * elf) argument [all...] |
H A D | clscook.c | 92 _elf_prepscn(Elf *elf, size_t cnt) argument 94 NOTE(ASSUMING_PROTECTED(*elf)) 106 elf->ed_scntabsz = cnt; 108 elf->ed_hdscn = s; 111 s->s_elf = elf; 113 s->s_index = s - elf->ed_hdscn; 126 elf->ed_tlscn = --s; 135 s = elf->ed_hdscn; 148 Elf * elf; local 166 elf 219 _elf_ehdr(Elf * elf, int inplace) argument 296 _elf_phdr(Elf * elf, int inplace) argument 356 _elf_shdr(Elf * elf, int inplace) argument [all...] |
/illumos-gate/usr/src/lib/libdtrace/common/ |
H A D | dlink_common.c | 101 Elf64_Ehdr *elf; local 103 Elf32_Ehdr *elf; local 124 elf = (void *)addr; 127 dh.dofhp_addr = elf->e_type == ET_DYN ? addr : 0;
|
/illumos-gate/usr/src/cmd/sgs/libelf/demo/ |
H A D | acom.c | 46 update_comment(Elf *elf, const char *file, const char *comment) argument 53 if (elf_getshdrstrndx(elf, &shstrndx) == -1) { 59 while ((scn = elf_nextscn(elf, scn)) != NULL) { 70 if (strcmp(CommentStr, elf_strptr(elf, shstrndx, 83 if ((scn = elf_getscn(elf, shstrndx)) == NULL) { 108 if ((scn = elf_newscn(elf)) == NULL) { 147 if (elf_update(elf, ELF_C_WRITE) == -1) 166 * Initialize the elf library, must be called before elf_begin() 183 Elf *elf; local 196 if ((elf [all...] |
H A D | pcom.c | 47 print_comment(Elf *elf, const char *file) argument 57 if (elf_getshdrstrndx(elf, &shstrndx) == -1) { 63 while ((scn = elf_nextscn(elf, scn)) != NULL) { 74 if (strcmp(CommentStr, elf_strptr(elf, shstrndx, 108 process_elf(Elf *elf, char *file, int fd, int member) argument 113 switch (elf_kind(elf)) { 119 print_comment(elf, file); 130 while ((_elf = elf_begin(fd, cmd, elf)) != NULL) { 154 file, elf_kind(elf)); 170 * Initialize the elf librar 181 Elf *elf; local [all...] |
/illumos-gate/usr/src/cmd/mdb/tools/setdynflag/common/ |
H A D | setdynflag.c | 87 Elf *elf; local 99 if ((elf = elf_begin(fd, ELF_C_RDWR, NULL)) == NULL) 102 if ((secidx = findelfsecidx(elf, ".dynamic")) == -1) 105 if ((scn = elf_getscn(elf, secidx)) == NULL) 134 if (elf_update(elf, ELF_C_WRITE) == -1) 137 (void) elf_end(elf);
|
/illumos-gate/usr/src/cmd/sgs/libldmake/common/ |
H A D | ld_file.c | 85 ld_file(const char *file, const Elf_Kind ekind, int flags, Elf *elf) argument 99 ld_file64(const char *file, const Elf_Kind ekind, int flags, Elf *elf) argument 101 ld_file(file, ekind, flags, elf);
|
/illumos-gate/usr/src/cmd/sgs/size/common/ |
H A D | main.c | 69 static Elf *elf; variable 206 while ((elf = elf_begin(fd, cmd, arf)) != 0) { 207 if ((arhdr = elf_getarhdr(elf)) == 0) { 217 process(elf); 231 process(elf); 234 cmd = elf_next(elf); 235 (void) elf_end(elf);
|
H A D | process.c | 65 static void process_phdr(Elf *elf, GElf_Half num); 68 process(Elf * elf) argument 114 if (gelf_getehdr(elf, &ehdr) == 0) { 119 process_phdr(elf, ehdr.e_phnum); 128 if (elf_getshdrstrndx(elf, &ndx) == -1) 134 if (elf_getshdrnum(elf, &shnum) == -1) 142 if ((scn = elf_nextscn(elf, scn)) == 0) { 172 name = elf_strptr(elf, ndx, (size_t)shdr.sh_name); 196 process_phdr(elf, ehdr.e_phnum); 219 process_phdr(Elf * elf, GElf_Hal argument [all...] |
/illumos-gate/usr/src/cmd/make/lib/makestate/ |
H A D | ld_file.c | 148 ld_file(const char * file, const Elf_Kind ekind, int flags, Elf *elf) argument 171 ld_file64(const char * file, const Elf_Kind ekind, int flags, Elf *elf) argument
|
/illumos-gate/usr/src/lib/libsaveargs/tests/dump/ |
H A D | dump.c | 50 walk_symtab(Elf *elf, char *fname, ctf_file_t *fp, argument 63 if ((gelf_getehdr(elf, &ehdr)) == NULL) 67 while ((stab = elf_nextscn(elf, stab)) != NULL) { 76 while ((text = elf_nextscn(elf, text)) != NULL) { 79 if (strcmp(".text", elf_strptr(elf, 100 ss.ss_name = elf_strptr(elf, stabshdr.sh_link, 137 Elf *elf; local 157 if ((elf = elf_begin(fd, ELF_C_READ, NULL)) == NULL) 161 walk_symtab(elf, argv[1], ctfp, check_sym); 163 (void) elf_end(elf); [all...] |
/illumos-gate/usr/src/lib/libtnfctl/ |
H A D | elf.c | 29 * Interfaces for searching for elf specific information 49 static tnfctl_errcode_t elf_dynmatch(Elf *elf, char *strs, Elf_Scn *dyn_scn, 222 elf_dynmatch(Elf * elf, argument
|
/illumos-gate/usr/src/cmd/mdb/tools/findfp/sparc/ |
H A D | findfp.c | 82 Elf *elf; local 119 if ((elf = elf_begin(fd, ELF_C_READ, NULL)) == NULL) 122 if ((textidx = findelfsecidx(elf, ".text")) < 0) 125 if ((scn = elf_getscn(elf, textidx)) == NULL || 142 if (findelfsym(elf, i * 4, &symname, &off)) { 169 (void) elf_end(elf);
|
/illumos-gate/usr/src/cmd/sgs/elfedit/common/ |
H A D | elfedit_machelf.c | 80 * Fill in state.elf.obj_state with a a dynamically allocated 89 * elf - Elf handle returned by elf_begin 93 * been dynamically allocated, and state.elf.obj_state references it. 102 elfedit64_init_obj_state(const char *file, int fd, Elf *elf) argument 105 elfedit32_init_obj_state(const char *file, int fd, Elf *elf) 142 tstate.os_elf = elf; 427 state.elf.obj_state.s64 = obj_state; 429 state.elf.obj_state.s32 = obj_state;
|