{
ctf_next_t *i = NULL;
void *name_;
- void *ifp_;
+ void *input_;
int err;
- while ((err = ctf_dynhash_next (fp->ctf_link_inputs, &i, &name_, &ifp_)) == 0)
+ while ((err = ctf_dynhash_next (fp->ctf_link_inputs, &i, &name_, &input_)) == 0)
{
const char *name = (const char *) name_;
- ctf_dict_t *ifp = (ctf_dict_t *) ifp_;
+ ctf_link_input_t *input = (ctf_link_input_t *) input_;
+ ctf_next_t *j = NULL;
+ ctf_dict_t *ifp;
+ int err;
+
+ /* We only care about CTF archives by this point: lazy-opened archives
+ have always been opened by this point, and short-circuited entries have
+ a matching corresponding archive member. Entries with NULL clin_arc can
+ exist, and constitute old entries renamed via a name changer: the
+ renamed entries exist elsewhere in the list, so we can just skip
+ those. */
+
+ if (!input->clin_arc)
+ continue;
+
+ /* All entries in the archive will necessarily contain the same
+ CTF_F_NEWFUNCINFO flag, so we only need to check the first. We don't
+ even need to do that if we can't open it for any reason at all: the
+ link will fail later on regardless, since an input can't be opened. */
+
+ ifp = ctf_archive_next (input->clin_arc, &j, NULL, 0, &err);
+ if (!ifp)
+ continue;
+ ctf_next_destroy (j);
if (!(ifp->ctf_header->cth_flags & CTF_F_NEWFUNCINFO)
&& (ifp->ctf_header->cth_varoff - ifp->ctf_header->cth_funcoff) > 0)
- ctf_err_warn (ifp, 1, 0, _("linker input %s has CTF func info but uses "
- "an old, unreleased func info format: "
- "this func info section will be dropped."),
+ ctf_err_warn (fp, 1, 0, _("linker input %s has CTF func info but uses "
+ "an old, unreleased func info format: "
+ "this func info section will be dropped."),
name);
}
if (err != ECTF_NEXT_END)