aboutsummaryrefslogtreecommitdiff
path: root/libctf/ctf-open-bfd.c
diff options
context:
space:
mode:
Diffstat (limited to 'libctf/ctf-open-bfd.c')
-rw-r--r--libctf/ctf-open-bfd.c31
1 files changed, 17 insertions, 14 deletions
diff --git a/libctf/ctf-open-bfd.c b/libctf/ctf-open-bfd.c
index 9fcce2f..5541c9d 100644
--- a/libctf/ctf-open-bfd.c
+++ b/libctf/ctf-open-bfd.c
@@ -40,7 +40,8 @@ ctf_bfdclose (struct ctf_archive_internal *arci)
{
if (arci->ctfi_abfd != NULL)
if (!bfd_close_all_done (arci->ctfi_abfd))
- ctf_dprintf ("Cannot close BFD: %s\n", bfd_errmsg (bfd_get_error()));
+ ctf_err_warn (NULL, 0, 0, _("cannot close BFD: %s"),
+ bfd_errmsg (bfd_get_error ()));
}
/* Open a CTF file given the specified BFD. */
@@ -62,8 +63,9 @@ ctf_bfdopen (struct bfd *abfd, int *errp)
if (!bfd_malloc_and_get_section (abfd, ctf_asect, &contents))
{
- ctf_dprintf ("ctf_bfdopen(): cannot malloc CTF section: %s\n",
- bfd_errmsg (bfd_get_error()));
+ ctf_err_warn (NULL, 0, 0, _("ctf_bfdopen(): cannot malloc "
+ "CTF section: %s"),
+ bfd_errmsg (bfd_get_error ()));
return (ctf_set_open_errno (errp, ECTF_FMT));
}
@@ -112,7 +114,7 @@ ctf_bfdopen_ctfsect (struct bfd *abfd _libctf_unused_,
symcount = symhdr->sh_size / symhdr->sh_entsize;
if ((symtab = malloc (symhdr->sh_size)) == NULL)
{
- bfderrstr = "Cannot malloc symbol table";
+ bfderrstr = N_("cannot malloc symbol table");
goto err;
}
@@ -121,7 +123,7 @@ ctf_bfdopen_ctfsect (struct bfd *abfd _libctf_unused_,
free (isymbuf);
if (isymbuf == NULL)
{
- bfderrstr = "Cannot read symbol table";
+ bfderrstr = N_("cannot read symbol table");
goto err_free_sym;
}
@@ -135,7 +137,7 @@ ctf_bfdopen_ctfsect (struct bfd *abfd _libctf_unused_,
{
if ((strtab = bfd_elf_get_str_section (abfd, symhdr->sh_link)) == NULL)
{
- bfderrstr = "Cannot read string table";
+ bfderrstr = N_("cannot read string table");
goto err_free_sym;
}
}
@@ -199,7 +201,7 @@ ctf_bfdopen_ctfsect (struct bfd *abfd _libctf_unused_,
err: _libctf_unused_;
if (bfderrstr)
{
- ctf_dprintf ("ctf_bfdopen(): %s: %s\n", bfderrstr,
+ ctf_err_warn (NULL, 0, 0, "ctf_bfdopen(): %s: %s", gettext (bfderrstr),
bfd_errmsg (bfd_get_error()));
ctf_set_open_errno (errp, ECTF_FMT);
}
@@ -283,18 +285,18 @@ ctf_fdopen (int fd, const char *filename, const char *target, int *errp)
if ((abfd = bfd_fdopenr (filename, target, nfd)) == NULL)
{
- ctf_dprintf ("Cannot open BFD from %s: %s\n",
- filename ? filename : "(unknown file)",
- bfd_errmsg (bfd_get_error()));
+ ctf_err_warn (NULL, 0, 0, _("cannot open BFD from %s: %s"),
+ filename ? filename : _("(unknown file)"),
+ bfd_errmsg (bfd_get_error ()));
return (ctf_set_open_errno (errp, ECTF_FMT));
}
bfd_set_cacheable (abfd, 1);
if (!bfd_check_format (abfd, bfd_object))
{
- ctf_dprintf ("BFD format problem in %s: %s\n",
- filename ? filename : "(unknown file)",
- bfd_errmsg (bfd_get_error()));
+ ctf_err_warn (NULL, 0, 0, _("BFD format problem in %s: %s"),
+ filename ? filename : _("(unknown file)"),
+ bfd_errmsg (bfd_get_error ()));
if (bfd_get_error() == bfd_error_file_ambiguously_recognized)
return (ctf_set_open_errno (errp, ECTF_BFD_AMBIGUOUS));
else
@@ -304,7 +306,8 @@ ctf_fdopen (int fd, const char *filename, const char *target, int *errp)
if ((arci = ctf_bfdopen (abfd, errp)) == NULL)
{
if (!bfd_close_all_done (abfd))
- ctf_dprintf ("Cannot close BFD: %s\n", bfd_errmsg (bfd_get_error()));
+ ctf_err_warn (NULL, 0, 0, _("cannot close BFD: %s"),
+ bfd_errmsg (bfd_get_error ()));
return NULL; /* errno is set for us. */
}
arci->ctfi_bfd_close = ctf_bfdclose;