/illumos-gate/usr/src/cmd/sgs/libelf/demo/ |
H A D | dcom.c | 60 * same directory as the elf file being processed. 85 delete_comment(Elf *elf, int fd, const char *file) argument 96 if (gelf_getehdr(elf, &ehdr) == NULL) { 102 if (elf_getshdrnum(elf, &shnum) == -1) { 108 if (elf_getshdrstrndx(elf, &shstrndx) == -1) { 114 if (elf_getphdrnum(elf, &phnum) == -1) { 126 while ((scn = elf_nextscn(elf, scn)) != NULL) { 140 if (strcmp(CommentStr, elf_strptr(elf, shstrndx, 181 if (gelf_newehdr(telf, gelf_getclass(elf)) == NULL) { 196 while ((scn = elf_nextscn(elf, sc 371 Elf *elf; local [all...] |
H A D | tpcom.c | 30 * will then examine each elf descriptor and print the .comment section 56 char *pe_file; /* elf member name */ 67 print_comment(Elf *elf, const char *file) argument 74 if (elf_getshdrstrndx(elf, &shstrndx) == -1) { 80 while ((scn = elf_nextscn(elf, scn)) != NULL) { 92 if (strcmp(CommentStr, elf_strptr(elf, shstrndx, 198 * Initialize the elf library, must be called before elf_begin() 218 Elf *elf; local 234 if ((elf = elf_begin(fd, ELF_C_READ, 0)) == NULL) { 243 pep->pe_elf = elf; [all...] |
H A D | dispsyms.c | 70 print_symtab(Elf *elf, const char *file) argument 78 if (gelf_getehdr(elf, &ehdr) == NULL) { 84 if (elf_getshdrstrndx(elf, &shstrndx) == -1) { 90 while ((scn = elf_nextscn(elf, scn)) != NULL) { 120 elf_strptr(elf, shstrndx, shdr.sh_name)); 167 elf_nextscn(elf, _scn)) != NULL) { 269 elf_strptr(elf, shdr.sh_link, sym.st_name)); 276 process_elf(Elf *elf, char *file, int fd, int member) argument 281 switch (elf_kind(elf)) { 287 print_symtab(elf, fil 350 Elf *elf; local [all...] |
/illumos-gate/usr/src/tools/chk4ubin/ |
H A D | chk4ubin.c | 128 Elf *elf; local 155 elf = elf_begin(fd, ELF_C_READ, NULL); 158 while ((symscn = elf_nextscn(elf, symscn)) != NULL) { 164 strscn = elf_getscn(elf, symhdr.sh_link); 176 elf_end(elf);
|
/illumos-gate/usr/src/tools/ctf/cvt/ |
H A D | ctfconvert.c | 88 Elf *elf; local 96 if ((elf = elf_begin(fd, ELF_C_READ, NULL)) == NULL) { 102 source_types = built_source_types(elf, filename); 111 if ((rc = readers[i](td, elf, filename)) == 0) 122 if (findelfsecidx(elf, filename, ".debug") >= 0) { 138 (void) elf_end(elf);
|
H A D | util.c | 64 findelfsecidx(Elf *elf, const char *file, const char *tofind) argument 70 if (gelf_getehdr(elf, &ehdr) == NULL) 73 while ((scn = elf_nextscn(elf, scn)) != NULL) { 82 if ((name = elf_strptr(elf, ehdr.e_shstrndx, 97 elf_ptrsz(Elf *elf) argument 101 if (gelf_getehdr(elf, &ehdr) == NULL) {
|
H A D | input.c | 50 built_source_types(Elf *elf, char const *file) argument 55 if ((si = symit_new(elf, file)) == NULL) 86 read_file(Elf *elf, char *file, char *label, read_cb_f *func, void *arg, argument 95 if ((ctfscnidx = findelfsecidx(elf, file, ".SUNW_ctf")) < 0) { 97 (built_source_types(elf, file) & SOURCE_C)) { 104 if ((ctfscn = elf_getscn(elf, ctfscnidx)) == NULL || 109 if ((si = symit_new(elf, file)) == NULL) { 129 read_archive(int fd, Elf *elf, char *file, char *label, read_cb_f *func, argument 137 while ((melf = elf_begin(fd, cmd, elf)) != NULL) { 163 terminate("%s: Unknown elf kin 187 Elf *elf; local 250 count_archive(int fd, Elf *elf, char *file) argument 281 Elf *elf; local 342 symit_new(Elf *elf, const char *file) argument [all...] |
H A D | stabs.c | 177 stabs_read(tdata_t *td, Elf *elf, const char *file) argument 193 if (!((stabidx = findelfsecidx(elf, file, ".stab.excl")) >= 0 && 194 (stabstridx = findelfsecidx(elf, file, ".stab.exclstr")) >= 0) && 195 !((stabidx = findelfsecidx(elf, file, ".stab")) >= 0 && 196 (stabstridx = findelfsecidx(elf, file, ".stabstr")) >= 0)) { 208 scn = elf_getscn(elf, stabidx); 250 if ((str = elf_strptr(elf, stabstridx, 378 cvt_fixups(td, elf_ptrsz(elf));
|
/illumos-gate/usr/src/lib/libproc/common/ |
H A D | Pidle.c | 160 Elf *elf = NULL; local 195 if ((elf = elf_begin(fd, ELF_C_READ, NULL)) == NULL) { 245 if (gelf_getehdr(elf, &ehdr) == NULL) { 250 if (elf_getphdrnum(elf, &phnum) == -1) { 263 if ((php = gelf_getphdr(elf, i, &phdr)) == NULL) { 278 (void) elf_end(elf); 326 if (elf != NULL) 327 (void) elf_end(elf);
|
H A D | Psymtab_machelf32.c | 92 * Here are some useful pieces of elf trivia that will help 239 * put together a complete set of elf sections. They are 251 Elf *elf; local 346 /* elf header */ 349 /* program headers from in-core elf fragment */ 486 * The first elf section is always skipped. 641 /* read the elf hash bucket index */ 720 if ((elf = elf_memory(elfdata, size)) == NULL) { 729 return (elf);
|
/illumos-gate/usr/src/lib/fm/topo/libtopo/common/ |
H A D | mod.c | 114 Elf *elf = NULL; local 129 if ((elf = elf_begin(fd, ELF_C_READ, NULL)) == NULL) { 133 if ((gelf_getehdr(elf, &ehdr)) == NULL) { 137 scn = elf_getscn(elf, 0); /* "seek" to start of sections */ 138 while ((scn = elf_nextscn(elf, scn)) != NULL) { 146 sh_name = elf_strptr(elf, 156 (void) elf_end(elf); 161 if (elf != NULL) 162 (void) elf_end(elf);
|
/illumos-gate/usr/src/lib/libtnfctl/ |
H A D | traverse.c | 29 * Generic functions that know how to traverse elf sections in an object. 46 * _tnfctl_traverse_object() - traverses all of the elf sections in an object, 53 Elf *elf; local 68 /* open elf descriptor on the fd */ 69 elf = elf_begin(objfd, ELF_C_READ, NULL); 70 if (elf == NULL || elf_kind(elf) != ELF_K_ELF) { 72 "sunw%verbosity 3; sunw%debug 'not elf object'"); 75 /* get the elf header */ 76 if ((ehdr = gelf_getehdr(elf, 141 _tnfctl_traverse_rela(Elf * elf, char *strs, Elf_Scn * rel_scn, GElf_Shdr * rel_shdr, Elf_Data * rel_data, uintptr_t baseaddr, tnfctl_elf_search_t * search_info_p) argument 275 _tnfctl_traverse_dynsym(Elf * elf, char *elfstrs, Elf_Scn * scn, GElf_Shdr * shdr, Elf_Data * data, uintptr_t baseaddr, tnfctl_elf_search_t * search_info_p) argument [all...] |
/illumos-gate/usr/src/grub/grub-0.97/stage2/ |
H A D | boot.c | 26 #include "i386-elf.h" 53 Elf32_Ehdr *elf; member in union:__anon2166 100 || pu.elf->e_ident[EI_OSABI] == ELFOSABI_FREEBSD 101 || grub_strcmp (pu.elf->e_ident + EI_BRAND, "FreeBSD") == 0 107 entry_addr = (entry_func) pu.elf->e_entry; 109 entry_addr = (entry_func) (pu.elf->e_entry & 0xFFFFFF); 116 if (pu.elf->e_phoff == 0 || pu.elf->e_phnum == 0 117 || ((pu.elf->e_phoff + (pu.elf [all...] |
/illumos-gate/usr/src/cmd/sgs/crle/common/ |
H A D | inspect.c | 654 Elf *elf; local 707 if ((elf = elf_begin(fd, ELF_C_READ, NULL)) == NULL) { 714 if ((elf_kind(elf) != ELF_K_ELF) || 715 (gelf_getehdr(elf, &ehdr) == NULL) || 723 (void) elf_end(elf); 735 dyflags = _gelf_getdyndtflags_1(elf); 747 (void) elf_end(elf); 758 (void) elf_end(elf); 771 (void) elf_end(elf); 780 (void) elf_end(elf); [all...] |
/illumos-gate/usr/src/cmd/sgs/gprof/common/ |
H A D | readelf.c | 62 static void get_symtab(Elf *elf, mod_info_t *module); 63 static void get_textseg(Elf *elf, int fd); 78 Elf *elf; local 89 if ((elf = elf_begin(fd, ELF_C_READ, NULL)) == NULL) 92 if (gelf_getehdr(elf, &ehdr) == NULL) 95 (void) elf_end(elf); 140 get_txtorigin(Elf *elf) argument 148 if (gelf_getehdr(elf, &ehdr) == NULL) 152 if (gelf_getphdr(elf, ndx, &phdr) == NULL) 171 Elf *elf; local 201 Elf *elf; local 240 get_textseg(Elf *elf, int fd) argument 401 is_function(Elf *elf, GElf_Sym *sym) argument 454 get_symtab(Elf *elf, mod_info_t *module) argument [all...] |
/illumos-gate/usr/src/cmd/sgs/ld/common/ |
H A D | ld.c | 77 struct { /* Must match start of ELFxx_Ehdr in <sys/elf.h> */ 167 * elf - libelf ELF descriptor 176 archive(int fd, Elf *elf, uchar_t *class_ret, Half *mach_ret) argument 188 while (!found && ((_elf = elf_begin(fd, cmd, elf)) != NULL)) { 437 Elf *elf; local 440 if ((elf = elf_begin(fd, ELF_C_READ, NULL)) == NULL) { 444 if (elf_kind(elf) == ELF_K_AR) 446 archive(fd, elf, &ar_class, &ar_mach); 447 (void) elf_end(elf);
|
/illumos-gate/usr/src/cmd/sgs/libelf/common/ |
H A D | update.c | 156 _elf_upd_lib(Elf * elf) argument 158 NOTE(ASSUMING_PROTECTED(*elf)) 163 Ehdr * eh = elf->ed_ehdr; 202 if ((s = elf->ed_hdscn) == 0) { 230 if ((sz = (Lword)_elf_entsz(elf, sh->sh_type, ver)) != 0) 318 sh = (Shdr *)elf->ed_hdscn->s_shdr; 341 _elf_upd_usr(Elf * elf) argument 343 NOTE(ASSUMING_PROTECTED(*elf)) 347 Ehdr * eh = elf->ed_ehdr; 387 if ((s = elf 456 wrt(Elf * elf, Xword outsz, unsigned fill, int update_cmd) argument 743 _elfxx_update(Elf * elf, Elf_Cmd cmd) argument 858 _elfxx_swap_wrimage(Elf *elf) argument 966 elf_update(Elf *elf, Elf_Cmd cmd) argument 982 _elf_swap_wrimage(Elf *elf) argument [all...] |
/illumos-gate/usr/src/cmd/sgs/libld/common/ |
H A D | libs.c | 187 ld_ar_setup(const char *name, Elf *elf, Ofl_desc *ofl) argument 199 } else if ((start = elf_getarsym(elf, &number)) == NULL) { 215 adp->ad_elf = elf; 584 * Set up a new elf descriptor for this member. 804 * and elf descriptor can be freed. Set ad_elf to NULL to mark the 863 * pointed at an archive containing the wrong class of elf members.
|
H A D | support.c | 232 Elf *elf) 249 (*flp->fl_fptr)(ifile, ekind, _flags, elf); 255 Shdr **oshdr, Word ndx, Elf_Scn *scn, Elf *elf) 282 (*flp->fl_fptr)(sname, &nshdr, ndx, data, elf, &flags); 303 Elf_Data *data, Elf *elf) 311 (*flp->fl_fptr)(scn, shdr, ndx, data, elf); 231 ld_sup_file(Ofl_desc *ofl, const char *ifile, const Elf_Kind ekind, int flags, Elf *elf) argument 254 ld_sup_input_section(Ofl_desc *ofl, Ifl_desc *ifl, const char *sname, Shdr **oshdr, Word ndx, Elf_Scn *scn, Elf *elf) argument 302 ld_sup_section(Ofl_desc *ofl, const char *scn, Shdr *shdr, Word ndx, Elf_Data *data, Elf *elf) argument
|
/illumos-gate/usr/src/cmd/abi/appcert/static_prof/ |
H A D | static_prof.h | 101 Elf *elf; /* elf descriptor for current file */ member in struct:obj_com 103 Elf64_Ehdr *ehdr; /* 64 bit elf header for current file */ 107 Elf32_Ehdr *ehdr; /* 32 bit elf header for current file */
|
/illumos-gate/usr/src/cmd/sgs/librtld_db/demo/common/ |
H A D | maps.c | 205 Elf *elf; local 248 if ((elf = elf_begin(filefd, ELF_C_READ, 0)) == NULL) { 253 if (elf_kind(elf) != ELF_K_ELF) { 254 (void) printf("non-elf file\n"); 255 (void) elf_end(elf); 259 mp->mi_elf = elf;
|
/illumos-gate/usr/src/cmd/sgs/link_audit/common/ |
H A D | who.c | 154 Elf *elf; local 167 if ((elf = elf_begin(fd, ELF_C_READ, 0)) == NULL) { 173 while ((scn = elf_nextscn(elf, scn)) != NULL) { 184 scn = elf_getscn(elf, shdr->sh_link); 189 (void) elf_end(elf);
|
/illumos-gate/usr/src/cmd/sgs/prof/common/ |
H A D | rdelf.c | 40 Elf *elf; local 53 if ((elf = elf_begin(fd, ELF_C_READ, NULL)) == NULL) { 58 if (gelf_getehdr(elf, &ehdr) == NULL) { 64 (void) elf_end(elf); 159 is_function(Elf *elf, GElf_Sym *sym) argument 201 scn = elf_getscn(elf, sym->st_shndx); 211 fetch_symtab(Elf *elf, char *filename, mod_info_t *module) argument 230 while ((symtab_found == 0) && ((scn = elf_nextscn(elf, scn)) != NULL)) { 319 name = elf_strptr(elf, strndx, gsym.st_name); 324 if (is_function(elf, 357 get_txtorigin(Elf *elf, char *filename) argument 391 Elf *elf; local [all...] |
/illumos-gate/usr/src/cmd/strings/ |
H A D | strings.c | 48 #include <sys/elf.h> 114 Elf *elf; local 120 elf = elf_begin(fd, ELF_C_READ, NULL); 121 if (gelf_getehdr(elf, &ehdr) == (GElf_Ehdr *)NULL) { 123 (void) elf_end(elf); 127 while ((scn = elf_nextscn(elf, scn)) != 0) { 140 if ((scn_name = elf_strptr(elf, ehdr.e_shstrndx, 502 Elf *elf; local 514 if ((elf = elf_begin(fd, ELF_C_READ, NULL)) == NULL) { 519 switch (elf_kind(elf)) { [all...] |
/illumos-gate/usr/src/cmd/lockstat/ |
H A D | sym.c | 44 #include <elf.h> 141 Elf *elf; local 155 elf = elf_begin(fd, ELF_C_READ, NULL); 157 for (cnt = 1; (scn = elf_nextscn(elf, scn)) != NULL; cnt++) { 166 for (cnt = 1; (scn = elf_nextscn(elf, scn)) != NULL; cnt++) {
|