Searched defs:elf (Results 76 - 100 of 102) sorted by relevance

12345

/illumos-gate/usr/src/cmd/sgs/elfedit/common/
H A D_elfedit.h197 } elf; member in struct:__anon1464
256 extern void elfedit32_init_obj_state(const char *file, int fd, Elf *elf);
257 extern void elfedit64_init_obj_state(const char *file, int fd, Elf *elf);
H A Dsys.c94 get_obj_state_info(void *obj_state, const char **file, int *fd, Elf **elf) argument
96 if (state.elf.elfclass == ELFCLASS32) {
101 *elf = s->os_elf;
107 *elf = s->os_elf;
561 Elf *elf; local
584 get_obj_state_info(obj_state, &file, &fd, &elf);
586 (void) elf_end(elf);
841 Elf *elf; local
851 get_obj_state_info(obj_state, &file, &fd, &elf);
852 if (elf_update(elf, ELF_C_WRIT
[all...]
H A Delfedit.c1215 * Fills state.elf with the necessary information for the open file.
1225 Elf *elf; local
1247 elf = elf_begin(fd, ELF_C_RDWR, NULL);
1248 if (elf == NULL) {
1255 switch (elf_kind(elf)) {
1277 (void) elf_flagelf(elf, ELF_C_SET, ELF_F_LAYOUT);
1279 /* Fill in state.elf.obj_state */
1280 state.elf.elfclass = gelf_getclass(elf);
1281 switch (state.elf
[all...]
/illumos-gate/usr/src/cmd/sgs/ldd/common/
H A Dldd.c35 * ldd opens the file and verifies the information in the elf header.
162 Elf *elf; local
359 * Get the files elf descriptor and process it as an elf or
362 elf = elf_begin(var, ELF_C_READ, (Elf *)0);
363 switch (elf_kind(elf)) {
375 if (elf_check(nfile, fname, cname, elf, fflag) != NULL)
386 (void) elf_end(elf);
395 elf_check(int nfile, char *fname, char *cname, Elf *elf, int fflag) argument
405 if (gelf_getehdr(elf,
[all...]
/illumos-gate/usr/src/cmd/sgs/libelf/common/
H A Dgelf.c33 * Find elf or it's class from a pointer to an Elf_Data struct.
55 gelf_fsize(Elf * elf, Elf_Type type, size_t count, unsigned ver) argument
59 if (elf == NULL)
62 class = gelf_getclass(elf);
74 gelf_getclass(Elf *elf) argument
76 if (elf == NULL)
82 return (elf->ed_class);
87 gelf_getehdr(Elf *elf, GElf_Ehdr *dst) argument
91 if (elf == NULL)
94 class = gelf_getclass(elf);
138 gelf_update_ehdr(Elf *elf, GElf_Ehdr *src) argument
200 gelf_newehdr(Elf *elf, int class) argument
216 gelf_getphdr(Elf *elf, int ndx, GElf_Phdr *dst) argument
263 gelf_update_phdr(Elf *elf, int ndx, GElf_Phdr *src) argument
312 gelf_newphdr(Elf *elf, size_t phnum) argument
430 gelf_xlatetof(Elf *elf, Elf_Data *dst, const Elf_Data *src, unsigned encode) argument
449 gelf_xlatetom(Elf *elf, Elf_Data *dst, const Elf_Data *src, unsigned encode) argument
1003 gelf_checksum(Elf *elf) argument
1094 _gelf_getdyndtflags_1(Elf *elf) argument
[all...]
/illumos-gate/usr/src/cmd/amt/
H A Damt.c712 Elf *elf; local
730 elf = elf_begin(d, ELF_C_READ, (Elf *)0);
731 if (elf_kind(elf) != ELF_K_ELF) {
732 (void) elf_end(elf);
737 idarray = elf_getident(elf, 0);
745 (void) elf_end(elf);
/illumos-gate/usr/src/cmd/dis/
H A Ddis_target.c422 Elf *elf; local
448 while ((elf = elf_begin(tgt->dt_fd, cmd, tgt->dt_elf_root)) != NULL) {
452 (arhdr = elf_getarhdr(elf)) == NULL) {
461 if (gelf_getehdr(elf, &ehdr) == NULL) {
472 cmd = elf_next(elf);
473 (void) elf_end(elf);
495 current->dt_elf = elf;
498 if (elf_getshdrstrndx(elf, &current->dt_shstrndx) == -1) {
505 if (elf_getshdrnum(elf, &shnum) == -1) {
524 cmd = elf_next(elf);
[all...]
/illumos-gate/usr/src/cmd/modload/
H A Dadd_drv.c873 Elf *elf; local
887 elf = elf_begin(fd, ELF_C_READ, NULL);
888 if (elf_kind(elf) != ELF_K_ELF) {
890 (void) elf_end(elf);
894 ident = elf_getident(elf, 0);
905 (void) elf_end(elf);
/illumos-gate/usr/src/cmd/sgs/elfdump/common/
H A Dmain.c27 * Dump an elf file.
547 decide(const char *file, int fd, Elf *elf, uint_t flags, argument
552 if (gelf_getclass(elf) == ELFCLASS64)
553 r = regular64(file, fd, elf, flags, wname, wfd, osabi);
555 r = regular32(file, fd, elf, flags, wname, wfd, osabi);
561 archive(const char *file, int fd, Elf *elf, uint_t flags, argument
578 if (((arsym = elf_getarsym(elf, &ptr)) == 0) && elf_errno()) {
607 if (_elf_getarsymwordsize(elf) == 8) {
623 * For each object obtain an elf descriptor so that we
634 if (elf_rand(elf, arsy
729 Elf *elf; local
[all...]
H A Dfake_shdr.c1052 * elf - ELF descriptor
1067 fake_shdr_cache(const char *file, int fd, Elf *elf, Ehdr *ehdr, argument
1137 if (elf_getphdrnum(elf, &fstate.phnum) == -1) {
1141 if ((fstate.phdr = elf_getphdr(elf)) == NULL) {
/illumos-gate/usr/src/cmd/tnf/prex/
H A Dmain.c221 /* check elf class model */
863 * get_elf_class - get the target executable elf class
871 Elf *elf; local
882 elf = elf_begin(elffd, ELF_C_READ, (Elf *) 0);
886 if (gelf_getehdr(elf, &ehdr) == (GElf_Ehdr *) 0) {
890 ident = elf_getident(elf, &size);
900 * and target elf class and act accordingly
/illumos-gate/usr/src/tools/ctf/cvt/
H A Doutput.c329 sort_iidescs(Elf *elf, const char *file, tdata_t *td, int fuzzymatch, argument
343 if ((stidx = findelfsecidx(elf, file,
346 scn = elf_getscn(elf, stidx);
351 scn = elf_getscn(elf, shdr.sh_link);
669 make_ctf_data(tdata_t *td, Elf *elf, const char *file, size_t *lenp, int flags) argument
674 iiburst = sort_iidescs(elf, file, td, flags & CTF_FUZZY_MATCH,
687 Elf *elf = NULL; local
697 if ((elf = elf_begin(fd, ELF_C_READ, NULL)) == NULL)
705 data = make_ctf_data(td, elf, curname, &len, flags);
706 write_file(elf, curnam
[all...]
H A Ddwarf.c1846 should_have_dwarf(Elf *elf) argument
1856 while ((scn = elf_nextscn(elf, scn)) != NULL) {
1879 name = elf_strptr(elf, shdr.sh_link, sym.st_name);
1896 dw_read(tdata_t *td, Elf *elf, const char *filename) argument
1907 dw.dw_ptrsz = elf_ptrsz(elf);
1915 if ((rc = dwarf_elf_init(elf, DW_DLC_READ, NULL, NULL, &dw.dw_dw,
1917 if (should_have_dwarf(elf)) {
1947 should_have_dwarf(elf)) {
/illumos-gate/usr/src/tools/ctf/dwarf/common/
H A Ddwarf_elf_access.c44 #include <elf.h>
64 /* This is the standard elf value EM_MIPS. */
97 dwarf_elf_handle elf; member in struct:__anon4467
137 dwarf_elf_handle elf,
144 obj->elf = elf;
146 if ((ehdr_ident = elf_getident(elf, NULL)) == NULL) {
163 obj->ehdr64 = elf64_getehdr(elf);
177 obj->ehdr32 = elf32_getehdr(elf);
251 scn = elf_getscn(obj->elf, section_inde
136 dwarf_elf_object_access_internals_init(void* obj_in, dwarf_elf_handle elf, int* error) argument
886 dwarf_elf_object_access_init(dwarf_elf_handle elf, int libdwarf_owns_elf, Dwarf_Obj_Access_Interface** ret_obj, int *err) argument
951 dwarf_get_elf(Dwarf_Debug dbg, dwarf_elf_handle * elf, Dwarf_Error * error) argument
[all...]
/illumos-gate/usr/src/lib/libdtrace/common/
H A Ddt_link.c30 #include <elf.h>
983 dt_link_error(dtrace_hdl_t *dtp, Elf *elf, int fd, dt_link_pair_t *bufs, argument
993 if (elf != NULL)
994 (void) elf_end(elf);
1017 Elf *elf = NULL; local
1035 return (dt_link_error(dtp, elf, fd, bufs,
1039 if ((elf = elf_begin(fd, ELF_C_RDWR, NULL)) == NULL) {
1040 return (dt_link_error(dtp, elf, fd, bufs,
1044 switch (elf_kind(elf)) {
1048 return (dt_link_error(dtp, elf, f
[all...]
/illumos-gate/usr/src/cmd/file/
H A Dfile.c55 #include <sys/elf.h>
524 /* need another fd for elf, since we might want to read the file too */
683 * if not, check if elf or a.out
925 Elf *elf; local
928 * Get the files elf descriptor and process it as an elf or
932 elf = elf_begin(elffd, ELF_C_READ, (Elf *)0);
933 switch (elf_kind(elf)) {
950 (void) elf_end(elf);
980 * in /usr/include/sys/elf
[all...]
/illumos-gate/usr/src/cmd/sgs/ar/common/
H A Dfile.c85 * at 8-byte. More recently, an elf section type has appeared that has
90 * 1) If a new elf section that ld(1) accesses in memory appears
204 recover_padding(Elf *elf, ARFILE *file) argument
213 if (gelf_getclass(elf) == ELFCLASSNONE)
226 if (elf_getshdrnum(elf, &shnum) == -1)
229 extent = gelf_getehdr(elf, &ehdr)
251 scn = elf_nextscn(elf, scn);
313 Elf *elf; local
322 if ((elf = elf_begin(fd, ELF_C_READ, arf)) == 0)
325 if ((mem_header = elf_getarhdr(elf))
477 Elf *elf; local
1418 search_sym_tab(const char *arname, ARFILE *fptr, Elf *elf, Elf_Scn *scn, size_t *nsyms, ARFILEP **symlist, size_t *num_errs) argument
[all...]
/illumos-gate/usr/src/cmd/sgs/mcs/common/
H A Dfile.c74 Elf *elf = 0; local
148 while ((elf = elf_begin(fd, cmd, arf)) != 0) {
152 if ((mem_header = elf_getarhdr(elf)) == NULL) {
155 elf_getbase(elf));
156 (void) elf_end(elf);
179 if (elf_kind(elf) == ELF_K_ELF) {
180 if ((code = process_file(elf, cur_filenm, cmd_info)) ==
184 (void) elf_end(elf);
188 copy_non_elf_to_temp_ar(fd, elf,
195 copy_non_elf_to_temp_ar(fd, elf,
244 process_file(Elf *elf, char *cur_file, Cmd_Info *cmd_info) argument
313 traverse_file(Elf *elf, GElf_Ehdr * ehdr, char *cur_file, Cmd_Info *cmd_info, file_state_t *state) argument
1234 build_segment_table(Elf * elf, GElf_Ehdr * ehdr, file_state_t *state) argument
1329 copy_non_elf_to_temp_ar( int fd, Elf *elf, int fdartmp, Elf_Arhdr *mem_header, char *cur_file, Cmd_Info *cmd_info) argument
1473 location(int64_t offset, int mem_search, Elf * elf, file_state_t *state) argument
1496 scn_location(Elf_Scn * scn, Elf * elf, file_state_t *state) argument
[all...]
/illumos-gate/usr/src/cmd/sgs/nm/common/
H A Dnm.c783 readsyms(Elf_Data * data, GElf_Sxword num, Elf *elf, argument
809 char *name = (char *)elf_strptr(elf, link, sym.st_name);
821 buf->name = (char *)elf_strptr(elf, link, sym.st_name);
833 while ((_scn = elf_nextscn(elf, _scn)) != 0) {
/illumos-gate/usr/src/cmd/sgs/pvs/common/
H A Dpvs.c1006 Elf *elf; local
1088 * Open the input file and initialize the elf interface.
1103 if ((elf = elf_begin(var, ELF_C_READ, NULL)) == NULL) {
1110 if (elf_kind(elf) != ELF_K_ELF) {
1115 (void) elf_end(elf);
1118 if (gelf_getehdr(elf, &ehdr) == NULL) {
1123 (void) elf_end(elf);
1131 if ((scn = elf_getscn(elf, ehdr.e_shstrndx)) == NULL) {
1136 (void) elf_end(elf);
1144 (void) elf_end(elf);
[all...]
/illumos-gate/usr/src/tools/ctf/dump/
H A Ddump.c788 findelfscn(Elf *elf, GElf_Ehdr *ehdr, char *secname) argument
794 for (scn = NULL; (scn = elf_nextscn(elf, scn)) != NULL; ) {
796 elf_strptr(elf, ehdr->e_shstrndx, shdr.sh_name)) != NULL &&
815 Elf *elf; local
871 if ((elf = elf_begin(fd, ELF_C_READ, NULL)) != NULL &&
872 gelf_getehdr(elf, &ehdr) != NULL) {
875 Elf_Scn *ctfscn = findelfscn(elf, &ehdr, ".SUNW_ctf");
893 symscn = elf_getscn(elf, ctfshdr.sh_link);
895 symscn = findelfscn(elf, &ehdr, ".symtab");
904 symstrscn = elf_getscn(elf, shd
[all...]
/illumos-gate/usr/src/lib/libproc/common/
H A DPsymtab.c1125 * The text segment for each load object contains the elf header and
1137 * We're looking through the elf file for several items: the symbol tables
1147 * reasaon, we fake up a elf file to use in its stead. If we can't read
1148 * the elf data in the process's address space, we fall back to using
1151 * The elf file that we fake up has to consist of sections for the
1160 file_differs(struct ps_prochandle *P, Elf *elf, file_info_t *fptr) argument
1178 * First, we find the checksum value in the elf file.
1181 while ((scn = elf_nextscn(elf, scn)) != NULL) {
1215 dprintf("elf cksum value is %llx\n", (u_longlong_t)cksum);
1305 Elf *elf; local
1551 Elf *elf; local
1583 Elf *elf; local
[all...]
H A DPcore.c1384 * in a memory backed elf file.
1876 core_find_text(struct ps_prochandle *P, Elf *elf, rd_loadobj_t *rlp) argument
1882 if (elf_getphdrnum(elf, &nphdrs) == -1)
1886 if (gelf_getphdr(elf, i, &phdr) != NULL &&
1902 core_find_data(struct ps_prochandle *P, Elf *elf, rd_loadobj_t *rlp) argument
1916 if (gelf_getehdr(elf, &ehdr) == NULL ||
1917 elf_getphdrnum(elf, &nphdrs) == -1)
1921 if (gelf_getphdr(elf, i, &phdr) != NULL &&
2474 * Although <sys/elf.h> defines both Elf32_Nhdr and Elf64_Nhdr
/illumos-gate/usr/src/cmd/dtrace/
H A Ddtrace.c1293 Elf *elf; local
1300 if ((elf = elf_begin(fd, ELF_C_READ, NULL)) == NULL) {
1305 if (elf_kind(elf) != ELF_K_ELF ||
1306 gelf_getehdr(elf, &ehdr) == NULL) {
1308 (void) elf_end(elf);
1313 (void) elf_end(elf);
/illumos-gate/usr/src/cmd/sgs/libld/common/
H A Dfiles.c56 * Check the validity of the elf header information for compatibility
57 * with this machine and our own internal elf library.
84 ifl_setup(const char *name, Ehdr *ehdr, Elf *elf, Word flags, Ofl_desc *ofl, argument
105 ifl->ifl_elf = elf;
119 if ((scn = elf_getscn(elf, 0)) == NULL) {
215 * is presently recognized, and represented with the following (sys/elf.h):
2526 * Process an elf file. Each section is compared against the section state
2531 process_elf(Ifl_desc *ifl, Elf *elf, Ofl_desc *ofl) argument
2556 ld_sup_file(ofl, ifl->ifl_name, elf_kind(elf), ifl->ifl_flags, elf);
3064 ld_process_ifl(const char *name, const char *soname, int fd, Elf *elf, Word flags, Ofl_desc *ofl, Rej_desc *rej, Ifl_desc **ifl_ret) argument
3399 Elf *elf; local
3440 Elf *elf; local
[all...]

Completed in 179 milliseconds

12345