diff options
Diffstat (limited to 'binutils')
-rw-r--r-- | binutils/ChangeLog | 5 | ||||
-rw-r--r-- | binutils/objdump.c | 17 | ||||
-rw-r--r-- | binutils/readelf.c | 23 |
3 files changed, 43 insertions, 2 deletions
diff --git a/binutils/ChangeLog b/binutils/ChangeLog index 7aead1a..7169509 100644 --- a/binutils/ChangeLog +++ b/binutils/ChangeLog @@ -1,3 +1,8 @@ +2020-07-22 Nick Alcock <nick.alcock@oracle.com> + + * objdump.c (ctf_archive_member): Print CTF errors and warnings. + * readelf.c (dump_ctf_archive_member): Likewise. + 2020-07-22 Nick Clifton <nickc@redhat.com> * readelf.c (parse_args): Silence potential warnings about a diff --git a/binutils/objdump.c b/binutils/objdump.c index 93508e2..8d4b1b6 100644 --- a/binutils/objdump.c +++ b/binutils/objdump.c @@ -4081,6 +4081,9 @@ dump_ctf_archive_member (ctf_file_t *ctf, const char *name, void *arg) "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. @@ -4117,6 +4120,20 @@ dump_ctf_archive_member (ctf_file_t *ctf, const char *name, void *arg) break; } } + + /* 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))); + } + return 0; } diff --git a/binutils/readelf.c b/binutils/readelf.c index c3cbd2c..421992d 100644 --- a/binutils/readelf.c +++ b/binutils/readelf.c @@ -14215,7 +14215,11 @@ dump_ctf_archive_member (ctf_file_t *ctf, const char *name, void *arg) "Function objects", "Variables", "Types", "Strings", ""}; const char **thing; + ctf_next_t *it = NULL; + char *errtext; + int is_warning; size_t i; + int err = 0; /* Only print out the name of non-default-named archive members. The name .ctf appears everywhere, even for things that aren't @@ -14248,10 +14252,25 @@ dump_ctf_archive_member (ctf_file_t *ctf, const char *name, void *arg) { error (_("Iteration failed: %s, %s\n"), *thing, ctf_errmsg (ctf_errno (ctf))); - return 1; + err = 1; + goto out; } } - return 0; + + out: + /* Dump accumulated errors and warnings. */ + while ((errtext = ctf_errwarning_next (ctf, &it, &is_warning)) != NULL) + { + error (_("%s: `%s'\n"), is_warning ? _("warning"): _("error"), + errtext); + free (errtext); + } + if (ctf_errno (ctf) != ECTF_NEXT_END) + { + error (_("CTF error: cannot get CTF errors: `%s'\n"), + ctf_errmsg (ctf_errno (ctf))); + } + return err; } static bfd_boolean |