aboutsummaryrefslogtreecommitdiff
path: root/libctf/ctf-link.c
diff options
context:
space:
mode:
authorNick Alcock <nick.alcock@oracle.com>2020-07-27 16:45:15 +0100
committerNick Alcock <nick.alcock@oracle.com>2020-08-27 13:15:43 +0100
commit926c9e7665707d2f2eeb705b410e485f6930ab38 (patch)
tree8a0a3a001ca33b62ea9b8edd7b91cbfa12953233 /libctf/ctf-link.c
parent987cf30ad80c7c13f713aa8e4ca3e1dbf08e9d63 (diff)
downloadbinutils-926c9e7665707d2f2eeb705b410e485f6930ab38.zip
binutils-926c9e7665707d2f2eeb705b410e485f6930ab38.tar.gz
binutils-926c9e7665707d2f2eeb705b410e485f6930ab38.tar.bz2
libctf, binutils, include, ld: gettextize and improve error handling
This commit follows on from the earlier commit "libctf, ld, binutils: add textual error/warning reporting for libctf" and converts every error in libctf that was reported using ctf_dprintf to use ctf_err_warn instead, gettextizing them in the process, using N_() where necessary to avoid doing gettext calls unless an error message is actually generated, and rephrasing some error messages for ease of translation. This requires a slight change in the ctf_errwarning_next API: this API is public but has not been in a release yet, so can still change freely. The problem is that many errors are emitted at open time (whether opening of a CTF dict, or opening of a CTF archive): the former of these throws away its incompletely-initialized ctf_file_t rather than return it, and the latter has no ctf_file_t at all. So errors and warnings emitted at open time cannot be stored in the ctf_file_t, and have to go elsewhere. We put them in a static local in ctf-subr.c (which is not very thread-safe: a later commit will improve things here): ctf_err_warn with a NULL fp adds to this list, and the public interface ctf_errwarning_next with a NULL fp retrieves from it. We need a slight exception from the usual iterator rules in this case: with a NULL fp, there is nowhere to store the ECTF_NEXT_END "error" which signifies the end of iteration, so we add a new err parameter to ctf_errwarning_next which is used to report such iteration-related errors. (If an fp is provided -- i.e., if not reporting open errors -- this is optional, but even if it's optional it's still an API change. This is actually useful from a usability POV as well, since ctf_errwarning_next is usually called when there's been an error, so overwriting the error code with ECTF_NEXT_END is not very helpful! So, unusually, ctf_errwarning_next now uses the passed fp for its error code *only* if no errp pointer is passed in, and leaves it untouched otherwise.) ld, objdump and readelf are adapted to call ctf_errwarning_next with a NULL fp to report open errors where appropriate. The ctf_err_warn API also has to change, gaining a new error-number parameter which is used to add the error message corresponding to that error number into the debug stream when LIBCTF_DEBUG is enabled: changing this API is easy at this point since we are already touching all existing calls to gettextize them. We need this because the debug stream should contain the errno's message, but the error reported in the error/warning stream should *not*, because the caller will probably report it themselves at failure time regardless, and reporting it in every error message that leads up to it leads to a ridiculous chattering on failure, which is likely to end up as ridiculous chattering on stderr (trimmed a bit): CTF error: `ld/testsuite/ld-ctf/A.c (0): lookup failure for type 3: flags 1: The parent CTF dictionary is unavailable' CTF error: `ld/testsuite/ld-ctf/A.c (0): struct/union member type hashing error during type hashing for type 80000001, kind 6: The parent CTF dictionary is unavailable' CTF error: `deduplicating link variable emission failed for ld/testsuite/ld-ctf/A.c: The parent CTF dictionary is unavailable' ld/.libs/lt-ld-new: warning: CTF linking failed; output will have no CTF section: `The parent CTF dictionary is unavailable' We only need to be told that the parent CTF dictionary is unavailable *once*, not over and over again! errmsgs are still emitted on warning generation, because warnings do not usually lead to a failure propagated up to the caller and reported there. Debug-stream messages are not translated. If translation is turned on, there will be a mixture of English and translated messages in the debug stream, but rather that than burden the translators with debug-only output. binutils/ChangeLog 2020-08-27 Nick Alcock <nick.alcock@oracle.com> * objdump.c (dump_ctf_archive_member): Move error- reporting... (dump_ctf_errs): ... into this separate function. (dump_ctf): Call it on open errors. * readelf.c (dump_ctf_archive_member): Move error- reporting... (dump_ctf_errs): ... into this separate function. Support calls with NULL fp. Adjust for new err parameter to ctf_errwarning_next. (dump_section_as_ctf): Call it on open errors. include/ChangeLog 2020-08-27 Nick Alcock <nick.alcock@oracle.com> * ctf-api.h (ctf_errwarning_next): New err parameter. ld/ChangeLog 2020-08-27 Nick Alcock <nick.alcock@oracle.com> * ldlang.c (lang_ctf_errs_warnings): Support calls with NULL fp. Adjust for new err parameter to ctf_errwarning_next. Only check for assertion failures when fp is non-NULL. (ldlang_open_ctf): Call it on open errors. * testsuite/ld-ctf/ctf.exp: Always use the C locale to avoid breaking the diags tests. libctf/ChangeLog 2020-08-27 Nick Alcock <nick.alcock@oracle.com> * ctf-subr.c (open_errors): New list. (ctf_err_warn): Calls with NULL fp append to open_errors. Add err parameter, and use it to decorate the debug stream with errmsgs. (ctf_err_warn_to_open): Splice errors from a CTF dict into the open_errors. (ctf_errwarning_next): Calls with NULL fp report from open_errors. New err param to report iteration errors (including end-of-iteration) when fp is NULL. (ctf_assert_fail_internal): Adjust ctf_err_warn call for new err parameter: gettextize. * ctf-impl.h (ctfo_get_vbytes): Add ctf_file_t parameter. (LCTF_VBYTES): Adjust. (ctf_err_warn_to_open): New. (ctf_err_warn): Adjust. (ctf_bundle): Used in only one place: move... * ctf-create.c: ... here. (enumcmp): Use ctf_err_warn, not ctf_dprintf, passing the err number down as needed. Don't emit the errmsg. Gettextize. (membcmp): Likewise. (ctf_add_type_internal): Likewise. (ctf_write_mem): Likewise. (ctf_compress_write): Likewise. Report errors writing the header or body. (ctf_write): Likewise. * ctf-archive.c (ctf_arc_write_fd): Use ctf_err_warn, not ctf_dprintf, and gettextize, as above. (ctf_arc_write): Likewise. (ctf_arc_bufopen): Likewise. (ctf_arc_open_internal): Likewise. * ctf-labels.c (ctf_label_iter): Likewise. * ctf-open-bfd.c (ctf_bfdclose): Likewise. (ctf_bfdopen): Likewise. (ctf_bfdopen_ctfsect): Likewise. (ctf_fdopen): Likewise. * ctf-string.c (ctf_str_write_strtab): Likewise. * ctf-types.c (ctf_type_resolve): Likewise. * ctf-open.c (get_vbytes_common): Likewise. Pass down the ctf dict. (get_vbytes_v1): Pass down the ctf dict. (get_vbytes_v2): Likewise. (flip_ctf): Likewise. (flip_types): Likewise. Use ctf_err_warn, not ctf_dprintf, and gettextize, as above. (upgrade_types_v1): Adjust calls. (init_types): Use ctf_err_warn, not ctf_dprintf, as above. (ctf_bufopen_internal): Likewise. Adjust calls. Transplant errors emitted into individual dicts into the open errors if this turns out to be a failed open in the end. * ctf-dump.c (ctf_dump_format_type): Adjust ctf_err_warn for new err argument. Gettextize. Don't emit the errmsg. (ctf_dump_funcs): Likewise. Collapse err label into its only case. (ctf_dump_type): Likewise. * ctf-link.c (ctf_create_per_cu): Adjust ctf_err_warn for new err argument. Gettextize. Don't emit the errmsg. (ctf_link_one_type): Likewise. (ctf_link_lazy_open): Likewise. (ctf_link_one_input_archive): Likewise. (ctf_link_deduplicating_count_inputs): Likewise. (ctf_link_deduplicating_open_inputs): Likewise. (ctf_link_deduplicating_close_inputs): Likewise. (ctf_link_deduplicating): Likewise. (ctf_link): Likewise. (ctf_link_deduplicating_per_cu): Likewise. Add some missed ctf_set_errnos to obscure error cases. * ctf-dedup.c (ctf_dedup_rhash_type): Adjust ctf_err_warn for new err argument. Gettextize. Don't emit the errmsg. (ctf_dedup_populate_mappings): Likewise. (ctf_dedup_detect_name_ambiguity): Likewise. (ctf_dedup_init): Likewise. (ctf_dedup_multiple_input_dicts): Likewise. (ctf_dedup_conflictify_unshared): Likewise. (ctf_dedup): Likewise. (ctf_dedup_rwalk_one_output_mapping): Likewise. (ctf_dedup_id_to_target): Likewise. (ctf_dedup_emit_type): Likewise. (ctf_dedup_emit_struct_members): Likewise. (ctf_dedup_populate_type_mapping): Likewise. (ctf_dedup_populate_type_mappings): Likewise. (ctf_dedup_emit): Likewise. (ctf_dedup_hash_type): Likewise. Fix a bit of messed-up error status setting. (ctf_dedup_rwalk_one_output_mapping): Likewise. Don't hide unknown-type-kind messages (which signify file corruption).
Diffstat (limited to 'libctf/ctf-link.c')
-rw-r--r--libctf/ctf-link.c133
1 files changed, 68 insertions, 65 deletions
diff --git a/libctf/ctf-link.c b/libctf/ctf-link.c
index f269fe7..1cda324 100644
--- a/libctf/ctf-link.c
+++ b/libctf/ctf-link.c
@@ -314,9 +314,9 @@ ctf_create_per_cu (ctf_file_t *fp, const char *filename, const char *cuname)
if ((cu_fp = ctf_create (&err)) == NULL)
{
- ctf_err_warn (fp, 0, "Cannot create per-CU CTF archive for "
- "CU %s from input file %s: %s", cuname, filename,
- ctf_errmsg (err));
+ ctf_err_warn (fp, 0, err, _("cannot create per-CU CTF archive for "
+ "CU %s from input file %s"),
+ cuname, filename);
ctf_set_errno (fp, err);
return NULL;
}
@@ -477,7 +477,8 @@ ctf_link_one_type (ctf_id_t type, int isroot _libctf_unused_, void *arg_)
if (arg->in_fp->ctf_link_flags != CTF_LINK_SHARE_UNCONFLICTED)
{
- ctf_err_warn (arg->out_fp, 0, "Share-duplicated mode not yet implemented");
+ ctf_err_warn (arg->out_fp, 0, ECTF_NOTYET,
+ _("share-duplicated mode not yet implemented"));
return ctf_set_errno (arg->out_fp, ECTF_NOTYET);
}
@@ -495,9 +496,10 @@ ctf_link_one_type (ctf_id_t type, int isroot _libctf_unused_, void *arg_)
if (err != ECTF_CONFLICT)
{
if (err != ECTF_NONREPRESENTABLE)
- ctf_err_warn (arg->out_fp, 1, "Cannot link type %lx from input file %s, "
- "CU %s into output link: %s", type, arg->cu_name,
- arg->in_file_name, ctf_errmsg (err));
+ ctf_err_warn (arg->out_fp, 1, 0,
+ _("cannot link type %lx from input file %s, CU %s "
+ "into output link"), type, arg->cu_name,
+ arg->in_file_name);
/* We must ignore this problem or we end up losing future types, then
trying to link the variables in, then exploding. Better to link as
much as possible. */
@@ -515,10 +517,11 @@ ctf_link_one_type (ctf_id_t type, int isroot _libctf_unused_, void *arg_)
err = ctf_errno (per_cu_out_fp);
if (err != ECTF_NONREPRESENTABLE)
- ctf_err_warn (arg->out_fp, 1, "Cannot link type %lx from input file %s, CU %s "
- "into output per-CU CTF archive member %s: %s: skipped", type,
- ctf_link_input_name (arg->in_fp), arg->in_file_name,
- ctf_link_input_name (per_cu_out_fp), ctf_errmsg (err));
+ ctf_err_warn (arg->out_fp, 1, 0,
+ _("cannot link type %lx from input file %s, CU %s "
+ "into output per-CU CTF archive member %s: %s: skipped"),
+ type, ctf_link_input_name (arg->in_fp), arg->in_file_name,
+ ctf_link_input_name (per_cu_out_fp), ctf_errmsg (err));
if (err == ECTF_CONFLICT)
/* Conflicts are possible at this stage only if a non-ld user has combined
multiple TUs into a single output dictionary. Even in this case we do not
@@ -633,8 +636,9 @@ ctf_link_one_variable (const char *name, ctf_id_t type, void *arg_)
if (dst_type == 0)
{
- ctf_err_warn (arg->out_fp, 1, "Type %lx for variable %s in input "
- "file %s not found: skipped", type, name,
+ ctf_err_warn (arg->out_fp, 1, 0,
+ _("type %lx for variable %s in input file %s "
+ "not found: skipped"), type, name,
arg->in_file_name);
/* Do not terminate the link: just skip the variable. */
return 0;
@@ -727,8 +731,8 @@ ctf_link_lazy_open (ctf_file_t *fp, ctf_link_input_t *input)
#if defined (PIC) || !NOBFD
input->clin_arc = ctf_open (input->clin_filename, NULL, &err);
#else
- ctf_err_warn (fp, 0, "Cannot open %s lazily: %s", input->clin_filename,
- ctf_errmsg (ECTF_NEEDSBFD));
+ ctf_err_warn (fp, 0, ECTF_NEEDSBFD, _("cannot open %s lazily"),
+ input->clin_filename);
ctf_set_errno (fp, ECTF_NEEDSBFD);
return -1;
#endif
@@ -741,8 +745,8 @@ ctf_link_lazy_open (ctf_file_t *fp, ctf_link_input_t *input)
if (err == ECTF_NOCTFDATA)
return 0;
- ctf_err_warn (fp, 0, "Opening CTF %s failed: %s",
- input->clin_filename, ctf_errmsg (err));
+ ctf_err_warn (fp, 0, err, _("opening CTF %s failed"),
+ input->clin_filename);
ctf_set_errno (fp, err);
return -1;
}
@@ -789,9 +793,10 @@ ctf_link_one_input_archive (void *key, void *value, void *arg_)
&err)) == NULL)
if (err != ECTF_ARNNAME)
{
- ctf_err_warn (arg->out_fp, 0, "Cannot open main archive member in "
- "input file %s in the link: skipping: %s",
- arg->in_file_name, ctf_errmsg (err));
+ ctf_err_warn (arg->out_fp, 1, 0,
+ _("cannot open main archive member in input file %s "
+ "in the link: skipping: %s"), arg->in_file_name,
+ ctf_errmsg (err));
goto out;
}
@@ -804,9 +809,9 @@ ctf_link_one_input_archive (void *key, void *value, void *arg_)
arg->done_parent = 1;
if (ctf_archive_iter (input->clin_arc, ctf_link_one_input_archive_member,
arg) < 0)
- ctf_err_warn (arg->out_fp, 0, "Cannot traverse archive in input file %s: "
- "link cannot continue: %s", arg->in_file_name,
- ctf_errmsg (ctf_errno (arg->out_fp)));
+ ctf_err_warn (arg->out_fp, 0, 0, _("cannot traverse archive in input file "
+ "%s: link cannot continue"),
+ arg->in_file_name);
else
{
/* The only error indication to the caller is the errno: so ensure that it
@@ -911,8 +916,8 @@ ctf_link_deduplicating_count_inputs (ctf_file_t *fp, ctf_dynhash_t *cu_names,
}
if (err != ECTF_NEXT_END)
{
- ctf_err_warn (fp, 0, "Iteration error counting deduplicating CTF link "
- "inputs: %s", ctf_errmsg (err));
+ ctf_err_warn (fp, 0, err, _("iteration error counting deduplicating "
+ "CTF link inputs"));
ctf_set_errno (fp, err);
return -1;
}
@@ -1073,8 +1078,8 @@ ctf_link_deduplicating_open_inputs (ctf_file_t *fp, ctf_dynhash_t *cu_names,
err:
free (dedup_inputs);
free (parents_);
- ctf_err_warn (fp, 0, "Error in deduplicating CTF link input allocation: %s",
- ctf_errmsg (ctf_errno (fp)));
+ ctf_err_warn (fp, 0, 0, _("error in deduplicating CTF link "
+ "input allocation"));
return NULL;
}
@@ -1108,8 +1113,8 @@ ctf_link_deduplicating_close_inputs (ctf_file_t *fp, ctf_dynhash_t *cu_names,
}
if (err != ECTF_NEXT_END)
{
- ctf_err_warn (fp, 0, "Iteration error in deduplicating link input "
- "freeing: %s", ctf_errmsg (err));
+ ctf_err_warn (fp, 0, err, _("iteration error in deduplicating link "
+ "input freeing"));
ctf_set_errno (fp, err);
}
}
@@ -1186,8 +1191,9 @@ ctf_link_deduplicating_per_cu (ctf_file_t *fp)
if (labs ((long int) ninputs) > 0xfffffffe)
{
- ctf_err_warn (fp, 0, "Too many inputs in deduplicating link: %li",
- (long int) ninputs);
+ ctf_err_warn (fp, 0, EFBIG, _("too many inputs in deduplicating "
+ "link: %li"), (long int) ninputs);
+ ctf_set_errno (fp, EFBIG);
goto err_open_inputs;
}
@@ -1209,9 +1215,9 @@ ctf_link_deduplicating_per_cu (ctf_file_t *fp)
&ai, NULL, 0, &err);
if (!only_input->clin_fp)
{
- ctf_err_warn (fp, 0, "Cannot open archive %s in CU-mapped CTF "
- "link: %s", only_input->clin_filename,
- ctf_errmsg (err));
+ ctf_err_warn (fp, 0, err, _("cannot open archive %s in "
+ "CU-mapped CTF link"),
+ only_input->clin_filename);
ctf_set_errno (fp, err);
goto err_open_inputs;
}
@@ -1231,8 +1237,8 @@ ctf_link_deduplicating_per_cu (ctf_file_t *fp)
only_input->clin_fp,
out_name) < 0)
{
- ctf_err_warn (fp, 0, "Cannot add intermediate files "
- "to link: %s", ctf_errmsg (ctf_errno (fp)));
+ ctf_err_warn (fp, 0, 0, _("cannot add intermediate files "
+ "to link"));
goto err_open_inputs;
}
only_input->clin_arc = NULL;
@@ -1255,8 +1261,9 @@ ctf_link_deduplicating_per_cu (ctf_file_t *fp)
if ((out = ctf_create (&err)) == NULL)
{
- ctf_err_warn (fp, 0, "Cannot create per-CU CTF archive for %s: %s",
- out_name, ctf_errmsg (err));
+ ctf_err_warn (fp, 0, err, _("cannot create per-CU CTF archive "
+ "for %s"),
+ out_name);
ctf_set_errno (fp, err);
goto err_inputs;
}
@@ -1272,17 +1279,18 @@ ctf_link_deduplicating_per_cu (ctf_file_t *fp)
if (ctf_dedup (out, inputs, ninputs, parents, 1) < 0)
{
- ctf_err_warn (fp, 0, "CU-mapped deduplication failed for %s: %s",
- out_name, ctf_errmsg (ctf_errno (out)));
+ ctf_set_errno (fp, ctf_errno (out));
+ ctf_err_warn (fp, 0, 0, _("CU-mapped deduplication failed for %s"),
+ out_name);
goto err_inputs;
}
if ((outputs = ctf_dedup_emit (out, inputs, ninputs, parents,
&noutputs, 1)) == NULL)
{
- ctf_err_warn (fp, 0, "CU-mapped deduplicating link type emission "
- "failed for %s: %s", out_name,
- ctf_errmsg (ctf_errno (out)));
+ ctf_set_errno (fp, ctf_errno (out));
+ ctf_err_warn (fp, 0, 0, _("CU-mapped deduplicating link type emission "
+ "failed for %s"), out_name);
goto err_inputs;
}
if (!ctf_assert (fp, noutputs == 1))
@@ -1291,9 +1299,9 @@ ctf_link_deduplicating_per_cu (ctf_file_t *fp)
if (!(fp->ctf_link_flags & CTF_LINK_OMIT_VARIABLES_SECTION)
&& ctf_link_deduplicating_variables (out, inputs, ninputs, 1) < 0)
{
- ctf_err_warn (fp, 0, "CU-mapped deduplicating link variable "
- "emission failed for %s: %s", out_name,
- ctf_errmsg (ctf_errno (out)));
+ ctf_set_errno (fp, ctf_errno (out));
+ ctf_err_warn (fp, 0, 0, _("CU-mapped deduplicating link variable "
+ "emission failed for %s"), out_name);
goto err_inputs_outputs;
}
@@ -1324,8 +1332,7 @@ ctf_link_deduplicating_per_cu (ctf_file_t *fp)
if (ctf_link_add_ctf_internal (fp, in_arc, NULL,
ctf_cuname (outputs[0])) < 0)
{
- ctf_err_warn (fp, 0, "Cannot add intermediate files to link: %s",
- ctf_errmsg (ctf_errno (fp)));
+ ctf_err_warn (fp, 0, 0, _("cannot add intermediate files to link"));
goto err_outputs;
}
@@ -1355,8 +1362,8 @@ ctf_link_deduplicating_per_cu (ctf_file_t *fp)
}
if (err != ECTF_NEXT_END)
{
- ctf_err_warn (fp, 0, "Iteration error in CU-mapped deduplicating "
- "link: %s", ctf_errmsg (err));
+ ctf_err_warn (fp, 0, err, _("iteration error in CU-mapped deduplicating "
+ "link"));
return ctf_set_errno (fp, err);
}
@@ -1375,8 +1382,7 @@ ctf_link_deduplicating (ctf_file_t *fp)
if (ctf_dedup_atoms_init (fp) < 0)
{
- ctf_err_warn (fp, 0, "%s allocating CTF dedup atoms table",
- ctf_errmsg (ctf_errno (fp)));
+ ctf_err_warn (fp, 0, 0, _("allocating CTF dedup atoms table"));
return; /* Errno is set for us. */
}
@@ -1396,17 +1402,16 @@ ctf_link_deduplicating (ctf_file_t *fp)
if (ctf_dedup (fp, inputs, ninputs, parents, 0) < 0)
{
- ctf_err_warn (fp, 0, "Deduplication failed for %s: %s",
- ctf_link_input_name (fp), ctf_errmsg (ctf_errno (fp)));
+ ctf_err_warn (fp, 0, 0, _("deduplication failed for %s"),
+ ctf_link_input_name (fp));
goto err;
}
if ((outputs = ctf_dedup_emit (fp, inputs, ninputs, parents, &noutputs,
0)) == NULL)
{
- ctf_err_warn (fp, 0, "Deduplicating link type emission failed "
- "for %s: %s", ctf_link_input_name (fp),
- ctf_errmsg (ctf_errno (fp)));
+ ctf_err_warn (fp, 0, 0, _("deduplicating link type emission failed "
+ "for %s"), ctf_link_input_name (fp));
goto err;
}
@@ -1433,8 +1438,8 @@ ctf_link_deduplicating (ctf_file_t *fp)
continue;
oom_one_output:
- ctf_err_warn (fp, 0, "Out of memory allocating link outputs");
ctf_set_errno (fp, ENOMEM);
+ ctf_err_warn (fp, 0, 0, _("out of memory allocating link outputs"));
free (dynname);
for (; i < noutputs; i++)
@@ -1445,9 +1450,8 @@ ctf_link_deduplicating (ctf_file_t *fp)
if (!(fp->ctf_link_flags & CTF_LINK_OMIT_VARIABLES_SECTION)
&& ctf_link_deduplicating_variables (fp, inputs, ninputs, 0) < 0)
{
- ctf_err_warn (fp, 0, "Deduplicating link variable emission failed for "
- "%s: %s", ctf_link_input_name (fp),
- ctf_errmsg (ctf_errno (fp)));
+ ctf_err_warn (fp, 0, 0, _("deduplicating link variable emission failed for "
+ "%s"), ctf_link_input_name (fp));
for (i = 1; i < noutputs; i++)
ctf_file_close (outputs[i]);
goto err;
@@ -1517,8 +1521,7 @@ ctf_link (ctf_file_t *fp, int flags)
}
if (err != ECTF_NEXT_END)
{
- ctf_err_warn (fp, 1, "Iteration error creating empty CUs: %s",
- ctf_errmsg (err));
+ ctf_err_warn (fp, 1, err, _("iteration error creating empty CUs"));
ctf_set_errno (fp, err);
return -1;
}
@@ -1823,7 +1826,7 @@ ctf_link_write (ctf_file_t *fp, size_t *size, size_t threshold)
free (arg.dynames[i]);
free (arg.dynames);
}
- ctf_err_warn (fp, 0, "Cannot write archive in link: %s failure: %s", errloc,
- ctf_errmsg (ctf_errno (fp)));
+ ctf_err_warn (fp, 0, 0, _("cannot write archive in link: %s failure"),
+ errloc);
return NULL;
}