+ {
+ ctf_err_warn (NULL, 0, ECTF_CORRUPT,
+ _("CTF sections not properly aligned"));
+ return (ctf_set_open_errno (errp, ECTF_CORRUPT));
+ }
+
+ /* This invariant will be lifted in v4, but for now it is true. */
+
+ if ((hp->cth_funcidxoff - hp->cth_objtidxoff != 0) &&
+ (hp->cth_funcidxoff - hp->cth_objtidxoff
+ != hp->cth_funcoff - hp->cth_objtoff))
+ {
+ ctf_err_warn (NULL, 0, ECTF_CORRUPT,
+ _("Object index section is neither empty nor the "
+ "same length as the object section: %u versus %u "
+ "bytes"), hp->cth_funcoff - hp->cth_objtoff,
+ hp->cth_funcidxoff - hp->cth_objtidxoff);
+ return (ctf_set_open_errno (errp, ECTF_CORRUPT));
+ }
+
+ if ((hp->cth_varoff - hp->cth_funcidxoff != 0) &&
+ (hp->cth_varoff - hp->cth_funcidxoff
+ != hp->cth_objtidxoff - hp->cth_funcoff) &&
+ (hp->cth_flags & CTF_F_NEWFUNCINFO))
+ {
+ ctf_err_warn (NULL, 0, ECTF_CORRUPT,
+ _("Function index section is neither empty nor the "
+ "same length as the function section: %u versus %u "
+ "bytes"), hp->cth_objtidxoff - hp->cth_funcoff,
+ hp->cth_varoff - hp->cth_funcidxoff);
+ return (ctf_set_open_errno (errp, ECTF_CORRUPT));
+ }