static uint32_t *
ctf_symidx_sort (ctf_dict_t *fp, uint32_t *idx, size_t *nidx,
- size_t len)
+ size_t len)
{
uint32_t *sorted;
size_t i;
if (fp != i->cu.ctn_fp)
return (ctf_set_typed_errno (fp, ECTF_NEXT_WRONGFP));
- /* TODO-v4: Indexed after non-indexed portions? */
+ /* TODO: Indexed after non-indexed portions? */
if ((!functions && fp->ctf_objtidx_names) ||
(functions && fp->ctf_funcidx_names))
if (functions)
{
- len = (hp->cth_varoff - hp->cth_funcidxoff) / sizeof (uint32_t);
- tab = (uint32_t *) (fp->ctf_buf + hp->cth_funcoff);
+ len = hp->cth_funcidx_len / sizeof (uint32_t);
+ tab = (uint32_t *) (fp->ctf_buf + hp->cth_func_off);
}
else
{
- len = (hp->cth_funcidxoff - hp->cth_objtidxoff) / sizeof (uint32_t);
- tab = (uint32_t *) (fp->ctf_buf + hp->cth_objtoff);
+ len = hp->cth_objtidx_len / sizeof (uint32_t);
+ tab = (uint32_t *) (fp->ctf_buf + hp->cth_objt_off);
}
do
if (functions)
{
- if (fp->ctf_sxlate[n] >= hp->cth_funcoff
- && fp->ctf_sxlate[n] < hp->cth_objtidxoff)
+ if (fp->ctf_sxlate[n] >= hp->cth_func_off
+ && fp->ctf_sxlate[n] < hp->cth_func_off + hp->cth_func_len)
break;
}
else
{
- if (fp->ctf_sxlate[n] >= hp->cth_objtoff
- && fp->ctf_sxlate[n] < hp->cth_funcoff)
+ if (fp->ctf_sxlate[n] >= hp->cth_objt_off
+ && fp->ctf_sxlate[n] < hp->cth_objt_off + hp->cth_objt_len)
break;
}
}
{
if ((fp->ctf_funcidx_sxlate
= ctf_symidx_sort (fp, (uint32_t *)
- (fp->ctf_buf + hp->cth_funcidxoff),
- &fp->ctf_nfuncidx,
- hp->cth_varoff - hp->cth_funcidxoff))
+ (fp->ctf_buf + hp->cth_funcidx_off),
+ &fp->ctf_nfuncidx, hp->cth_funcidx_len))
== NULL)
{
ctf_err_warn (fp, 0, 0, _("cannot sort function symidx"));
return CTF_ERR; /* errno is set for us. */
}
}
- symtypetab = (uint32_t *) (fp->ctf_buf + hp->cth_funcoff);
+ symtypetab = (uint32_t *) (fp->ctf_buf + hp->cth_func_off);
sxlate = fp->ctf_funcidx_sxlate;
names = fp->ctf_funcidx_names;
nidx = fp->ctf_nfuncidx;
{
if ((fp->ctf_objtidx_sxlate
= ctf_symidx_sort (fp, (uint32_t *)
- (fp->ctf_buf + hp->cth_objtidxoff),
- &fp->ctf_nobjtidx,
- hp->cth_funcidxoff - hp->cth_objtidxoff))
+ (fp->ctf_buf + hp->cth_objtidx_off),
+ &fp->ctf_nobjtidx, hp->cth_objtidx_len))
== NULL)
{
ctf_err_warn (fp, 0, 0, _("cannot sort object symidx"));
}
}
- symtypetab = (uint32_t *) (fp->ctf_buf + hp->cth_objtoff);
+ symtypetab = (uint32_t *) (fp->ctf_buf + hp->cth_objt_off);
sxlate = fp->ctf_objtidx_sxlate;
names = fp->ctf_objtidx_names;
nidx = fp->ctf_nobjtidx;
return (ctf_set_errno (fp, ECTF_HASPARENT));
if (fp->ctf_header->cth_parent_strlen != 0 &&
- pfp->ctf_header->cth_strlen != fp->ctf_header->cth_parent_strlen)
+ pfp->ctf_header->btf.bth_str_len != fp->ctf_header->cth_parent_strlen)
{
ctf_err_warn (fp, 0, ECTF_WRONGPARENT,
_("ctf_import: incorrect parent dict: %u bytes of strings expected, %u found"),
- fp->ctf_header->cth_parent_strlen, pfp->ctf_header->cth_strlen);
+ fp->ctf_header->cth_parent_strlen, pfp->ctf_header->btf.bth_str_len);
return (ctf_set_errno (fp, ECTF_WRONGPARENT));
}