if (q->addend)
{
- bfd_signed_vma addend = q->addend;
- if (addend < 0)
+ bfd_vma addend = q->addend;
+ if ((bfd_signed_vma) addend < 0)
{
printf ("-0x");
addend = -addend;
return ctfsect;
}
+/* Dump CTF errors/warnings. */
+static void
+dump_ctf_errs (ctf_file_t *fp)
+{
+ ctf_next_t *it = NULL;
+ char *errtext;
+ int is_warning;
+ int err;
+
+ /* Dump accumulated errors and warnings. */
+ while ((errtext = ctf_errwarning_next (fp, &it, &is_warning, &err)) != NULL)
+ {
+ non_fatal (_("%s: %s"), is_warning ? _("warning"): _("error"),
+ errtext);
+ free (errtext);
+ }
+ if (err != ECTF_NEXT_END)
+ {
+ non_fatal (_("CTF error: cannot get CTF errors: `%s'"),
+ ctf_errmsg (err));
+ }
+}
+
/* Dump one CTF archive member. */
static int
"Function objects", "Variables", "Types", "Strings",
""};
const char **thing;
- ctf_next_t *it = NULL;
- char *errtext;
- int is_warning;
size_t i;
/* Only print out the name of non-default-named archive members.
}
}
- /* Dump accumulated errors and warnings. */
- while ((errtext = ctf_errwarning_next (ctf, &it, &is_warning)) != NULL)
- {
- non_fatal (_("%s: `%s'"), is_warning ? _("warning"): _("error"),
- errtext);
- free (errtext);
- }
- if (ctf_errno (ctf) != ECTF_NEXT_END)
- {
- non_fatal (_("CTF error: cannot get CTF errors: `%s'"),
- ctf_errmsg (ctf_errno (ctf)));
- }
+ dump_ctf_errs (ctf);
return 0;
}
ctfsect = make_ctfsect (sect_name, ctfdata, ctfsize);
if ((ctfa = ctf_bfdopen_ctfsect (abfd, &ctfsect, &err)) == NULL)
{
+ dump_ctf_errs (NULL);
non_fatal (_("CTF open failure: %s"), ctf_errmsg (err));
bfd_fatal (bfd_get_filename (abfd));
}
ctfsect = make_ctfsect (parent_name, parentdata, parentsize);
if ((parenta = ctf_bfdopen_ctfsect (abfd, &ctfsect, &err)) == NULL)
{
+ dump_ctf_errs (NULL);
non_fatal (_("CTF open failure: %s"), ctf_errmsg (err));
bfd_fatal (bfd_get_filename (abfd));
}
put CTFs and their parents in archives together.) */
if ((parent = ctf_arc_open_by_name (lookparent, NULL, &err)) == NULL)
{
+ dump_ctf_errs (NULL);
non_fatal (_("CTF open failure: %s"), ctf_errmsg (err));
bfd_fatal (bfd_get_filename (abfd));
}