diff options
Diffstat (limited to 'ld')
-rw-r--r-- | ld/ChangeLog | 7 | ||||
-rw-r--r-- | ld/ldlang.c | 26 |
2 files changed, 33 insertions, 0 deletions
diff --git a/ld/ChangeLog b/ld/ChangeLog index aef3d97..6927287 100644 --- a/ld/ChangeLog +++ b/ld/ChangeLog @@ -1,3 +1,10 @@ +2020-07-22 Nick Alcock <nick.alcock@oracle.com> + + * ldlang.c (lang_ctf_errs_warnings): New, print CTF errors + and warnings. Assert when libctf asserts. + (lang_merge_ctf): Call it. + (land_write_ctf): Likewise. + 2020-07-22 H.J. Lu <hongjiu.lu@intel.com> PR ld/26262 diff --git a/ld/ldlang.c b/ld/ldlang.c index d3ed5d4..cc64e7a 100644 --- a/ld/ldlang.c +++ b/ld/ldlang.c @@ -3725,6 +3725,29 @@ ldlang_open_ctf (void) ctf_close (errfile->the_ctf); } +/* Emit CTF errors and warnings. */ +static void +lang_ctf_errs_warnings (ctf_file_t *fp) +{ + ctf_next_t *i = NULL; + char *text; + int is_warning; + + while ((text = ctf_errwarning_next (fp, &i, &is_warning)) != NULL) + { + einfo (_("%s: `%s'\n"), is_warning ? _("CTF warning"): _("CTF error"), + text); + free (text); + } + if (ctf_errno (fp) != ECTF_NEXT_END) + { + einfo (_("CTF error: cannot get CTF errors: `%s'\n"), + ctf_errmsg (ctf_errno (fp))); + } + + ASSERT (ctf_errno (fp) != ECTF_INTERNAL); +} + /* Merge together CTF sections. After this, only the symtab-dependent function and data object sections need adjustment. */ @@ -3778,6 +3801,7 @@ lang_merge_ctf (void) output_sect->flags |= SEC_EXCLUDE; } } + lang_ctf_errs_warnings (ctf_output); } /* Let the emulation examine the symbol table and strtab to help it optimize the @@ -3831,6 +3855,8 @@ lang_write_ctf (int late) output_sect->size = 0; output_sect->flags |= SEC_EXCLUDE; } + + lang_ctf_errs_warnings (ctf_output); } /* This also closes every CTF input file used in the link. */ |