• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /macosx-10.10.1/dtrace-147/tools/ctfconvert/

Lines Matching +defs:mh +defs:data

29  * Routines for preparing tdata trees for conversion into CTF data, and
30 * for placing the resulting data into an output file.
55 gelf_getsym_macho(Elf_Data * data, int ndx, int nent, GElf_Sym * dst, const char *base)
57 const struct nlist *nsym = ((const struct nlist *)(data->d_buf)) + ndx;
100 gelf_getsym_macho_64(Elf_Data * data, int ndx, int nent, GElf_Sym * dst, const char *base)
102 const struct nlist_64 *nsym = ((const struct nlist_64 *)(data->d_buf)) + ndx;
154 burst_iitypes(void *data, void *arg)
156 iidesc_t *ii = data;
248 * See if this iidesc matches the ELF symbol data we pass in.
334 Elf_Data *data, int nent, Elf_Data *strdata,
350 if (gelf_getsym(data, i, &sym) == NULL)
424 * and data, maintaining symbol table order.
433 Elf_Data *data, *strdata;
450 data = elf_getdata(scn, NULL);
483 if (gelf_getsym(data, i, &sym) == NULL)
517 if (!check_for_weak(&sym, match.iim_file, data, nent, strdata,
548 if (gelf_getsym_macho(data, i, nent, &sym, (const char *)strdata->d_buf) == NULL)
551 if (gelf_getsym_macho_64(data, i, nent, &sym, (const char *)strdata->d_buf) == NULL)
601 * we do not write records for those functions into the CTF data.
743 elfterminate(srcname, "Cannot get sect %s data", sname);
745 elfterminate(dstname, "Can't make sect %s data", sname);
898 struct mach_header hdr, *mh = (struct mach_header *)src->ed_image;
902 int fd, cmdsleft, swap = (MH_CIGAM == mh->magic);
914 hdr = *mh;
915 mh = &hdr;
916 __swap_mach_header(mh);
933 /* Iterate through load commands looking for CTF data */
935 cmdsleft = mh->ncmds;
986 cmdlength = mh->sizeofcmds; // where to write CTF seg/sect
987 dataoffset = sizeof(*mh) + mh->sizeofcmds; // where all real data starts
991 mh->sizeofcmds += ctfhdrsz;
992 mh->ncmds++;
994 * Chop the first ctfhdrsz bytes out of the generic data so
1003 (sizeof(*mh) + cmdlength + ctfhdrsz + datalength) /* file offset */,
1007 __swap_mach_header(mh);
1010 write(dst->ed_fd, mh, sizeof(*mh));
1011 write(dst->ed_fd, p + sizeof(*mh), cmdlength);
1068 struct mach_header_64 hdr, *mh = (struct mach_header_64 *)src->ed_image;
1072 int fd, cmdsleft, swap = (MH_CIGAM_64 == mh->magic);
1079 hdr = *mh;
1080 mh = &hdr;
1081 __swap_mach_header_64(mh);
1098 /* Iterate through load commands looking for CTF data */
1100 cmdsleft = mh->ncmds;
1151 cmdlength = mh->sizeofcmds; // where to write CTF seg/sect
1152 dataoffset = sizeof(*mh) + mh->sizeofcmds; // where all real data starts
1156 mh->sizeofcmds += ctfhdrsz;
1157 mh->ncmds++;
1159 * Chop the first ctfhdrsz bytes out of the generic data so
1168 (sizeof(*mh) + cmdlength + ctfhdrsz + datalength) /* file offset */,
1172 __swap_mach_header_64(mh);
1175 write(dst->ed_fd, mh, sizeof(*mh));
1176 write(dst->ed_fd, p + sizeof(*mh), cmdlength);
1195 caddr_t data;
1200 data = ctf_gen(iiburst, lenp, flags & CTF_COMPRESS);
1202 data = ctf_gen(iiburst, lenp, flags & (CTF_COMPRESS | CTF_BYTESWAP));
1207 return (data);
1216 caddr_t data;
1239 struct mach_header *mh = (struct mach_header *)elf->ed_image;
1240 if ((flags & CTF_BYTESWAP) && (MH_CIGAM != mh->magic))
1243 data = make_ctf_data(td, elf, curname, &len, flags);
1245 if (write(tfd, data, len) != len) {
1246 perror("Attempt to write raw CTF data failed");
1247 terminate("Attempt to write raw CTF data failed");
1250 write_file(elf, curname, telf, newname, data, len, flags);
1257 data = make_ctf_data(td, elf, curname, &len, flags);
1259 if (write(tfd, data, len) != len) {
1260 perror("Attempt to write raw CTF data failed");
1261 terminate("Attempt to write raw CTF data failed");
1264 write_file_64(elf, curname, telf, newname, data, len, flags);
1269 data = make_ctf_data(td, elf, curname, &len, flags);
1270 write_file(elf, curname, telf, newname, data, len, flags);
1272 free(data);