Dwfl_Module *mod = NULL;
if (dwfl_getmodules (dwfl, &see_one_module, &mod, 0) != 0
|| mod == NULL)
- error (EXIT_FAILURE, 0, gettext ("Section syntax requires"
+ error (EXIT_FAILURE, 0, _("Section syntax requires"
" exactly one module"));
int nscn = dwfl_module_relocations (mod);
if (*addr >= shdr->sh_size)
error (0, 0,
- gettext ("offset %#" PRIxMAX " lies outside"
+ _("offset %#" PRIxMAX " lies outside"
" section '%s'"),
*addr, scn);
void *arg[3] = { name, &sym, &value };
(void) dwfl_getmodules (dwfl, &find_symbol, arg, 0);
if (arg[0] != NULL)
- error (0, 0, gettext ("cannot find symbol '%s'"), name);
+ error (0, 0, _("cannot find symbol '%s'"), name);
else
{
if (sym.st_size != 0 && addr >= sym.st_size)
error (0, 0,
- gettext ("offset %#" PRIxMAX " lies outside"
+ _("offset %#" PRIxMAX " lies outside"
" contents of '%s'"),
addr, name);
addr += value;
{
/* Only valid for certain operations. */
if (operation != oper_move && operation != oper_replace)
- error (1, 0, gettext ("\
+ error (1, 0, _("\
'a', 'b', and 'i' are only allowed with the 'm' and 'r' options"));
if (remaining == argc)
{
- error (0, 0, gettext ("\
+ error (0, 0, _("\
MEMBER parameter required for 'a', 'b', and 'i' modifiers"));
argp_help (&argp, stderr, ARGP_HELP_USAGE | ARGP_HELP_SEE,
program_invocation_short_name);
{
/* Only valid for certain operations. */
if (operation != oper_extract && operation != oper_delete)
- error (1, 0, gettext ("\
+ error (1, 0, _("\
'N' is only meaningful with the 'x' and 'd' options"));
if (remaining == argc)
{
- error (0, 0, gettext ("COUNT parameter required"));
+ error (0, 0, _("COUNT parameter required"));
argp_help (&argp, stderr, ARGP_HELP_SEE,
program_invocation_short_name);
exit (EXIT_FAILURE);
&& errno == ERANGE)
|| instance <= 0
|| *endp != '\0')
- error (1, 0, gettext ("invalid COUNT parameter %s"), argv[remaining]);
+ error (1, 0, _("invalid COUNT parameter %s"), argv[remaining]);
++remaining;
}
if ((dont_replace_existing || allow_truncate_fname)
&& unlikely (operation != oper_extract))
- error (1, 0, gettext ("'%c' is only meaningful with the 'x' option"),
+ error (1, 0, _("'%c' is only meaningful with the 'x' option"),
dont_replace_existing ? 'C' : 'T');
/* There must at least be one more parameter specifying the archive. */
if (remaining == argc)
{
- error (0, 0, gettext ("archive name required"));
+ error (0, 0, _("archive name required"));
argp_help (&argp, stderr, ARGP_HELP_SEE, program_invocation_short_name);
exit (EXIT_FAILURE);
}
switch (operation)
{
case oper_none:
- error (0, 0, gettext ("command option required"));
+ error (0, 0, _("command option required"));
argp_help (&argp, stderr, ARGP_HELP_STD_ERR,
program_invocation_short_name);
status = 1;
case 'x':
if (operation != oper_none)
{
- error (0, 0, gettext ("More than one operation specified"));
+ error (0, 0, _("More than one operation specified"));
argp_help (&argp, stderr, ARGP_HELP_SEE,
program_invocation_short_name);
exit (EXIT_FAILURE);
if (miss_allowed)
return -1;
- error (EXIT_FAILURE, errno, gettext ("cannot open archive '%s'"),
+ error (EXIT_FAILURE, errno, _("cannot open archive '%s'"),
arfname);
}
*elf = elf_begin (fd, cmd, NULL);
if (*elf == NULL)
- error (EXIT_FAILURE, 0, gettext ("cannot open archive '%s': %s"),
+ error (EXIT_FAILURE, 0, _("cannot open archive '%s': %s"),
arfname, elf_errmsg (-1));
if (flags == O_RDONLY && elf_kind (*elf) != ELF_K_AR)
- error (EXIT_FAILURE, 0, gettext ("%s: not an archive file"), arfname);
+ error (EXIT_FAILURE, 0, _("%s: not an archive file"), arfname);
}
if (st != NULL && fstat (fd, st) != 0)
- error (EXIT_FAILURE, errno, gettext ("cannot stat archive '%s'"),
+ error (EXIT_FAILURE, errno, _("cannot stat archive '%s'"),
arfname);
return fd;
{
for (int i = 0; i < argc; ++i)
if (!found[i])
- printf (gettext ("no entry %s in archive\n"), argv[i]);
+ printf (_("no entry %s in archive\n"), argv[i]);
}
int fd = open_archive (arfname, O_RDONLY, 0, &elf, NULL, false);
if (hcreate (2 * argc) == 0)
- error (EXIT_FAILURE, errno, gettext ("cannot create hash table"));
+ error (EXIT_FAILURE, errno, _("cannot create hash table"));
for (int cnt = 0; cnt < argc; ++cnt)
{
ENTRY entry = { .key = argv[cnt], .data = &argv[cnt] };
if (hsearch (entry, ENTER) == NULL)
error (EXIT_FAILURE, errno,
- gettext ("cannot insert into hash table"));
+ _("cannot insert into hash table"));
}
struct stat st;
{
if (fstat (fd, &st) != 0)
{
- error (0, errno, gettext ("cannot stat '%s'"), arfname);
+ error (0, errno, _("cannot stat '%s'"), arfname);
close (fd);
return 1;
}
char *data = elf_rawfile (subelf, &nleft);
if (data == NULL)
{
- error (0, 0, gettext ("cannot read content of %s: %s"),
+ error (0, 0, _("cannot read content of %s: %s"),
arhdr->ar_name, elf_errmsg (-1));
status = 1;
goto next;
if (xfd == -1)
{
- error (0, errno, gettext ("cannot open %.*s"),
+ error (0, errno, _("cannot open %.*s"),
(int) printlen, arhdr->ar_name);
status = 1;
goto next;
if (unlikely (n == -1))
{
- error (0, errno, gettext ("failed to write %s"), arhdr->ar_name);
+ error (0, errno, _("failed to write %s"), arhdr->ar_name);
status = 1;
unlink (tempfname);
close (xfd);
/* Fix up the mode. */
if (unlikely (fchmod (xfd, arhdr->ar_mode) != 0))
{
- error (0, errno, gettext ("cannot change mode of %s"),
+ error (0, errno, _("cannot change mode of %s"),
arhdr->ar_name);
status = 0;
}
if (unlikely (futimens (xfd, tv) != 0))
{
error (0, errno,
- gettext ("cannot change modification time of %s"),
+ _("cannot change modification time of %s"),
arhdr->ar_name);
status = 1;
}
if (r != 0)
{
- error (0, errno, gettext ("\
+ error (0, errno, _("\
cannot rename temporary file to %.*s"),
printlen, arhdr->ar_name);
unlink (tempfname);
if (unlikely (newfd == -1))
{
nonew:
- error (0, errno, gettext ("cannot create new file"));
+ error (0, errno, _("cannot create new file"));
status = 1;
}
else
int fd = open_archive (arfname, O_RDONLY, 0, &elf, &st, false);
if (hcreate (2 * argc) == 0)
- error (EXIT_FAILURE, errno, gettext ("cannot create hash table"));
+ error (EXIT_FAILURE, errno, _("cannot create hash table"));
for (int cnt = 0; cnt < argc; ++cnt)
{
ENTRY entry = { .key = argv[cnt], .data = &argv[cnt] };
if (hsearch (entry, ENTER) == NULL)
error (EXIT_FAILURE, errno,
- gettext ("cannot insert into hash table"));
+ _("cannot insert into hash table"));
}
arlib_init ();
if (newfd != -1)
close (newfd);
nonew:
- error (0, errno, gettext ("cannot create new file"));
+ error (0, errno, _("cannot create new file"));
status = 1;
goto errout;
}
if (oper != oper_qappend)
{
if (hcreate (2 * argc) == 0)
- error (EXIT_FAILURE, errno, gettext ("cannot create hash table"));
+ error (EXIT_FAILURE, errno, _("cannot create hash table"));
for (int cnt = 0; cnt < argc; ++cnt)
{
entry.data = &argv[cnt];
if (hsearch (entry, ENTER) == NULL)
error (EXIT_FAILURE, errno,
- gettext ("cannot insert into hash table"));
+ _("cannot insert into hash table"));
}
}
no_old:
if (member != NULL)
- error (EXIT_FAILURE, 0, gettext ("position member %s not found"),
+ error (EXIT_FAILURE, 0, _("position member %s not found"),
member);
if (oper == oper_move)
{
if (found[cnt] == NULL)
{
- fprintf (stderr, gettext ("%s: no entry %s in archive!\n"),
+ fprintf (stderr, _("%s: no entry %s in archive!\n"),
program_invocation_short_name, argv[cnt]);
status = 1;
}
int newfd = open (argv[cnt], O_RDONLY);
if (newfd == -1)
{
- error (0, errno, gettext ("cannot open %s"), argv[cnt]);
+ error (0, errno, _("cannot open %s"), argv[cnt]);
status = 1;
}
else if (fstat (newfd, &newst) == -1)
{
- error (0, errno, gettext ("cannot stat %s"), argv[cnt]);
+ error (0, errno, _("cannot stat %s"), argv[cnt]);
close (newfd);
status = 1;
}
else if (!S_ISREG (newst.st_mode))
{
- error (0, errno, gettext ("%s is no regular file"), argv[cnt]);
+ error (0, errno, _("%s is no regular file"), argv[cnt]);
close (newfd);
status = 1;
}
== NULL)
{
fprintf (stderr,
- gettext ("cannot get ELF descriptor for %s: %s\n"),
+ _("cannot get ELF descriptor for %s: %s\n"),
argv[cnt], elf_errmsg (-1));
status = 1;
}
found[cnt]->mem = elf_rawfile (newelf, &found[cnt]->size);
if (found[cnt]->mem == NULL
|| elf_cntl (newelf, ELF_C_FDDONE) != 0)
- error (EXIT_FAILURE, 0, gettext ("cannot read %s: %s"),
+ error (EXIT_FAILURE, 0, _("cannot read %s: %s"),
argv[cnt], elf_errmsg (-1));
close (newfd);
close (newfd);
}
nonew:
- error (0, errno, gettext ("cannot create new file"));
+ error (0, errno, _("cannot create new file"));
status = 1;
goto errout;
}
if (! no0print (false, arhdr.ar_date, sizeof (arhdr.ar_date),
all->sec))
{
- error (0, errno, gettext ("cannot represent ar_date"));
+ error (0, errno, _("cannot represent ar_date"));
goto nonew_unlink;
}
if (! no0print (false, arhdr.ar_uid, sizeof (arhdr.ar_uid),
all->uid))
{
- error (0, errno, gettext ("cannot represent ar_uid"));
+ error (0, errno, _("cannot represent ar_uid"));
goto nonew_unlink;
}
if (! no0print (false, arhdr.ar_gid, sizeof (arhdr.ar_gid),
all->gid))
{
- error (0, errno, gettext ("cannot represent ar_gid"));
+ error (0, errno, _("cannot represent ar_gid"));
goto nonew_unlink;
}
if (! no0print (true, arhdr.ar_mode, sizeof (arhdr.ar_mode),
all->mode))
{
- error (0, errno, gettext ("cannot represent ar_mode"));
+ error (0, errno, _("cannot represent ar_mode"));
goto nonew_unlink;
}
if (! no0print (false, arhdr.ar_size, sizeof (arhdr.ar_size),
all->size))
{
- error (0, errno, gettext ("cannot represent ar_size"));
+ error (0, errno, _("cannot represent ar_size"));
goto nonew_unlink;
}
memcpy (arhdr.ar_fmag, ARFMAG, sizeof (arhdr.ar_fmag));
inline char *text_for_default (void)
{
char *new_text;
- if (unlikely (asprintf (&new_text, gettext ("%s (default)"), text) < 0))
+ if (unlikely (asprintf (&new_text, _("%s (default)"), text) < 0))
return (char *) text;
return new_text;
}
{
if (sizeof (off) > sizeof (uint32_t) && off > ~((uint32_t) 0))
/* The archive is too big. */
- error (EXIT_FAILURE, 0, gettext ("the archive '%s' is too large"),
+ error (EXIT_FAILURE, 0, _("the archive '%s' is too large"),
arfname);
/* We only add symbol tables for ELF files. It makes not much sense
GElf_Ehdr ehdr_mem;
GElf_Ehdr *ehdr = gelf_getehdr (elf, &ehdr_mem);
if (ehdr == NULL)
- error (EXIT_FAILURE, 0, gettext ("cannot read ELF header of %s(%s): %s"),
+ error (EXIT_FAILURE, 0, _("cannot read ELF header of %s(%s): %s"),
arfname, membername, elf_errmsg (-1));
GElf_Word symtype;
/* We expect exactly two non-option parameters. */
if (unlikely (remaining + 2 != argc))
{
- fputs (gettext ("Invalid number of parameters.\n"), stderr);
+ fputs (_("Invalid number of parameters.\n"), stderr);
argp_help (&argp, stderr, ARGP_HELP_SEE, program_invocation_short_name);
exit (1);
}
GElf_Ehdr ehdr1_mem;
GElf_Ehdr *ehdr1 = gelf_getehdr (elf1, &ehdr1_mem);
if (ehdr1 == NULL)
- error (2, 0, gettext ("cannot get ELF header of '%s': %s"),
+ error (2, 0, _("cannot get ELF header of '%s': %s"),
fname1, elf_errmsg (-1));
GElf_Ehdr ehdr2_mem;
GElf_Ehdr *ehdr2 = gelf_getehdr (elf2, &ehdr2_mem);
if (ehdr2 == NULL)
- error (2, 0, gettext ("cannot get ELF header of '%s': %s"),
+ error (2, 0, _("cannot get ELF header of '%s': %s"),
fname2, elf_errmsg (-1));
#define DIFFERENCE \
|| ehdr1->e_shentsize != ehdr2->e_shentsize))
{
if (! quiet)
- error (0, 0, gettext ("%s %s diff: ELF header"), fname1, fname2);
+ error (0, 0, _("%s %s diff: ELF header"), fname1, fname2);
DIFFERENCE;
}
size_t shnum1;
size_t shnum2;
if (unlikely (elf_getshdrnum (elf1, &shnum1) != 0))
- error (2, 0, gettext ("cannot get section count of '%s': %s"),
+ error (2, 0, _("cannot get section count of '%s': %s"),
fname1, elf_errmsg (-1));
if (unlikely (elf_getshdrnum (elf2, &shnum2) != 0))
- error (2, 0, gettext ("cannot get section count of '%s': %s"),
+ error (2, 0, _("cannot get section count of '%s': %s"),
fname2, elf_errmsg (-1));
if (unlikely (shnum1 != shnum2))
{
if (! quiet)
- error (0, 0, gettext ("%s %s diff: section count"), fname1, fname2);
+ error (0, 0, _("%s %s diff: section count"), fname1, fname2);
DIFFERENCE;
}
size_t phnum1;
size_t phnum2;
if (unlikely (elf_getphdrnum (elf1, &phnum1) != 0))
- error (2, 0, gettext ("cannot get program header count of '%s': %s"),
+ error (2, 0, _("cannot get program header count of '%s': %s"),
fname1, elf_errmsg (-1));
if (unlikely (elf_getphdrnum (elf2, &phnum2) != 0))
- error (2, 0, gettext ("cannot get program header count of '%s': %s"),
+ error (2, 0, _("cannot get program header count of '%s': %s"),
fname2, elf_errmsg (-1));
if (unlikely (phnum1 != phnum2))
{
if (! quiet)
- error (0, 0, gettext ("%s %s diff: program header count"),
+ error (0, 0, _("%s %s diff: program header count"),
fname1, fname2);
DIFFERENCE;
}
size_t shstrndx1;
size_t shstrndx2;
if (elf_getshdrstrndx (elf1, &shstrndx1) != 0)
- error (2, 0, gettext ("cannot get hdrstrndx of '%s': %s"),
+ error (2, 0, _("cannot get hdrstrndx of '%s': %s"),
fname1, elf_errmsg (-1));
if (elf_getshdrstrndx (elf2, &shstrndx2) != 0)
- error (2, 0, gettext ("cannot get hdrstrndx of '%s': %s"),
+ error (2, 0, _("cannot get hdrstrndx of '%s': %s"),
fname2, elf_errmsg (-1));
if (shstrndx1 != shstrndx2)
{
if (! quiet)
- error (0, 0, gettext ("%s %s diff: shdr string index"),
+ error (0, 0, _("%s %s diff: shdr string index"),
fname1, fname2);
DIFFERENCE;
}
if (unlikely (sname1 == NULL || sname2 == NULL
|| strcmp (sname1, sname2) != 0))
{
- error (0, 0, gettext ("%s %s differ: section [%zu], [%zu] name"),
+ error (0, 0, _("%s %s differ: section [%zu], [%zu] name"),
fname1, fname2, elf_ndxscn (scn1), elf_ndxscn (scn2));
DIFFERENCE;
}
|| shdr1->sh_addralign != shdr2->sh_addralign
|| shdr1->sh_entsize != shdr2->sh_entsize)
{
- error (0, 0, gettext ("%s %s differ: section [%zu] '%s' header"),
+ error (0, 0, _("%s %s differ: section [%zu] '%s' header"),
fname1, fname2, elf_ndxscn (scn1), sname1);
DIFFERENCE;
}
Elf_Data *data1 = elf_getdata (scn1, NULL);
if (data1 == NULL)
error (2, 0,
- gettext ("cannot get content of section %zu in '%s': %s"),
+ _("cannot get content of section %zu in '%s': %s"),
elf_ndxscn (scn1), fname1, elf_errmsg (-1));
Elf_Data *data2 = elf_getdata (scn2, NULL);
if (data2 == NULL)
error (2, 0,
- gettext ("cannot get content of section %zu in '%s': %s"),
+ _("cannot get content of section %zu in '%s': %s"),
elf_ndxscn (scn2), fname2, elf_errmsg (-1));
switch (shdr1->sh_type)
case SHT_SYMTAB:
if (shdr1->sh_entsize == 0)
error (2, 0,
- gettext ("symbol table [%zu] in '%s' has zero sh_entsize"),
+ _("symbol table [%zu] in '%s' has zero sh_entsize"),
elf_ndxscn (scn1), fname1);
/* Iterate over the symbol table. We ignore the st_size
GElf_Sym *sym1 = gelf_getsym (data1, ndx, &sym1_mem);
if (sym1 == NULL)
error (2, 0,
- gettext ("cannot get symbol in '%s': %s"),
+ _("cannot get symbol in '%s': %s"),
fname1, elf_errmsg (-1));
GElf_Sym sym2_mem;
GElf_Sym *sym2 = gelf_getsym (data2, ndx, &sym2_mem);
if (sym2 == NULL)
error (2, 0,
- gettext ("cannot get symbol in '%s': %s"),
+ _("cannot get symbol in '%s': %s"),
fname2, elf_errmsg (-1));
const char *name1 = elf_strptr (elf1, shdr1->sh_link,
{
if (elf_ndxscn (scn1) == elf_ndxscn (scn2))
error (0, 0,
- gettext ("%s %s differ: symbol table [%zu]"),
+ _("%s %s differ: symbol table [%zu]"),
fname1, fname2, elf_ndxscn (scn1));
else
- error (0, 0, gettext ("\
+ error (0, 0, _("\
%s %s differ: symbol table [%zu,%zu]"),
fname1, fname2, elf_ndxscn (scn1),
elf_ndxscn (scn2));
if (off2 >= data2->d_size)
{
if (! quiet)
- error (0, 0, gettext ("\
+ error (0, 0, _("\
%s %s differ: section [%zu] '%s' number of notes"),
fname1, fname2, elf_ndxscn (scn1), sname1);
DIFFERENCE;
off2 = gelf_getnote (data2, off2, ¬e2,
&name_offset, &desc_offset);
if (off2 == 0)
- error (2, 0, gettext ("\
+ error (2, 0, _("\
cannot read note section [%zu] '%s' in '%s': %s"),
elf_ndxscn (scn2), sname2, fname2, elf_errmsg (-1));
const char *name2 = (note2.n_namesz == 0
|| memcmp (name1, name2, note1.n_namesz))
{
if (! quiet)
- error (0, 0, gettext ("\
+ error (0, 0, _("\
%s %s differ: section [%zu] '%s' note name"),
fname1, fname2, elf_ndxscn (scn1), sname1);
DIFFERENCE;
if (note1.n_type != note2.n_type)
{
if (! quiet)
- error (0, 0, gettext ("\
+ error (0, 0, _("\
%s %s differ: section [%zu] '%s' note '%s' type"),
fname1, fname2, elf_ndxscn (scn1), sname1, name1);
DIFFERENCE;
if (note1.n_descsz != note2.n_descsz)
{
if (! quiet)
- error (0, 0, gettext ("\
+ error (0, 0, _("\
%s %s differ: build ID length"),
fname1, fname2);
DIFFERENCE;
else if (! ignore_build_id)
{
if (! quiet)
- error (0, 0, gettext ("\
+ error (0, 0, _("\
%s %s differ: build ID content"),
fname1, fname2);
DIFFERENCE;
else
{
if (! quiet)
- error (0, 0, gettext ("\
+ error (0, 0, _("\
%s %s differ: section [%zu] '%s' note '%s' content"),
fname1, fname2, elf_ndxscn (scn1), sname1,
name1);
if (off2 < data2->d_size)
{
if (! quiet)
- error (0, 0, gettext ("\
+ error (0, 0, _("\
%s %s differ: section [%zu] '%s' number of notes"),
fname1, fname2, elf_ndxscn (scn1), sname1);
DIFFERENCE;
if (! quiet)
{
if (elf_ndxscn (scn1) == elf_ndxscn (scn2))
- error (0, 0, gettext ("\
+ error (0, 0, _("\
%s %s differ: section [%zu] '%s' content"),
fname1, fname2, elf_ndxscn (scn1), sname1);
else
- error (0, 0, gettext ("\
+ error (0, 0, _("\
%s %s differ: section [%zu,%zu] '%s' content"),
fname1, fname2, elf_ndxscn (scn1),
elf_ndxscn (scn2), sname1);
{
if (! quiet)
error (0, 0,
- gettext ("%s %s differ: unequal amount of important sections"),
+ _("%s %s differ: unequal amount of important sections"),
fname1, fname2);
DIFFERENCE;
}
{
raw1 = elf_rawfile (elf1, &size1);
if (raw1 == NULL )
- error (2, 0, gettext ("cannot load data of '%s': %s"),
+ error (2, 0, _("cannot load data of '%s': %s"),
fname1, elf_errmsg (-1));
raw2 = elf_rawfile (elf2, &size2);
if (raw2 == NULL )
- error (2, 0, gettext ("cannot load data of '%s': %s"),
+ error (2, 0, _("cannot load data of '%s': %s"),
fname2, elf_errmsg (-1));
for (size_t cnt = 0; cnt < nregions; ++cnt)
GElf_Phdr *phdr1 = gelf_getphdr (elf1, ndx, &phdr1_mem);
if (phdr1 == NULL)
error (2, 0,
- gettext ("cannot get program header entry %d of '%s': %s"),
+ _("cannot get program header entry %d of '%s': %s"),
ndx, fname1, elf_errmsg (-1));
GElf_Phdr phdr2_mem;
GElf_Phdr *phdr2 = gelf_getphdr (elf2, ndx, &phdr2_mem);
if (phdr2 == NULL)
error (2, 0,
- gettext ("cannot get program header entry %d of '%s': %s"),
+ _("cannot get program header entry %d of '%s': %s"),
ndx, fname2, elf_errmsg (-1));
if (unlikely (memcmp (phdr1, phdr2, sizeof (GElf_Phdr)) != 0))
{
if (! quiet)
- error (0, 0, gettext ("%s %s differ: program header %d"),
+ error (0, 0, _("%s %s differ: program header %d"),
fname1, fname2, ndx);
DIFFERENCE;
}
{
gapmismatch:
if (!quiet)
- error (0, 0, gettext ("%s %s differ: gap"),
+ error (0, 0, _("%s %s differ: gap"),
fname1, fname2);
DIFFERENCE;
break;
else
{
fprintf (stderr,
- gettext ("Invalid value '%s' for --gaps parameter."),
+ _("Invalid value '%s' for --gaps parameter."),
arg);
argp_help (&argp, stderr, ARGP_HELP_SEE,
program_invocation_short_name);
{
int fd = open (fname, O_RDONLY);
if (unlikely (fd == -1))
- error (2, errno, gettext ("cannot open '%s'"), fname);
+ error (2, errno, _("cannot open '%s'"), fname);
Elf *elf = elf_begin (fd, ELF_C_READ_MMAP, NULL);
if (elf == NULL)
error (2, 0,
- gettext ("cannot create ELF descriptor for '%s': %s"),
+ _("cannot create ELF descriptor for '%s': %s"),
fname, elf_errmsg (-1));
Ebl *ebl = ebl_openbackend (elf);
if (ebl == NULL)
error (2, 0,
- gettext ("cannot create EBL descriptor for '%s'"), fname);
+ _("cannot create EBL descriptor for '%s'"), fname);
*fdp = fd;
*eblp = ebl;
GElf_Shdr *shdr = gelf_getshdr (scn, &shdr_mem);
if (shdr == NULL)
error (2, 0,
- gettext ("cannot get section header of section %zu: %s"),
+ _("cannot get section header of section %zu: %s"),
elf_ndxscn (scn), elf_errmsg (-1));
if ((shdr->sh_type != SHT_REL && shdr->sh_type != SHT_RELA)
Elf_Data *data = elf_getdata (scn, NULL);
if (data == NULL)
error (2, 0,
- gettext ("cannot get content of section %zu: %s"),
+ _("cannot get content of section %zu: %s"),
elf_ndxscn (scn), elf_errmsg (-1));
if (shdr->sh_type == SHT_REL && shdr->sh_entsize != 0)
GElf_Rel rel_mem;
GElf_Rel *rel = gelf_getrel (data, ndx, &rel_mem);
if (rel == NULL)
- error (2, 0, gettext ("cannot get relocation: %s"),
+ error (2, 0, _("cannot get relocation: %s"),
elf_errmsg (-1));
if ((int) GELF_R_SYM (rel->r_info) == symndx
GElf_Rela rela_mem;
GElf_Rela *rela = gelf_getrela (data, ndx, &rela_mem);
if (rela == NULL)
- error (2, 0, gettext ("cannot get relocation: %s"),
+ error (2, 0, _("cannot get relocation: %s"),
elf_errmsg (-1));
if ((int) GELF_R_SYM (rela->r_info) == symndx
/* Now we can close the descriptor. */
if (elf_end (elf) != 0)
- ERROR (gettext ("error while closing Elf descriptor: %s\n"),
+ ERROR (_("error while closing Elf descriptor: %s\n"),
elf_errmsg (-1));
if (prev_error_count == error_count && !be_quiet)
- puts (gettext ("No errors"));
+ puts (_("No errors"));
}
close (fd);
break;
case ARGP_KEY_NO_ARGS:
- fputs (gettext ("Missing file name.\n"), stderr);
+ fputs (_("Missing file name.\n"), stderr);
argp_help (&argp, stderr, ARGP_HELP_SEE, program_invocation_short_name);
exit (EXIT_FAILURE);
/* Get next archive element. */
cmd = elf_next (subelf);
if (elf_end (subelf) != 0)
- ERROR (gettext (" error while freeing sub-ELF descriptor: %s\n"),
+ ERROR (_(" error while freeing sub-ELF descriptor: %s\n"),
elf_errmsg (-1));
}
}
default:
/* We cannot do anything. */
- ERROR (gettext ("\
+ ERROR (_("\
Not an ELF file - it has the wrong magic bytes at the start\n"));
break;
}
if (ehdr->e_ident[EI_CLASS] != ELFCLASS32
&& ehdr->e_ident[EI_CLASS] != ELFCLASS64)
- ERROR (gettext ("e_ident[%d] == %d is no known class\n"),
+ ERROR (_("e_ident[%d] == %d is no known class\n"),
EI_CLASS, ehdr->e_ident[EI_CLASS]);
if (ehdr->e_ident[EI_DATA] != ELFDATA2LSB
&& ehdr->e_ident[EI_DATA] != ELFDATA2MSB)
- ERROR (gettext ("e_ident[%d] == %d is no known data encoding\n"),
+ ERROR (_("e_ident[%d] == %d is no known data encoding\n"),
EI_DATA, ehdr->e_ident[EI_DATA]);
if (ehdr->e_ident[EI_VERSION] != EV_CURRENT)
- ERROR (gettext ("unknown ELF header version number e_ident[%d] == %d\n"),
+ ERROR (_("unknown ELF header version number e_ident[%d] == %d\n"),
EI_VERSION, ehdr->e_ident[EI_VERSION]);
/* We currently don't handle any OS ABIs other than Linux and the
if (ehdr->e_ident[EI_OSABI] != ELFOSABI_NONE
&& ehdr->e_ident[EI_OSABI] != ELFOSABI_LINUX
&& ehdr->e_ident[EI_OSABI] != ELFOSABI_FREEBSD)
- ERROR (gettext ("unsupported OS ABI e_ident[%d] == '%s'\n"),
+ ERROR (_("unsupported OS ABI e_ident[%d] == '%s'\n"),
EI_OSABI,
ebl_osabi_name (ebl, ehdr->e_ident[EI_OSABI], buf, sizeof (buf)));
/* No ABI versions other than zero are supported either. */
if (ehdr->e_ident[EI_ABIVERSION] != 0)
- ERROR (gettext ("unsupported ABI version e_ident[%d] == %d\n"),
+ ERROR (_("unsupported ABI version e_ident[%d] == %d\n"),
EI_ABIVERSION, ehdr->e_ident[EI_ABIVERSION]);
for (cnt = EI_PAD; cnt < EI_NIDENT; ++cnt)
if (ehdr->e_ident[cnt] != 0)
- ERROR (gettext ("e_ident[%zu] is not zero\n"), cnt);
+ ERROR (_("e_ident[%zu] is not zero\n"), cnt);
/* Check the e_type field. */
if (ehdr->e_type != ET_REL && ehdr->e_type != ET_EXEC
&& ehdr->e_type != ET_DYN && ehdr->e_type != ET_CORE)
- ERROR (gettext ("unknown object file type %d\n"), ehdr->e_type);
+ ERROR (_("unknown object file type %d\n"), ehdr->e_type);
/* Check the e_machine field. */
for (cnt = 0; cnt < nvalid_e_machine; ++cnt)
if (valid_e_machine[cnt] == ehdr->e_machine)
break;
if (cnt == nvalid_e_machine)
- ERROR (gettext ("unknown machine type %d\n"), ehdr->e_machine);
+ ERROR (_("unknown machine type %d\n"), ehdr->e_machine);
/* Check the e_version field. */
if (ehdr->e_version != EV_CURRENT)
- ERROR (gettext ("unknown object file version\n"));
+ ERROR (_("unknown object file version\n"));
/* Check the e_phoff and e_phnum fields. */
if (ehdr->e_phoff == 0)
{
if (ehdr->e_phnum != 0)
- ERROR (gettext ("invalid program header offset\n"));
+ ERROR (_("invalid program header offset\n"));
else if (ehdr->e_type == ET_EXEC || ehdr->e_type == ET_DYN)
- ERROR (gettext ("\
+ ERROR (_("\
executables and DSOs cannot have zero program header offset\n"));
}
else if (ehdr->e_phnum == 0)
- ERROR (gettext ("invalid number of program header entries\n"));
+ ERROR (_("invalid number of program header entries\n"));
/* Check the e_shoff field. */
shnum = ehdr->e_shnum;
if (ehdr->e_shoff == 0)
{
if (ehdr->e_shnum != 0)
- ERROR (gettext ("invalid section header table offset\n"));
+ ERROR (_("invalid section header table offset\n"));
else if (ehdr->e_type != ET_EXEC && ehdr->e_type != ET_DYN
&& ehdr->e_type != ET_CORE)
- ERROR (gettext ("section header table must be present\n"));
+ ERROR (_("section header table must be present\n"));
}
else
{
{
/* The error will be reported later. */
if (shdr->sh_size == 0)
- ERROR (gettext ("\
+ ERROR (_("\
invalid number of section header table entries\n"));
else
shnum = shdr->sh_size;
shstrndx = shdr->sh_link;
}
else if (shstrndx >= shnum)
- ERROR (gettext ("invalid section header index\n"));
+ ERROR (_("invalid section header index\n"));
}
/* Check the shdrs actually exist. And uncompress them before
elf_compress (scn, 0, 0);
}
if (scnt < shnum)
- ERROR (gettext ("Can only check %u headers, shnum was %u\n"), scnt, shnum);
+ ERROR (_("Can only check %u headers, shnum was %u\n"), scnt, shnum);
shnum = scnt;
phnum = ehdr->e_phnum;
{
/* The error will be reported later. */
if (shdr->sh_info < PN_XNUM)
- ERROR (gettext ("\
+ ERROR (_("\
invalid number of program header table entries\n"));
else
phnum = shdr->sh_info;
break;
}
if (pcnt < phnum)
- ERROR (gettext ("Can only check %u headers, phnum was %u\n"), pcnt, phnum);
+ ERROR (_("Can only check %u headers, phnum was %u\n"), pcnt, phnum);
phnum = pcnt;
/* Check the e_flags field. */
if (!ebl_machine_flag_check (ebl, ehdr->e_flags))
- ERROR (gettext ("invalid machine flags: %s\n"),
+ ERROR (_("invalid machine flags: %s\n"),
ebl_machine_flag_name (ebl, ehdr->e_flags, buf, sizeof (buf)));
/* Check e_ehsize, e_phentsize, and e_shentsize fields. */
if (gelf_getclass (ebl->elf) == ELFCLASS32)
{
if (ehdr->e_ehsize != 0 && ehdr->e_ehsize != sizeof (Elf32_Ehdr))
- ERROR (gettext ("invalid ELF header size: %hd\n"), ehdr->e_ehsize);
+ ERROR (_("invalid ELF header size: %hd\n"), ehdr->e_ehsize);
if (ehdr->e_phentsize != 0 && ehdr->e_phentsize != sizeof (Elf32_Phdr))
- ERROR (gettext ("invalid program header size: %hd\n"),
+ ERROR (_("invalid program header size: %hd\n"),
ehdr->e_phentsize);
else if (ehdr->e_phoff + phnum * ehdr->e_phentsize > size)
- ERROR (gettext ("invalid program header position or size\n"));
+ ERROR (_("invalid program header position or size\n"));
if (ehdr->e_shentsize != 0 && ehdr->e_shentsize != sizeof (Elf32_Shdr))
- ERROR (gettext ("invalid section header size: %hd\n"),
+ ERROR (_("invalid section header size: %hd\n"),
ehdr->e_shentsize);
else if (ehdr->e_shoff + shnum * ehdr->e_shentsize > size)
- ERROR (gettext ("invalid section header position or size\n"));
+ ERROR (_("invalid section header position or size\n"));
}
else if (gelf_getclass (ebl->elf) == ELFCLASS64)
{
if (ehdr->e_ehsize != 0 && ehdr->e_ehsize != sizeof (Elf64_Ehdr))
- ERROR (gettext ("invalid ELF header size: %hd\n"), ehdr->e_ehsize);
+ ERROR (_("invalid ELF header size: %hd\n"), ehdr->e_ehsize);
if (ehdr->e_phentsize != 0 && ehdr->e_phentsize != sizeof (Elf64_Phdr))
- ERROR (gettext ("invalid program header size: %hd\n"),
+ ERROR (_("invalid program header size: %hd\n"),
ehdr->e_phentsize);
else if (ehdr->e_phoff + phnum * ehdr->e_phentsize > size)
- ERROR (gettext ("invalid program header position or size\n"));
+ ERROR (_("invalid program header position or size\n"));
if (ehdr->e_shentsize != 0 && ehdr->e_shentsize != sizeof (Elf64_Shdr))
- ERROR (gettext ("invalid section header size: %hd\n"),
+ ERROR (_("invalid section header size: %hd\n"),
ehdr->e_shentsize);
else if (ehdr->e_shoff + shnum * ehdr->e_shentsize > size)
- ERROR (gettext ("invalid section header position or size\n"));
+ ERROR (_("invalid section header position or size\n"));
}
}
out:
if (cnt == shnum)
- ERROR (gettext ("\
+ ERROR (_("\
section [%2d] '%s': section with SHF_GROUP flag set not part of a section group\n"),
idx, section_name (ebl, idx));
else
- ERROR (gettext ("\
+ ERROR (_("\
section [%2d] '%s': section group [%2zu] '%s' does not precede group member\n"),
idx, section_name (ebl, idx),
cnt, section_name (ebl, cnt));
Elf_Data *data = elf_getdata (elf_getscn (ebl->elf, idx), NULL);
if (data == NULL)
{
- ERROR (gettext ("section [%2d] '%s': cannot get section data\n"),
+ ERROR (_("section [%2d] '%s': cannot get section data\n"),
idx, section_name (ebl, idx));
return;
}
if (strshdr->sh_type != SHT_STRTAB)
{
- ERROR (gettext ("section [%2d] '%s': referenced as string table for section [%2d] '%s' but type is not SHT_STRTAB\n"),
+ ERROR (_("section [%2d] '%s': referenced as string table for section [%2d] '%s' but type is not SHT_STRTAB\n"),
shdr->sh_link, section_name (ebl, shdr->sh_link),
idx, section_name (ebl, idx));
strshdr = NULL;
&& xndxshdr->sh_link == (GElf_Word) idx)
{
if (found_xndx)
- ERROR (gettext ("\
+ ERROR (_("\
section [%2d] '%s': symbol table cannot have more than one extended index section\n"),
idx, section_name (ebl, idx));
size_t sh_entsize = gelf_fsize (ebl->elf, ELF_T_SYM, 1, EV_CURRENT);
if (shdr->sh_entsize != sh_entsize)
- ERROR (gettext ("\
+ ERROR (_("\
section [%2u] '%s': entry size is does not match ElfXX_Sym\n"),
idx, section_name (ebl, idx));
Elf32_Word xndx;
GElf_Sym *sym = gelf_getsymshndx (data, xndxdata, 0, &sym_mem, &xndx);
if (sym == NULL)
- ERROR (gettext ("section [%2d] '%s': cannot get symbol %d: %s\n"),
+ ERROR (_("section [%2d] '%s': cannot get symbol %d: %s\n"),
idx, section_name (ebl, idx), 0, elf_errmsg (-1));
else
{
if (sym->st_name != 0)
- ERROR (gettext ("section [%2d] '%s': '%s' in zeroth entry not zero\n"),
+ ERROR (_("section [%2d] '%s': '%s' in zeroth entry not zero\n"),
idx, section_name (ebl, idx), "st_name");
if (sym->st_value != 0)
- ERROR (gettext ("section [%2d] '%s': '%s' in zeroth entry not zero\n"),
+ ERROR (_("section [%2d] '%s': '%s' in zeroth entry not zero\n"),
idx, section_name (ebl, idx), "st_value");
if (sym->st_size != 0)
- ERROR (gettext ("section [%2d] '%s': '%s' in zeroth entry not zero\n"),
+ ERROR (_("section [%2d] '%s': '%s' in zeroth entry not zero\n"),
idx, section_name (ebl, idx), "st_size");
if (sym->st_info != 0)
- ERROR (gettext ("section [%2d] '%s': '%s' in zeroth entry not zero\n"),
+ ERROR (_("section [%2d] '%s': '%s' in zeroth entry not zero\n"),
idx, section_name (ebl, idx), "st_info");
if (sym->st_other != 0)
- ERROR (gettext ("section [%2d] '%s': '%s' in zeroth entry not zero\n"),
+ ERROR (_("section [%2d] '%s': '%s' in zeroth entry not zero\n"),
idx, section_name (ebl, idx), "st_other");
if (sym->st_shndx != 0)
- ERROR (gettext ("section [%2d] '%s': '%s' in zeroth entry not zero\n"),
+ ERROR (_("section [%2d] '%s': '%s' in zeroth entry not zero\n"),
idx, section_name (ebl, idx), "st_shndx");
if (xndxdata != NULL && xndx != 0)
- ERROR (gettext ("\
+ ERROR (_("\
section [%2d] '%s': XINDEX for zeroth entry not zero\n"),
xndxscnidx, section_name (ebl, xndxscnidx));
}
sym = gelf_getsymshndx (data, xndxdata, cnt, &sym_mem, &xndx);
if (sym == NULL)
{
- ERROR (gettext ("section [%2d] '%s': cannot get symbol %zu: %s\n"),
+ ERROR (_("section [%2d] '%s': cannot get symbol %zu: %s\n"),
idx, section_name (ebl, idx), cnt, elf_errmsg (-1));
continue;
}
if (strshdr == NULL)
name = "";
else if (sym->st_name >= strshdr->sh_size)
- ERROR (gettext ("\
+ ERROR (_("\
section [%2d] '%s': symbol %zu: invalid name value\n"),
idx, section_name (ebl, idx), cnt);
else
if (xndxdata == NULL)
{
if (!no_xndx_warned)
- ERROR (gettext ("\
+ ERROR (_("\
section [%2d] '%s': symbol %zu: too large section index but no extended section index section\n"),
idx, section_name (ebl, idx), cnt);
no_xndx_warned = true;
}
else if (xndx < SHN_LORESERVE)
- ERROR (gettext ("\
+ ERROR (_("\
section [%2d] '%s': symbol %zu: XINDEX used for index which would fit in st_shndx (%" PRIu32 ")\n"),
xndxscnidx, section_name (ebl, xndxscnidx), cnt,
xndx);
|| (sym->st_shndx >= shnum
&& (sym->st_shndx < SHN_LORESERVE
/* || sym->st_shndx > SHN_HIRESERVE always false */)))
- ERROR (gettext ("\
+ ERROR (_("\
section [%2d] '%s': symbol %zu: invalid section index\n"),
idx, section_name (ebl, idx), cnt);
else
if (GELF_ST_TYPE (sym->st_info) >= STT_NUM
&& !ebl_symbol_type_name (ebl, GELF_ST_TYPE (sym->st_info), NULL, 0))
- ERROR (gettext ("section [%2d] '%s': symbol %zu: unknown type\n"),
+ ERROR (_("section [%2d] '%s': symbol %zu: unknown type\n"),
idx, section_name (ebl, idx), cnt);
if (GELF_ST_BIND (sym->st_info) >= STB_NUM
&& !ebl_symbol_binding_name (ebl, GELF_ST_BIND (sym->st_info), NULL,
0))
- ERROR (gettext ("\
+ ERROR (_("\
section [%2d] '%s': symbol %zu: unknown symbol binding\n"),
idx, section_name (ebl, idx), cnt);
if (GELF_ST_BIND (sym->st_info) == STB_GNU_UNIQUE
&& GELF_ST_TYPE (sym->st_info) != STT_OBJECT)
- ERROR (gettext ("\
+ ERROR (_("\
section [%2d] '%s': symbol %zu: unique symbol not of object type\n"),
idx, section_name (ebl, idx), cnt);
{
/* Common symbols can only appear in relocatable files. */
if (ehdr->e_type != ET_REL)
- ERROR (gettext ("\
+ ERROR (_("\
section [%2d] '%s': symbol %zu: COMMON only allowed in relocatable files\n"),
idx, section_name (ebl, idx), cnt);
if (cnt < shdr->sh_info)
- ERROR (gettext ("\
+ ERROR (_("\
section [%2d] '%s': symbol %zu: local COMMON symbols are nonsense\n"),
idx, section_name (ebl, idx), cnt);
if (GELF_R_TYPE (sym->st_info) == STT_FUNC)
- ERROR (gettext ("\
+ ERROR (_("\
section [%2d] '%s': symbol %zu: function in COMMON section is nonsense\n"),
idx, section_name (ebl, idx), cnt);
}
&& strcmp (name, "__edata") != 0
&& strcmp (name, "_end") != 0
&& strcmp (name, "__end") != 0))
- ERROR (gettext ("\
+ ERROR (_("\
section [%2d] '%s': symbol %zu: st_value out of bounds\n"),
idx, section_name (ebl, idx), cnt);
}
else if ((st_value - sh_addr
+ sym->st_size) > destshdr->sh_size)
- ERROR (gettext ("\
+ ERROR (_("\
section [%2d] '%s': symbol %zu does not fit completely in referenced section [%2d] '%s'\n"),
idx, section_name (ebl, idx), cnt,
(int) xndx, section_name (ebl, xndx));
else
{
if ((destshdr->sh_flags & SHF_TLS) == 0)
- ERROR (gettext ("\
+ ERROR (_("\
section [%2d] '%s': symbol %zu: referenced section [%2d] '%s' does not have SHF_TLS flag set\n"),
idx, section_name (ebl, idx), cnt,
(int) xndx, section_name (ebl, xndx));
/* For object files the symbol value must fall
into the section. */
if (st_value > destshdr->sh_size)
- ERROR (gettext ("\
+ ERROR (_("\
section [%2d] '%s': symbol %zu: st_value out of bounds of referenced section [%2d] '%s'\n"),
idx, section_name (ebl, idx), cnt,
(int) xndx, section_name (ebl, xndx));
else if (st_value + sym->st_size
> destshdr->sh_size)
- ERROR (gettext ("\
+ ERROR (_("\
section [%2d] '%s': symbol %zu does not fit completely in referenced section [%2d] '%s'\n"),
idx, section_name (ebl, idx), cnt,
(int) xndx, section_name (ebl, xndx));
if (pcnt == phnum)
{
if (no_pt_tls++ == 0)
- ERROR (gettext ("\
+ ERROR (_("\
section [%2d] '%s': symbol %zu: TLS symbol but no TLS program header entry\n"),
idx, section_name (ebl, idx), cnt);
}
else if (phdr == NULL)
{
- ERROR (gettext ("\
+ ERROR (_("\
section [%2d] '%s': symbol %zu: TLS symbol but couldn't get TLS program header entry\n"),
idx, section_name (ebl, idx), cnt);
}
{
if (st_value
< destshdr->sh_offset - phdr->p_offset)
- ERROR (gettext ("\
+ ERROR (_("\
section [%2d] '%s': symbol %zu: st_value short of referenced section [%2d] '%s'\n"),
idx, section_name (ebl, idx), cnt,
(int) xndx, section_name (ebl, xndx));
else if (st_value
> (destshdr->sh_offset - phdr->p_offset
+ destshdr->sh_size))
- ERROR (gettext ("\
+ ERROR (_("\
section [%2d] '%s': symbol %zu: st_value out of bounds of referenced section [%2d] '%s'\n"),
idx, section_name (ebl, idx), cnt,
(int) xndx, section_name (ebl, xndx));
else if (st_value + sym->st_size
> (destshdr->sh_offset - phdr->p_offset
+ destshdr->sh_size))
- ERROR (gettext ("\
+ ERROR (_("\
section [%2d] '%s': symbol %zu does not fit completely in referenced section [%2d] '%s'\n"),
idx, section_name (ebl, idx), cnt,
(int) xndx, section_name (ebl, xndx));
if (GELF_ST_BIND (sym->st_info) == STB_LOCAL)
{
if (cnt >= shdr->sh_info)
- ERROR (gettext ("\
+ ERROR (_("\
section [%2d] '%s': symbol %zu: local symbol outside range described in sh_info\n"),
idx, section_name (ebl, idx), cnt);
}
else
{
if (cnt < shdr->sh_info)
- ERROR (gettext ("\
+ ERROR (_("\
section [%2d] '%s': symbol %zu: non-local symbol outside range described in sh_info\n"),
idx, section_name (ebl, idx), cnt);
}
if (GELF_ST_TYPE (sym->st_info) == STT_SECTION
&& GELF_ST_BIND (sym->st_info) != STB_LOCAL)
- ERROR (gettext ("\
+ ERROR (_("\
section [%2d] '%s': symbol %zu: non-local section symbol\n"),
idx, section_name (ebl, idx), cnt);
if (sname == NULL)
{
if (xndx != SHN_UNDEF || ehdr->e_type != ET_REL)
- ERROR (gettext ("\
+ ERROR (_("\
section [%2d] '%s': _GLOBAL_OFFSET_TABLE_ symbol refers to \
bad section [%2d]\n"),
idx, section_name (ebl, idx), xndx);
}
else if (strcmp (sname, ".got.plt") != 0
&& strcmp (sname, ".got") != 0)
- ERROR (gettext ("\
+ ERROR (_("\
section [%2d] '%s': _GLOBAL_OFFSET_TABLE_ symbol refers to \
section [%2d] '%s'\n"),
idx, section_name (ebl, idx), xndx, sname);
/* This test is more strict than the psABIs which
usually allow the symbol to be in the middle of
the .got section, allowing negative offsets. */
- ERROR (gettext ("\
+ ERROR (_("\
section [%2d] '%s': _GLOBAL_OFFSET_TABLE_ symbol value %#" PRIx64 " does not match %s section address %#" PRIx64 "\n"),
idx, section_name (ebl, idx),
(uint64_t) sym->st_value,
sname, (uint64_t) destshdr->sh_addr);
if (!gnuld && sym->st_size != destshdr->sh_size)
- ERROR (gettext ("\
+ ERROR (_("\
section [%2d] '%s': _GLOBAL_OFFSET_TABLE_ symbol size %" PRIu64 " does not match %s section size %" PRIu64 "\n"),
idx, section_name (ebl, idx),
(uint64_t) sym->st_size,
}
}
else
- ERROR (gettext ("\
+ ERROR (_("\
section [%2d] '%s': _GLOBAL_OFFSET_TABLE_ symbol present, but no .got section\n"),
idx, section_name (ebl, idx));
}
if (phdr != NULL && phdr->p_type == PT_DYNAMIC)
{
if (sym->st_value != phdr->p_vaddr)
- ERROR (gettext ("\
+ ERROR (_("\
section [%2d] '%s': _DYNAMIC_ symbol value %#" PRIx64 " does not match dynamic segment address %#" PRIx64 "\n"),
idx, section_name (ebl, idx),
(uint64_t) sym->st_value,
(uint64_t) phdr->p_vaddr);
if (!gnuld && sym->st_size != phdr->p_memsz)
- ERROR (gettext ("\
+ ERROR (_("\
section [%2d] '%s': _DYNAMIC symbol size %" PRIu64 " does not match dynamic segment size %" PRIu64 "\n"),
idx, section_name (ebl, idx),
(uint64_t) sym->st_size,
if (GELF_ST_VISIBILITY (sym->st_other) != STV_DEFAULT
&& shdr->sh_type == SHT_DYNSYM)
- ERROR (gettext ("\
+ ERROR (_("\
section [%2d] '%s': symbol %zu: symbol in dynamic symbol table with non-default visibility\n"),
idx, section_name (ebl, idx), cnt);
if (! ebl_check_st_other_bits (ebl, sym->st_other))
- ERROR (gettext ("\
+ ERROR (_("\
section [%2d] '%s': symbol %zu: unknown bit set in st_other\n"),
idx, section_name (ebl, idx), cnt);
size_t cnt;
if (d == NULL)
- ERROR (gettext ("\
+ ERROR (_("\
section [%2d] '%s': cannot get section data.\n"),
idx, section_name (ebl, idx));
{
/* Found it. Does the type match. */
if (is_rela)
- ERROR (gettext ("\
+ ERROR (_("\
section [%2d] '%s': DT_RELCOUNT used for this RELA section\n"),
idx, section_name (ebl, idx));
else
if (shdr->sh_entsize != 0
&& dyn->d_un.d_val > (shdr->sh_size
/ shdr->sh_entsize))
- ERROR (gettext ("\
+ ERROR (_("\
section [%2d] '%s': DT_RELCOUNT value %d too high for this section\n"),
idx, section_name (ebl, idx),
(int) dyn->d_un.d_val);
GELF_R_TYPE (rel->r_info)))
{
if (inner >= dyn->d_un.d_val)
- ERROR (gettext ("\
+ ERROR (_("\
section [%2d] '%s': relative relocations after index %d as specified by DT_RELCOUNT\n"),
idx, section_name (ebl, idx),
(int) dyn->d_un.d_val);
}
else if (inner < dyn->d_un.d_val)
- ERROR (gettext ("\
+ ERROR (_("\
section [%2d] '%s': non-relative relocation at index %zu; DT_RELCOUNT specified %d relative relocations\n"),
idx, section_name (ebl, idx),
inner, (int) dyn->d_un.d_val);
{
/* Found it. Does the type match. */
if (!is_rela)
- ERROR (gettext ("\
+ ERROR (_("\
section [%2d] '%s': DT_RELACOUNT used for this REL section\n"),
idx, section_name (ebl, idx));
else
relocations? */
if (shdr->sh_entsize != 0
&& dyn->d_un.d_val > shdr->sh_size / shdr->sh_entsize)
- ERROR (gettext ("\
+ ERROR (_("\
section [%2d] '%s': DT_RELCOUNT value %d too high for this section\n"),
idx, section_name (ebl, idx),
(int) dyn->d_un.d_val);
GELF_R_TYPE (rela->r_info)))
{
if (inner >= dyn->d_un.d_val)
- ERROR (gettext ("\
+ ERROR (_("\
section [%2d] '%s': relative relocations after index %d as specified by DT_RELCOUNT\n"),
idx, section_name (ebl, idx),
(int) dyn->d_un.d_val);
}
else if (inner < dyn->d_un.d_val)
- ERROR (gettext ("\
+ ERROR (_("\
section [%2d] '%s': non-relative relocation at index %zu; DT_RELCOUNT specified %d relative relocations\n"),
idx, section_name (ebl, idx),
inner, (int) dyn->d_un.d_val);
/* Check whether the link to the section we relocate is reasonable. */
if (shdr->sh_info >= shnum)
- ERROR (gettext ("section [%2d] '%s': invalid destination section index\n"),
+ ERROR (_("section [%2d] '%s': invalid destination section index\n"),
idx, section_name (ebl, idx));
else if (shdr->sh_info != 0)
{
{
reldyn = is_rel_dyn (ebl, ehdr, idx, shdr, true);
if (!reldyn)
- ERROR (gettext ("\
+ ERROR (_("\
section [%2d] '%s': invalid destination section type\n"),
idx, section_name (ebl, idx));
else
/* There is no standard, but we require that .rel{,a}.dyn
sections have a sh_info value of zero. */
if (shdr->sh_info != 0)
- ERROR (gettext ("\
+ ERROR (_("\
section [%2d] '%s': sh_info should be zero\n"),
idx, section_name (ebl, idx));
}
if ((((*destshdrp)->sh_flags & SHF_MERGE) != 0)
&& ((*destshdrp)->sh_flags & SHF_STRINGS) != 0)
- ERROR (gettext ("\
+ ERROR (_("\
section [%2d] '%s': no relocations for merge-able string sections possible\n"),
idx, section_name (ebl, idx));
}
size_t sh_entsize = gelf_fsize (ebl->elf, reltype, 1, EV_CURRENT);
if (shdr->sh_entsize != sh_entsize)
- ERROR (gettext (reltype == ELF_T_RELA ? "\
+ ERROR (_(reltype == ELF_T_RELA ? "\
section [%2d] '%s': section entry size does not match ElfXX_Rela\n" : "\
section [%2d] '%s': section entry size does not match ElfXX_Rel\n"),
idx, section_name (ebl, idx));
while (seg != NULL && !seg->read_only)
seg = seg->next;
if (seg == NULL)
- ERROR (gettext ("\
+ ERROR (_("\
text relocation flag set but there is no read-only segment\n"));
}
bool known_broken = gnuld;
if (!ebl_reloc_type_check (ebl, GELF_R_TYPE (r_info)))
- ERROR (gettext ("section [%2d] '%s': relocation %zu: invalid type\n"),
+ ERROR (_("section [%2d] '%s': relocation %zu: invalid type\n"),
idx, section_name (ebl, idx), cnt);
else if (((ehdr->e_type != ET_EXEC && ehdr->e_type != ET_DYN)
/* The executable/DSO can contain relocation sections with
are marked non-loaded, though. */
|| (relshdr->sh_flags & SHF_ALLOC) != 0)
&& !ebl_reloc_valid_use (ebl, GELF_R_TYPE (r_info)))
- ERROR (gettext ("\
+ ERROR (_("\
section [%2d] '%s': relocation %zu: relocation type invalid for the file type\n"),
idx, section_name (ebl, idx), cnt);
&& ((GELF_R_SYM (r_info) + 1)
* gelf_fsize (ebl->elf, ELF_T_SYM, 1, EV_CURRENT)
> symshdr->sh_size))
- ERROR (gettext ("\
+ ERROR (_("\
section [%2d] '%s': relocation %zu: invalid symbol index\n"),
idx, section_name (ebl, idx), cnt);
/* Get the name for the symbol. */
&& (name = elf_strptr (ebl->elf, symshdr->sh_link, sym->st_name))
&& strcmp (name, "_GLOBAL_OFFSET_TABLE_") !=0 )
- ERROR (gettext ("\
+ ERROR (_("\
section [%2d] '%s': relocation %zu: only symbol '_GLOBAL_OFFSET_TABLE_' can be used with %s\n"),
idx, section_name (ebl, idx), cnt,
ebl_reloc_type_name (ebl, GELF_R_SYM (r_info),
&& GELF_R_TYPE (r_info) != 0
&& (r_offset - (ehdr->e_type == ET_REL ? 0
: destshdr->sh_addr)) >= destshdr->sh_size)
- ERROR (gettext ("\
+ ERROR (_("\
section [%2d] '%s': relocation %zu: offset out of bounds\n"),
idx, section_name (ebl, idx), cnt);
}
&& GELF_ST_TYPE (sym->st_info) != STT_OBJECT)
{
char buf[64];
- ERROR (gettext ("section [%2d] '%s': relocation %zu: copy relocation against symbol of type %s\n"),
+ ERROR (_("section [%2d] '%s': relocation %zu: copy relocation against symbol of type %s\n"),
idx, section_name (ebl, idx), cnt,
ebl_symbol_type_name (ebl, GELF_ST_TYPE (sym->st_info),
buf, sizeof (buf)));
if (textrel)
needed_textrel = true;
else
- ERROR (gettext ("section [%2d] '%s': relocation %zu: read-only section modified but text relocation flag not set\n"),
+ ERROR (_("section [%2d] '%s': relocation %zu: read-only section modified but text relocation flag not set\n"),
idx, section_name (ebl, idx), cnt);
}
else if ((*statep == state_unloaded && in_loaded_seg)
|| (*statep == state_loaded && !in_loaded_seg))
{
- ERROR (gettext ("\
+ ERROR (_("\
section [%2d] '%s': relocations are against loaded and unloaded data\n"),
idx, section_name (ebl, idx));
*statep = state_error;
Elf_Data *data = elf_getdata (elf_getscn (ebl->elf, idx), NULL);
if (data == NULL)
{
- ERROR (gettext ("section [%2d] '%s': cannot get section data\n"),
+ ERROR (_("section [%2d] '%s': cannot get section data\n"),
idx, section_name (ebl, idx));
return;
}
GElf_Rela *rela = gelf_getrela (data, cnt, &rela_mem);
if (rela == NULL)
{
- ERROR (gettext ("\
+ ERROR (_("\
section [%2d] '%s': cannot get relocation %zu: %s\n"),
idx, section_name (ebl, idx), cnt, elf_errmsg (-1));
continue;
Elf_Data *data = elf_getdata (elf_getscn (ebl->elf, idx), NULL);
if (data == NULL)
{
- ERROR (gettext ("section [%2d] '%s': cannot get section data\n"),
+ ERROR (_("section [%2d] '%s': cannot get section data\n"),
idx, section_name (ebl, idx));
return;
}
GElf_Rel *rel = gelf_getrel (data, cnt, &rel_mem);
if (rel == NULL)
{
- ERROR (gettext ("\
+ ERROR (_("\
section [%2d] '%s': cannot get relocation %zu: %s\n"),
idx, section_name (ebl, idx), cnt, elf_errmsg (-1));
continue;
memset (has_addr_dt, '\0', sizeof (has_addr_dt));
if (++ndynamic == 2)
- ERROR (gettext ("more than one dynamic section present\n"));
+ ERROR (_("more than one dynamic section present\n"));
data = elf_getdata (elf_getscn (ebl->elf, idx), NULL);
if (data == NULL)
{
- ERROR (gettext ("section [%2d] '%s': cannot get section data\n"),
+ ERROR (_("section [%2d] '%s': cannot get section data\n"),
idx, section_name (ebl, idx));
return;
}
strshdr = gelf_getshdr (elf_getscn (ebl->elf, shdr->sh_link), &strshdr_mem);
if (strshdr != NULL && strshdr->sh_type != SHT_STRTAB)
- ERROR (gettext ("\
+ ERROR (_("\
section [%2d] '%s': referenced as string table for section [%2d] '%s' but type is not SHT_STRTAB\n"),
shdr->sh_link, section_name (ebl, shdr->sh_link),
idx, section_name (ebl, idx));
else if (strshdr == NULL)
{
- ERROR (gettext ("\
+ ERROR (_("\
section [%2d]: referenced as string table for section [%2d] '%s' but section link value is invalid\n"),
shdr->sh_link, idx, section_name (ebl, idx));
return;
size_t sh_entsize = gelf_fsize (ebl->elf, ELF_T_DYN, 1, EV_CURRENT);
if (shdr->sh_entsize != sh_entsize)
- ERROR (gettext ("\
+ ERROR (_("\
section [%2d] '%s': section entry size does not match ElfXX_Dyn\n"),
idx, section_name (ebl, idx));
if (shdr->sh_info != 0)
- ERROR (gettext ("section [%2d] '%s': sh_info not zero\n"),
+ ERROR (_("section [%2d] '%s': sh_info not zero\n"),
idx, section_name (ebl, idx));
bool non_null_warned = false;
GElf_Dyn *dyn = gelf_getdyn (data, cnt, &dyn_mem);
if (dyn == NULL)
{
- ERROR (gettext ("\
+ ERROR (_("\
section [%2d] '%s': cannot get dynamic section entry %zu: %s\n"),
idx, section_name (ebl, idx), cnt, elf_errmsg (-1));
continue;
if (has_dt[DT_NULL] && dyn->d_tag != DT_NULL && ! non_null_warned)
{
- ERROR (gettext ("\
+ ERROR (_("\
section [%2d] '%s': non-DT_NULL entries follow DT_NULL entry\n"),
idx, section_name (ebl, idx));
non_null_warned = true;
}
if (!ebl_dynamic_tag_check (ebl, dyn->d_tag))
- ERROR (gettext ("section [%2d] '%s': entry %zu: unknown tag\n"),
+ ERROR (_("section [%2d] '%s': entry %zu: unknown tag\n"),
idx, section_name (ebl, idx), cnt);
if (dyn->d_tag >= 0 && dyn->d_tag < DT_NUM)
&& dyn->d_tag != DT_POSFLAG_1)
{
char buf[50];
- ERROR (gettext ("\
+ ERROR (_("\
section [%2d] '%s': entry %zu: more than one entry with tag %s\n"),
idx, section_name (ebl, idx), cnt,
ebl_dynamic_tag_name (ebl, dyn->d_tag,
if (be_strict && level2[dyn->d_tag])
{
char buf[50];
- ERROR (gettext ("\
+ ERROR (_("\
section [%2d] '%s': entry %zu: level 2 tag %s used\n"),
idx, section_name (ebl, idx), cnt,
ebl_dynamic_tag_name (ebl, dyn->d_tag,
if (dyn->d_tag == DT_PLTREL && dyn->d_un.d_val != DT_REL
&& dyn->d_un.d_val != DT_RELA)
- ERROR (gettext ("\
+ ERROR (_("\
section [%2d] '%s': entry %zu: DT_PLTREL value must be DT_REL or DT_RELA\n"),
idx, section_name (ebl, idx), cnt);
specified in sh_link. */
if (strshdr->sh_addr != dyn->d_un.d_val)
{
- ERROR (gettext ("\
+ ERROR (_("\
section [%2d] '%s': entry %zu: pointer does not match address of section [%2d] '%s' referenced by sh_link\n"),
idx, section_name (ebl, idx), cnt,
shdr->sh_link, section_name (ebl, shdr->sh_link));
if (unlikely (n >= phnum))
{
char buf[50];
- ERROR (gettext ("\
+ ERROR (_("\
section [%2d] '%s': entry %zu: %s value must point into loaded segment\n"),
idx, section_name (ebl, idx), cnt,
ebl_dynamic_tag_name (ebl, dyn->d_tag, buf,
if (dyn->d_un.d_ptr >= strshdr->sh_size)
{
char buf[50];
- ERROR (gettext ("\
+ ERROR (_("\
section [%2d] '%s': entry %zu: %s value must be valid offset in section [%2d] '%s'\n"),
idx, section_name (ebl, idx), cnt,
ebl_dynamic_tag_name (ebl, dyn->d_tag, buf,
char buf1[50];
char buf2[50];
- ERROR (gettext ("\
+ ERROR (_("\
section [%2d] '%s': contains %s entry but not %s\n"),
idx, section_name (ebl, idx),
ebl_dynamic_tag_name (ebl, cnt, buf1, sizeof (buf1)),
if (mandatory[cnt])
{
char buf[50];
- ERROR (gettext ("\
+ ERROR (_("\
section [%2d] '%s': mandatory tag %s not present\n"),
idx, section_name (ebl, idx),
ebl_dynamic_tag_name (ebl, cnt, buf, sizeof (buf)));
/* Make sure we have an hash table. */
if (!has_dt[DT_HASH] && !has_addr_dt[DT_ADDRTAGIDX (DT_GNU_HASH)])
- ERROR (gettext ("\
+ ERROR (_("\
section [%2d] '%s': no hash section present\n"),
idx, section_name (ebl, idx));
/* The GNU-style hash table also needs a symbol table. */
if (!has_dt[DT_HASH] && has_addr_dt[DT_ADDRTAGIDX (DT_GNU_HASH)]
&& !has_dt[DT_SYMTAB])
- ERROR (gettext ("\
+ ERROR (_("\
section [%2d] '%s': contains %s entry but not %s\n"),
idx, section_name (ebl, idx),
"DT_GNU_HASH", "DT_SYMTAB");
/* Check the rel/rela tags. At least one group must be available. */
if ((has_dt[DT_RELA] || has_dt[DT_RELASZ] || has_dt[DT_RELAENT])
&& (!has_dt[DT_RELA] || !has_dt[DT_RELASZ] || !has_dt[DT_RELAENT]))
- ERROR (gettext ("\
+ ERROR (_("\
section [%2d] '%s': not all of %s, %s, and %s are present\n"),
idx, section_name (ebl, idx),
"DT_RELA", "DT_RELASZ", "DT_RELAENT");
if ((has_dt[DT_REL] || has_dt[DT_RELSZ] || has_dt[DT_RELENT])
&& (!has_dt[DT_REL] || !has_dt[DT_RELSZ] || !has_dt[DT_RELENT]))
- ERROR (gettext ("\
+ ERROR (_("\
section [%2d] '%s': not all of %s, %s, and %s are present\n"),
idx, section_name (ebl, idx),
"DT_REL", "DT_RELSZ", "DT_RELENT");
|| has_val_dt[DT_VALTAGIDX (DT_CHECKSUM)])
{
if (!has_val_dt[DT_VALTAGIDX (DT_GNU_PRELINKED)])
- ERROR (gettext ("\
+ ERROR (_("\
section [%2d] '%s': %s tag missing in DSO marked during prelinking\n"),
idx, section_name (ebl, idx), "DT_GNU_PRELINKED");
if (!has_val_dt[DT_VALTAGIDX (DT_CHECKSUM)])
- ERROR (gettext ("\
+ ERROR (_("\
section [%2d] '%s': %s tag missing in DSO marked during prelinking\n"),
idx, section_name (ebl, idx), "DT_CHECKSUM");
/* Only DSOs can be marked like this. */
if (ehdr->e_type != ET_DYN)
- ERROR (gettext ("\
+ ERROR (_("\
section [%2d] '%s': non-DSO file marked as dependency during prelink\n"),
idx, section_name (ebl, idx));
}
|| has_addr_dt[DT_ADDRTAGIDX (DT_GNU_LIBLIST)])
{
if (!has_val_dt[DT_VALTAGIDX (DT_GNU_CONFLICTSZ)])
- ERROR (gettext ("\
+ ERROR (_("\
section [%2d] '%s': %s tag missing in prelinked executable\n"),
idx, section_name (ebl, idx), "DT_GNU_CONFLICTSZ");
if (!has_val_dt[DT_VALTAGIDX (DT_GNU_LIBLISTSZ)])
- ERROR (gettext ("\
+ ERROR (_("\
section [%2d] '%s': %s tag missing in prelinked executable\n"),
idx, section_name (ebl, idx), "DT_GNU_LIBLISTSZ");
if (!has_addr_dt[DT_ADDRTAGIDX (DT_GNU_CONFLICT)])
- ERROR (gettext ("\
+ ERROR (_("\
section [%2d] '%s': %s tag missing in prelinked executable\n"),
idx, section_name (ebl, idx), "DT_GNU_CONFLICT");
if (!has_addr_dt[DT_ADDRTAGIDX (DT_GNU_LIBLIST)])
- ERROR (gettext ("\
+ ERROR (_("\
section [%2d] '%s': %s tag missing in prelinked executable\n"),
idx, section_name (ebl, idx), "DT_GNU_LIBLIST");
}
{
if (ehdr->e_type != ET_REL)
{
- ERROR (gettext ("\
+ ERROR (_("\
section [%2d] '%s': only relocatable files can have extended section index\n"),
idx, section_name (ebl, idx));
return;
GElf_Shdr symshdr_mem;
GElf_Shdr *symshdr = gelf_getshdr (symscn, &symshdr_mem);
if (symshdr != NULL && symshdr->sh_type != SHT_SYMTAB)
- ERROR (gettext ("\
+ ERROR (_("\
section [%2d] '%s': extended section index section not for symbol table\n"),
idx, section_name (ebl, idx));
else if (symshdr == NULL)
- ERROR (gettext ("\
+ ERROR (_("\
section [%2d] '%s': sh_link extended section index [%2d] is invalid\n"),
idx, section_name (ebl, idx), shdr->sh_link);
Elf_Data *symdata = elf_getdata (symscn, NULL);
if (symdata == NULL)
- ERROR (gettext ("cannot get data for symbol section\n"));
+ ERROR (_("cannot get data for symbol section\n"));
if (shdr->sh_entsize != sizeof (Elf32_Word))
- ERROR (gettext ("\
+ ERROR (_("\
section [%2d] '%s': entry size does not match Elf32_Word\n"),
idx, section_name (ebl, idx));
&& symshdr->sh_entsize != 0
&& (shdr->sh_size / shdr->sh_entsize
< symshdr->sh_size / symshdr->sh_entsize))
- ERROR (gettext ("\
+ ERROR (_("\
section [%2d] '%s': extended index table too small for symbol table\n"),
idx, section_name (ebl, idx));
if (shdr->sh_info != 0)
- ERROR (gettext ("section [%2d] '%s': sh_info not zero\n"),
+ ERROR (_("section [%2d] '%s': sh_info not zero\n"),
idx, section_name (ebl, idx));
for (size_t cnt = idx + 1; cnt < shnum; ++cnt)
if (rshdr != NULL && rshdr->sh_type == SHT_SYMTAB_SHNDX
&& rshdr->sh_link == shdr->sh_link)
{
- ERROR (gettext ("\
+ ERROR (_("\
section [%2d] '%s': extended section index in section [%2zu] '%s' refers to same symbol table\n"),
idx, section_name (ebl, idx),
cnt, section_name (ebl, cnt));
Elf_Data *data = elf_getdata (elf_getscn (ebl->elf, idx), NULL);
if (data == NULL || data->d_buf == NULL)
{
- ERROR (gettext ("section [%2d] '%s': cannot get section data\n"),
+ ERROR (_("section [%2d] '%s': cannot get section data\n"),
idx, section_name (ebl, idx));
return;
}
if (data->d_size < sizeof (Elf32_Word)
|| *((Elf32_Word *) data->d_buf) != 0)
- ERROR (gettext ("symbol 0 should have zero extended section index\n"));
+ ERROR (_("symbol 0 should have zero extended section index\n"));
for (size_t cnt = 1; cnt < data->d_size / sizeof (Elf32_Word); ++cnt)
{
GElf_Sym *sym = gelf_getsym (symdata, cnt, &sym_data);
if (sym == NULL)
{
- ERROR (gettext ("cannot get data for symbol %zu\n"), cnt);
+ ERROR (_("cannot get data for symbol %zu\n"), cnt);
continue;
}
if (sym->st_shndx != SHN_XINDEX)
- ERROR (gettext ("\
+ ERROR (_("\
extended section index is %" PRIu32 " but symbol index is not XINDEX\n"),
(uint32_t) xndx);
}
if (shdr->sh_size < (2ULL + nbucket + nchain) * sizeof (Elf32_Word))
{
- ERROR (gettext ("\
+ ERROR (_("\
section [%2d] '%s': hash table section is too small (is %ld, expected %ld)\n"),
idx, section_name (ebl, idx), (long int) shdr->sh_size,
(long int) ((2 + nbucket + nchain) * sizeof (Elf32_Word)));
size_t symsize = symshdr->sh_size / symshdr->sh_entsize;
if (nchain > symshdr->sh_size / symshdr->sh_entsize)
- ERROR (gettext ("section [%2d] '%s': chain array too large\n"),
+ ERROR (_("section [%2d] '%s': chain array too large\n"),
idx, section_name (ebl, idx));
maxidx = symsize;
if (buf + cnt >= end)
break;
else if (buf[cnt] >= maxidx)
- ERROR (gettext ("\
+ ERROR (_("\
section [%2d] '%s': hash bucket reference %zu out of bounds\n"),
idx, section_name (ebl, idx), cnt - 2);
}
if (buf + cnt >= end)
break;
else if (buf[cnt] >= maxidx)
- ERROR (gettext ("\
+ ERROR (_("\
section [%2d] '%s': hash chain reference %zu out of bounds\n"),
idx, section_name (ebl, idx), cnt - 2 - nbucket);
}
|| maxwords - 2 < nbucket
|| maxwords - 2 - nbucket < nchain)
{
- ERROR (gettext ("\
+ ERROR (_("\
section [%2d] '%s': hash table section is too small (is %ld, expected %ld)\n"),
idx, section_name (ebl, idx), (long int) shdr->sh_size,
(long int) ((2 + nbucket + nchain) * sizeof (Elf64_Xword)));
size_t symsize = symshdr->sh_size / symshdr->sh_entsize;
if (nchain > symshdr->sh_size / symshdr->sh_entsize)
- ERROR (gettext ("section [%2d] '%s': chain array too large\n"),
+ ERROR (_("section [%2d] '%s': chain array too large\n"),
idx, section_name (ebl, idx));
maxidx = symsize;
if (buf + cnt >= end)
break;
else if (buf[cnt] >= maxidx)
- ERROR (gettext ("\
+ ERROR (_("\
section [%2d] '%s': hash bucket reference %zu out of bounds\n"),
idx, section_name (ebl, idx), cnt - 2);
}
if (buf + cnt >= end)
break;
else if (buf[cnt] >= maxidx)
- ERROR (gettext ("\
+ ERROR (_("\
section [%2d] '%s': hash chain reference %" PRIu64 " out of bounds\n"),
idx, section_name (ebl, idx), (uint64_t) cnt - 2 - nbucket);
}
{
if (data->d_size < 4 * sizeof (Elf32_Word))
{
- ERROR (gettext ("\
+ ERROR (_("\
section [%2d] '%s': not enough data\n"),
idx, section_name (ebl, idx));
return;
if (bitmask_words == 0 || !powerof2 (bitmask_words))
{
- ERROR (gettext ("\
+ ERROR (_("\
section [%2d] '%s': bitmask size zero or not power of 2: %u\n"),
idx, section_name (ebl, idx), bitmask_words);
return;
uint64_t used_buf = (4ULL + bitmask_words + nbuckets) * sizeof (Elf32_Word);
if (used_buf > data->d_size)
{
- ERROR (gettext ("\
+ ERROR (_("\
section [%2d] '%s': hash table section is too small (is %ld, expected at least %ld)\n"),
idx, section_name (ebl, idx), (long int) shdr->sh_size,
(long int) used_buf);
if (shift > 31)
{
- ERROR (gettext ("\
+ ERROR (_("\
section [%2d] '%s': 2nd hash function shift too big: %u\n"),
idx, section_name (ebl, idx), shift);
return;
if (symidx < symbias)
{
- ERROR (gettext ("\
+ ERROR (_("\
section [%2d] '%s': hash chain for bucket %zu lower than symbol index bias\n"),
idx, section_name (ebl, idx), cnt - (4 + bitmask_words));
continue;
GElf_Sym *sym = gelf_getsym (symdata, symidx, &sym_mem);
if (sym != NULL && sym->st_shndx == SHN_UNDEF
&& GELF_ST_TYPE (sym->st_info) != STT_FUNC)
- ERROR (gettext ("\
+ ERROR (_("\
section [%2d] '%s': symbol %u referenced in chain for bucket %zu is undefined\n"),
idx, section_name (ebl, idx), symidx,
cnt - (4 + bitmask_words));
{
Elf32_Word hval = elf_gnu_hash (symname);
if ((hval & ~1u) != (chainhash & ~1u))
- ERROR (gettext ("\
+ ERROR (_("\
section [%2d] '%s': hash value for symbol %u in chain for bucket %zu wrong\n"),
idx, section_name (ebl, idx), symidx,
cnt - (4 + bitmask_words));
size_t maskidx = (hval / classbits) & bitmask_idxmask;
if (maskidx >= bitmask_words)
{
- ERROR (gettext ("\
+ ERROR (_("\
section [%2d] '%s': mask index for symbol %u in chain for bucket %zu wrong\n"),
idx, section_name (ebl, idx), symidx,
cnt - (4 + bitmask_words));
}
if (symidx - symbias >= maxidx)
- ERROR (gettext ("\
+ ERROR (_("\
section [%2d] '%s': hash chain for bucket %zu out of bounds\n"),
idx, section_name (ebl, idx), cnt - (4 + bitmask_words));
else if (symshdr != NULL && symshdr->sh_entsize != 0
&& symidx > symshdr->sh_size / symshdr->sh_entsize)
- ERROR (gettext ("\
+ ERROR (_("\
section [%2d] '%s': symbol reference in chain for bucket %zu out of bounds\n"),
idx, section_name (ebl, idx), cnt - (4 + bitmask_words));
}
if (memcmp (collected.p32, bitmask.p32, bitmask_words * sizeof (Elf32_Word)))
- ERROR (gettext ("\
+ ERROR (_("\
section [%2d] '%s': bitmask does not match names in the hash table\n"),
idx, section_name (ebl, idx));
{
if (ehdr->e_type == ET_REL)
{
- ERROR (gettext ("\
+ ERROR (_("\
section [%2d] '%s': relocatable files cannot have hash tables\n"),
idx, section_name (ebl, idx));
return;
Elf_Data *data = elf_getdata (elf_getscn (ebl->elf, idx), NULL);
if (data == NULL || data->d_buf == NULL)
{
- ERROR (gettext ("section [%2d] '%s': cannot get section data\n"),
+ ERROR (_("section [%2d] '%s': cannot get section data\n"),
idx, section_name (ebl, idx));
return;
}
GElf_Shdr *symshdr = gelf_getshdr (elf_getscn (ebl->elf, shdr->sh_link),
&symshdr_mem);
if (symshdr != NULL && symshdr->sh_type != SHT_DYNSYM)
- ERROR (gettext ("\
+ ERROR (_("\
section [%2d] '%s': hash table not for dynamic symbol table\n"),
idx, section_name (ebl, idx));
else if (symshdr == NULL)
- ERROR (gettext ("\
+ ERROR (_("\
section [%2d] '%s': invalid sh_link symbol table section index [%2d]\n"),
idx, section_name (ebl, idx), shdr->sh_link);
: (size_t) ebl_sysvhash_entrysize (ebl));
if (shdr->sh_entsize != expect_entsize)
- ERROR (gettext ("\
+ ERROR (_("\
section [%2d] '%s': hash table entry size incorrect\n"),
idx, section_name (ebl, idx));
if ((shdr->sh_flags & SHF_ALLOC) == 0)
- ERROR (gettext ("section [%2d] '%s': not marked to be allocated\n"),
+ ERROR (_("section [%2d] '%s': not marked to be allocated\n"),
idx, section_name (ebl, idx));
if (shdr->sh_size < (tag == SHT_GNU_HASH ? 4 : 2) * (expect_entsize ?: 4))
{
- ERROR (gettext ("\
+ ERROR (_("\
section [%2d] '%s': hash table has not even room for initial administrative entries\n"),
idx, section_name (ebl, idx));
return;
/* The link must point to the same symbol table. */
if (hash_shdr->sh_link != gnu_hash_shdr->sh_link)
{
- ERROR (gettext ("\
+ ERROR (_("\
sh_link in hash sections [%2zu] '%s' and [%2zu] '%s' not identical\n"),
hash_idx, elf_strptr (ebl->elf, shstrndx, hash_shdr->sh_name),
gnu_hash_idx,
if (gnu_hash_data->d_size < 4 * sizeof (Elf32_Word))
{
- ERROR (gettext ("\
+ ERROR (_("\
hash section [%2zu] '%s' does not contain enough data\n"),
gnu_hash_idx, gnu_hash_name);
return;
if (gnu_hasharr[2] == 0)
{
- ERROR (gettext ("\
+ ERROR (_("\
hash section [%2zu] '%s' has zero bit mask words\n"),
gnu_hash_idx, gnu_hash_name);
return;
uint32_t max_nsyms = (gnu_hash_data->d_size - used_buf) / sizeof (Elf32_Word);
if (used_buf > gnu_hash_data->d_size)
{
- ERROR (gettext ("\
+ ERROR (_("\
hash section [%2zu] '%s' uses too much data\n"),
gnu_hash_idx, gnu_hash_name);
return;
{
if (symidx >= max_nsyms || symidx + gnu_symbias >= nentries)
{
- ERROR (gettext ("\
+ ERROR (_("\
hash section [%2zu] '%s' invalid symbol index %" PRIu32 " (max_nsyms: %" PRIu32 ", nentries: %" PRIu32 "\n"),
gnu_hash_idx, gnu_hash_name, symidx, max_nsyms, nentries);
return;
const Elf32_Word *hasharr = (Elf32_Word *) hash_data->d_buf;
if (hash_data->d_size < 2 * sizeof (Elf32_Word))
{
- ERROR (gettext ("\
+ ERROR (_("\
hash section [%2zu] '%s' does not contain enough data\n"),
hash_idx, hash_name);
return;
uint64_t hash_used = (2ULL + nchain + nbucket) * sizeof (Elf32_Word);
if (hash_used > hash_data->d_size)
{
- ERROR (gettext ("\
+ ERROR (_("\
hash section [%2zu] '%s' uses too much data\n"),
hash_idx, hash_name);
return;
const Elf64_Xword *hasharr = (Elf64_Xword *) hash_data->d_buf;
if (hash_data->d_size < 2 * sizeof (Elf32_Word))
{
- ERROR (gettext ("\
+ ERROR (_("\
hash section [%2zu] '%s' does not contain enough data\n"),
hash_idx, hash_name);
return;
|| maxwords - 2 < nbucket
|| maxwords - 2 - nbucket < nchain)
{
- ERROR (gettext ("\
+ ERROR (_("\
hash section [%2zu] '%s' uses too much data\n"),
hash_idx, hash_name);
return;
}
else
{
- ERROR (gettext ("\
+ ERROR (_("\
hash section [%2zu] '%s' invalid sh_entsize\n"),
hash_idx, hash_name);
return;
(unless the symbol is undefined in which case it can be omitted
in the new table format). */
if ((used[0] & 1) != 0)
- ERROR (gettext ("section [%2zu] '%s': reference to symbol index 0\n"),
+ ERROR (_("section [%2zu] '%s': reference to symbol index 0\n"),
gnu_hash_idx,
elf_strptr (ebl->elf, shstrndx, gnu_hash_shdr->sh_name));
if ((used[0] & 2) != 0)
- ERROR (gettext ("section [%2zu] '%s': reference to symbol index 0\n"),
+ ERROR (_("section [%2zu] '%s': reference to symbol index 0\n"),
hash_idx, elf_strptr (ebl->elf, shstrndx, hash_shdr->sh_name));
for (uint32_t cnt = 1; cnt < nentries; ++cnt)
if (used[cnt] != 0 && used[cnt] != 3)
{
if (used[cnt] == 1)
- ERROR (gettext ("\
+ ERROR (_("\
symbol %d referenced in new hash table in [%2zu] '%s' but not in old hash table in [%2zu] '%s'\n"),
cnt, gnu_hash_idx,
elf_strptr (ebl->elf, shstrndx, gnu_hash_shdr->sh_name),
GElf_Sym *sym = gelf_getsym (sym_data, cnt, &sym_mem);
if (sym != NULL && sym->st_shndx != STN_UNDEF)
- ERROR (gettext ("\
+ ERROR (_("\
symbol %d referenced in old hash table in [%2zu] '%s' but not in new hash table in [%2zu] '%s'\n"),
cnt, hash_idx,
elf_strptr (ebl->elf, shstrndx, hash_shdr->sh_name),
{
#define TEST(name, extra) \
if (extra && shdr->sh_##name != 0) \
- ERROR (gettext ("section [%2d] '%s': nonzero sh_%s for NULL section\n"), \
+ ERROR (_("section [%2d] '%s': nonzero sh_%s for NULL section\n"), \
idx, section_name (ebl, idx), #name)
TEST (name, 1);
{
if (ehdr->e_type != ET_REL)
{
- ERROR (gettext ("\
+ ERROR (_("\
section [%2d] '%s': section groups only allowed in relocatable object files\n"),
idx, section_name (ebl, idx));
return;
GElf_Shdr symshdr_mem;
GElf_Shdr *symshdr = gelf_getshdr (symscn, &symshdr_mem);
if (symshdr == NULL)
- ERROR (gettext ("section [%2d] '%s': cannot get symbol table: %s\n"),
+ ERROR (_("section [%2d] '%s': cannot get symbol table: %s\n"),
idx, section_name (ebl, idx), elf_errmsg (-1));
else
{
if (symshdr->sh_type != SHT_SYMTAB)
- ERROR (gettext ("\
+ ERROR (_("\
section [%2d] '%s': section reference in sh_link is no symbol table\n"),
idx, section_name (ebl, idx));
if (shdr->sh_info >= symshdr->sh_size / gelf_fsize (ebl->elf, ELF_T_SYM,
1, EV_CURRENT))
- ERROR (gettext ("\
+ ERROR (_("\
section [%2d] '%s': invalid symbol index in sh_info\n"),
idx, section_name (ebl, idx));
if (shdr->sh_flags != 0)
- ERROR (gettext ("section [%2d] '%s': sh_flags not zero\n"),
+ ERROR (_("section [%2d] '%s': sh_flags not zero\n"),
idx, section_name (ebl, idx));
GElf_Sym sym_data;
GElf_Sym *sym = gelf_getsym (elf_getdata (symscn, NULL), shdr->sh_info,
&sym_data);
if (sym == NULL)
- ERROR (gettext ("\
+ ERROR (_("\
section [%2d] '%s': cannot get symbol for signature\n"),
idx, section_name (ebl, idx));
else if (elf_strptr (ebl->elf, symshdr->sh_link, sym->st_name) == NULL)
- ERROR (gettext ("\
+ ERROR (_("\
section [%2d] '%s': cannot get symbol name for signature\n"),
idx, section_name (ebl, idx));
else if (strcmp (elf_strptr (ebl->elf, symshdr->sh_link, sym->st_name),
"") == 0)
- ERROR (gettext ("\
+ ERROR (_("\
section [%2d] '%s': signature symbol cannot be empty string\n"),
idx, section_name (ebl, idx));
if (be_strict
&& shdr->sh_entsize != elf32_fsize (ELF_T_WORD, 1, EV_CURRENT))
- ERROR (gettext ("section [%2d] '%s': sh_flags not set correctly\n"),
+ ERROR (_("section [%2d] '%s': sh_flags not set correctly\n"),
idx, section_name (ebl, idx));
}
Elf_Data *data = elf_getdata (elf_getscn (ebl->elf, idx), NULL);
if (data == NULL || data->d_buf == NULL)
- ERROR (gettext ("section [%2d] '%s': cannot get data: %s\n"),
+ ERROR (_("section [%2d] '%s': cannot get data: %s\n"),
idx, section_name (ebl, idx), elf_errmsg (-1));
else
{
Elf32_Word val;
if (data->d_size % elsize != 0)
- ERROR (gettext ("\
+ ERROR (_("\
section [%2d] '%s': section size not multiple of sizeof(Elf32_Word)\n"),
idx, section_name (ebl, idx));
if (data->d_size < elsize)
{
- ERROR (gettext ("\
+ ERROR (_("\
section [%2d] '%s': section group without flags word\n"),
idx, section_name (ebl, idx));
return;
else if (be_strict)
{
if (data->d_size < 2 * elsize)
- ERROR (gettext ("\
+ ERROR (_("\
section [%2d] '%s': section group without member\n"),
idx, section_name (ebl, idx));
else if (data->d_size < 3 * elsize)
- ERROR (gettext ("\
+ ERROR (_("\
section [%2d] '%s': section group with only one member\n"),
idx, section_name (ebl, idx));
}
memcpy (&val, data->d_buf, elsize);
#endif
if ((val & ~GRP_COMDAT) != 0)
- ERROR (gettext ("section [%2d] '%s': unknown section group flags\n"),
+ ERROR (_("section [%2d] '%s': unknown section group flags\n"),
idx, section_name (ebl, idx));
for (cnt = elsize; cnt + elsize <= data->d_size; cnt += elsize)
#endif
if (val > shnum)
- ERROR (gettext ("\
+ ERROR (_("\
section [%2d] '%s': section index %zu out of range\n"),
idx, section_name (ebl, idx), cnt / elsize);
else
GElf_Shdr *refshdr = gelf_getshdr (elf_getscn (ebl->elf, val),
&refshdr_mem);
if (refshdr == NULL)
- ERROR (gettext ("\
+ ERROR (_("\
section [%2d] '%s': cannot get section header for element %zu: %s\n"),
idx, section_name (ebl, idx), cnt / elsize,
elf_errmsg (-1));
else
{
if (refshdr->sh_type == SHT_GROUP)
- ERROR (gettext ("\
+ ERROR (_("\
section [%2d] '%s': section group contains another group [%2d] '%s'\n"),
idx, section_name (ebl, idx),
val, section_name (ebl, val));
if ((refshdr->sh_flags & SHF_GROUP) == 0)
- ERROR (gettext ("\
+ ERROR (_("\
section [%2d] '%s': element %zu references section [%2d] '%s' without SHF_GROUP flag set\n"),
idx, section_name (ebl, idx), cnt / elsize,
val, section_name (ebl, val));
}
if (val < shnum && ++scnref[val] == 2)
- ERROR (gettext ("\
+ ERROR (_("\
section [%2d] '%s' is contained in more than one section group\n"),
val, section_name (ebl, val));
}
Elf_Data *data = elf_getdata (scn, NULL);
if (data == NULL)
{
- ERROR (gettext ("section [%2d] '%s': cannot get section data\n"),
+ ERROR (_("section [%2d] '%s': cannot get section data\n"),
idx, section_name (ebl, idx));
return;
}
if (symshdr->sh_type != SHT_DYNSYM)
{
- ERROR (gettext ("\
+ ERROR (_("\
section [%2d] '%s' refers in sh_link to section [%2d] '%s' which is no dynamic symbol table\n"),
idx, section_name (ebl, idx),
shdr->sh_link, section_name (ebl, shdr->sh_link));
if (shdr->sh_entsize != 0 && symshdr->sh_entsize != 0
&& (shdr->sh_size / shdr->sh_entsize
!= symshdr->sh_size / symshdr->sh_entsize))
- ERROR (gettext ("\
+ ERROR (_("\
section [%2d] '%s' has different number of entries than symbol table [%2d] '%s'\n"),
idx, section_name (ebl, idx),
shdr->sh_link, section_name (ebl, shdr->sh_link));
GElf_Versym *versym = gelf_getversym (data, cnt, &versym_mem);
if (versym == NULL)
{
- ERROR (gettext ("\
+ ERROR (_("\
section [%2d] '%s': symbol %d: cannot read version data\n"),
idx, section_name (ebl, idx), cnt);
break;
{
/* Global symbol. Make sure it is not defined as local. */
if (GELF_ST_BIND (sym->st_info) == STB_LOCAL)
- ERROR (gettext ("\
+ ERROR (_("\
section [%2d] '%s': symbol %d: local symbol with global scope\n"),
idx, section_name (ebl, idx), cnt);
}
{
/* Versioned symbol. Make sure it is not defined as local. */
if (!gnuld && GELF_ST_BIND (sym->st_info) == STB_LOCAL)
- ERROR (gettext ("\
+ ERROR (_("\
section [%2d] '%s': symbol %d: local symbol with version\n"),
idx, section_name (ebl, idx), cnt);
runp = runp->next;
if (runp == NULL)
- ERROR (gettext ("\
+ ERROR (_("\
section [%2d] '%s': symbol %d: invalid version index %d\n"),
idx, section_name (ebl, idx), cnt, (int) *versym);
else if (sym->st_shndx == SHN_UNDEF
&& runp->type == ver_def)
- ERROR (gettext ("\
+ ERROR (_("\
section [%2d] '%s': symbol %d: version index %d is for defined version\n"),
idx, section_name (ebl, idx), cnt, (int) *versym);
else if (sym->st_shndx != SHN_UNDEF
this must not happen. */
if (!has_copy_reloc (ebl, shdr->sh_link, cnt)
&& !in_nobits_scn (ebl, sym->st_shndx))
- ERROR (gettext ("\
+ ERROR (_("\
section [%2d] '%s': symbol %d: version index %d is for requested version\n"),
idx, section_name (ebl, idx), cnt, (int) *versym);
}
check_verneed (Ebl *ebl, GElf_Shdr *shdr, int idx)
{
if (++nverneed == 2)
- ERROR (gettext ("more than one version reference section present\n"));
+ ERROR (_("more than one version reference section present\n"));
GElf_Shdr strshdr_mem;
GElf_Shdr *strshdr = gelf_getshdr (elf_getscn (ebl->elf, shdr->sh_link),
if (strshdr == NULL)
return;
if (strshdr->sh_type != SHT_STRTAB)
- ERROR (gettext ("\
+ ERROR (_("\
section [%2d] '%s': sh_link does not link to string table\n"),
idx, section_name (ebl, idx));
Elf_Data *data = elf_getdata (elf_getscn (ebl->elf, idx), NULL);
if (data == NULL)
{
- ERROR (gettext ("section [%2d] '%s': cannot get section data\n"),
+ ERROR (_("section [%2d] '%s': cannot get section data\n"),
idx, section_name (ebl, idx));
return;
}
unsigned int auxoffset = offset + need->vn_aux;
if (need->vn_version != EV_CURRENT)
- ERROR (gettext ("\
+ ERROR (_("\
section [%2d] '%s': entry %d has wrong version %d\n"),
idx, section_name (ebl, idx), cnt, (int) need->vn_version);
if (need->vn_cnt > 0 && need->vn_aux < gelf_fsize (ebl->elf, ELF_T_VNEED,
1, EV_CURRENT))
{
- ERROR (gettext ("\
+ ERROR (_("\
section [%2d] '%s': entry %d has wrong offset of auxiliary data\n"),
idx, section_name (ebl, idx), cnt);
break;
need->vn_file);
if (libname == NULL)
{
- ERROR (gettext ("\
+ ERROR (_("\
section [%2d] '%s': entry %d has invalid file reference\n"),
idx, section_name (ebl, idx), cnt);
goto next_need;
/* Check that there is a DT_NEEDED entry for the referenced library. */
if (unknown_dependency_p (ebl->elf, libname))
- ERROR (gettext ("\
+ ERROR (_("\
section [%2d] '%s': entry %d references unknown dependency\n"),
idx, section_name (ebl, idx), cnt);
break;
if ((aux->vna_flags & ~VER_FLG_WEAK) != 0)
- ERROR (gettext ("\
+ ERROR (_("\
section [%2d] '%s': auxiliary entry %d of entry %d has unknown flag\n"),
idx, section_name (ebl, idx), need->vn_cnt - cnt2, cnt);
aux->vna_name);
if (verstr == NULL)
{
- ERROR (gettext ("\
+ ERROR (_("\
section [%2d] '%s': auxiliary entry %d of entry %d has invalid name reference\n"),
idx, section_name (ebl, idx), need->vn_cnt - cnt2, cnt);
break;
{
GElf_Word hashval = elf_hash (verstr);
if (hashval != aux->vna_hash)
- ERROR (gettext ("\
+ ERROR (_("\
section [%2d] '%s': auxiliary entry %d of entry %d has wrong hash value: %#x, expected %#x\n"),
idx, section_name (ebl, idx), need->vn_cnt - cnt2,
cnt, (int) hashval, (int) aux->vna_hash);
ver_need);
if (unlikely (res !=0))
{
- ERROR (gettext ("\
+ ERROR (_("\
section [%2d] '%s': auxiliary entry %d of entry %d has duplicate version name '%s'\n"),
idx, section_name (ebl, idx), need->vn_cnt - cnt2,
cnt, verstr);
&& aux->vna_next < gelf_fsize (ebl->elf, ELF_T_VNAUX, 1,
EV_CURRENT))
{
- ERROR (gettext ("\
+ ERROR (_("\
section [%2d] '%s': auxiliary entry %d of entry %d has wrong next field\n"),
idx, section_name (ebl, idx), need->vn_cnt - cnt2, cnt);
break;
if ((need->vn_next != 0 || cnt > 0)
&& offset < auxoffset)
{
- ERROR (gettext ("\
+ ERROR (_("\
section [%2d] '%s': entry %d has invalid offset to next entry\n"),
idx, section_name (ebl, idx), cnt);
break;
if (need->vn_next == 0 && cnt > 0)
{
- ERROR (gettext ("\
+ ERROR (_("\
section [%2d] '%s': entry %d has zero offset to next entry, but sh_info says there are more entries\n"),
idx, section_name (ebl, idx), cnt);
break;
check_verdef (Ebl *ebl, GElf_Shdr *shdr, int idx)
{
if (++nverdef == 2)
- ERROR (gettext ("more than one version definition section present\n"));
+ ERROR (_("more than one version definition section present\n"));
GElf_Shdr strshdr_mem;
GElf_Shdr *strshdr = gelf_getshdr (elf_getscn (ebl->elf, shdr->sh_link),
if (strshdr == NULL)
return;
if (strshdr->sh_type != SHT_STRTAB)
- ERROR (gettext ("\
+ ERROR (_("\
section [%2d] '%s': sh_link does not link to string table\n"),
idx, section_name (ebl, idx));
if (data == NULL)
{
no_data:
- ERROR (gettext ("section [%2d] '%s': cannot get section data\n"),
+ ERROR (_("section [%2d] '%s': cannot get section data\n"),
idx, section_name (ebl, idx));
return;
}
if ((def->vd_flags & VER_FLG_BASE) != 0)
{
if (has_base)
- ERROR (gettext ("\
+ ERROR (_("\
section [%2d] '%s': more than one BASE definition\n"),
idx, section_name (ebl, idx));
if (def->vd_ndx != VER_NDX_GLOBAL)
- ERROR (gettext ("\
+ ERROR (_("\
section [%2d] '%s': BASE definition must have index VER_NDX_GLOBAL\n"),
idx, section_name (ebl, idx));
has_base = true;
}
if ((def->vd_flags & ~(VER_FLG_BASE|VER_FLG_WEAK)) != 0)
- ERROR (gettext ("\
+ ERROR (_("\
section [%2d] '%s': entry %d has unknown flag\n"),
idx, section_name (ebl, idx), cnt);
if (def->vd_version != EV_CURRENT)
- ERROR (gettext ("\
+ ERROR (_("\
section [%2d] '%s': entry %d has wrong version %d\n"),
idx, section_name (ebl, idx), cnt, (int) def->vd_version);
if (def->vd_cnt > 0 && def->vd_aux < gelf_fsize (ebl->elf, ELF_T_VDEF,
1, EV_CURRENT))
{
- ERROR (gettext ("\
+ ERROR (_("\
section [%2d] '%s': entry %d has wrong offset of auxiliary data\n"),
idx, section_name (ebl, idx), cnt);
break;
const char *name = elf_strptr (ebl->elf, shdr->sh_link, aux->vda_name);
if (name == NULL)
{
- ERROR (gettext ("\
+ ERROR (_("\
section [%2d] '%s': entry %d has invalid name reference\n"),
idx, section_name (ebl, idx), cnt);
goto next_def;
}
GElf_Word hashval = elf_hash (name);
if (def->vd_hash != hashval)
- ERROR (gettext ("\
+ ERROR (_("\
section [%2d] '%s': entry %d has wrong hash value: %#x, expected %#x\n"),
idx, section_name (ebl, idx), cnt, (int) hashval,
(int) def->vd_hash);
int res = add_version (NULL, name, def->vd_ndx, ver_def);
if (unlikely (res !=0))
{
- ERROR (gettext ("\
+ ERROR (_("\
section [%2d] '%s': entry %d has duplicate version name '%s'\n"),
idx, section_name (ebl, idx), cnt, name);
}
name = elf_strptr (ebl->elf, shdr->sh_link, aux->vda_name);
if (name == NULL)
{
- ERROR (gettext ("\
+ ERROR (_("\
section [%2d] '%s': entry %d has invalid name reference in auxiliary data\n"),
idx, section_name (ebl, idx), cnt);
break;
&& aux->vda_next < gelf_fsize (ebl->elf, ELF_T_VDAUX, 1,
EV_CURRENT))
{
- ERROR (gettext ("\
+ ERROR (_("\
section [%2d] '%s': entry %d has wrong next field in auxiliary data\n"),
idx, section_name (ebl, idx), cnt);
break;
if ((def->vd_next != 0 || cnt > 0)
&& offset < auxoffset)
{
- ERROR (gettext ("\
+ ERROR (_("\
section [%2d] '%s': entry %d has invalid offset to next entry\n"),
idx, section_name (ebl, idx), cnt);
break;
if (def->vd_next == 0 && cnt > 0)
{
- ERROR (gettext ("\
+ ERROR (_("\
section [%2d] '%s': entry %d has zero offset to next entry, but sh_info says there are more entries\n"),
idx, section_name (ebl, idx), cnt);
break;
}
if (!has_base)
- ERROR (gettext ("section [%2d] '%s': no BASE definition\n"),
+ ERROR (_("section [%2d] '%s': no BASE definition\n"),
idx, section_name (ebl, idx));
/* Check whether the referenced names are available. */
}
if (runp == NULL)
- ERROR (gettext ("\
+ ERROR (_("\
section [%2d] '%s': unknown parent version '%s'\n"),
idx, section_name (ebl, idx), namelist->name);
{
if (shdr->sh_size == 0)
{
- ERROR (gettext ("section [%2d] '%s': empty object attributes section\n"),
+ ERROR (_("section [%2d] '%s': empty object attributes section\n"),
idx, section_name (ebl, idx));
return;
}
Elf_Data *data = elf_rawdata (elf_getscn (ebl->elf, idx), NULL);
if (data == NULL || data->d_size == 0 || data->d_buf == NULL)
{
- ERROR (gettext ("section [%2d] '%s': cannot get section data\n"),
+ ERROR (_("section [%2d] '%s': cannot get section data\n"),
idx, section_name (ebl, idx));
return;
}
const unsigned char *p = data->d_buf;
if (*p++ != 'A')
{
- ERROR (gettext ("section [%2d] '%s': unrecognized attribute format\n"),
+ ERROR (_("section [%2d] '%s': unrecognized attribute format\n"),
idx, section_name (ebl, idx));
return;
}
memcpy (&len, p, sizeof len);
if (len == 0)
- ERROR (gettext ("\
+ ERROR (_("\
section [%2d] '%s': offset %zu: zero length field in attribute section\n"),
idx, section_name (ebl, idx), pos (p));
if (len > left ())
{
- ERROR (gettext ("\
+ ERROR (_("\
section [%2d] '%s': offset %zu: invalid length in attribute section\n"),
idx, section_name (ebl, idx), pos (p));
break;
unsigned const char *q = memchr (name, '\0', len);
if (q == NULL)
{
- ERROR (gettext ("\
+ ERROR (_("\
section [%2d] '%s': offset %zu: unterminated vendor name string\n"),
idx, section_name (ebl, idx), pos (p));
break;
if (q >= p)
{
- ERROR (gettext ("\
+ ERROR (_("\
section [%2d] '%s': offset %zu: endless ULEB128 in attribute subsection tag\n"),
idx, section_name (ebl, idx), pos (chunk));
break;
uint32_t subsection_len;
if (p - q < (ptrdiff_t) sizeof subsection_len)
{
- ERROR (gettext ("\
+ ERROR (_("\
section [%2d] '%s': offset %zu: truncated attribute section\n"),
idx, section_name (ebl, idx), pos (q));
break;
memcpy (&subsection_len, q, sizeof subsection_len);
if (subsection_len == 0)
{
- ERROR (gettext ("\
+ ERROR (_("\
section [%2d] '%s': offset %zu: zero length field in attribute subsection\n"),
idx, section_name (ebl, idx), pos (q));
if (p - chunk < (ptrdiff_t) subsection_len
|| subsection_len >= (uint32_t) PTRDIFF_MAX)
{
- ERROR (gettext ("\
+ ERROR (_("\
section [%2d] '%s': offset %zu: invalid length in attribute subsection\n"),
idx, section_name (ebl, idx), pos (q));
break;
q = subsection_end;
if (subsection_tag != 1) /* Tag_File */
- ERROR (gettext ("\
+ ERROR (_("\
section [%2d] '%s': offset %zu: attribute subsection has unexpected tag %u\n"),
idx, section_name (ebl, idx), pos (chunk), subsection_tag);
else
get_uleb128 (value, r, q);
if (r > q)
{
- ERROR (gettext ("\
+ ERROR (_("\
section [%2d] '%s': offset %zu: endless ULEB128 in attribute tag\n"),
idx, section_name (ebl, idx), pos (chunk));
break;
r = memchr (r, '\0', q - r);
if (r == NULL)
{
- ERROR (gettext ("\
+ ERROR (_("\
section [%2d] '%s': offset %zu: unterminated string in attribute\n"),
idx, section_name (ebl, idx), pos (chunk));
break;
if (!ebl_check_object_attribute (ebl, (const char *) name,
tag, value,
&tag_name, &value_name))
- ERROR (gettext ("\
+ ERROR (_("\
section [%2d] '%s': offset %zu: unrecognized attribute tag %u\n"),
idx, section_name (ebl, idx), pos (chunk), tag);
else if ((tag & 1) == 0 && value_name == NULL)
- ERROR (gettext ("\
+ ERROR (_("\
section [%2d] '%s': offset %zu: unrecognized %s attribute value %" PRIu64 "\n"),
idx, section_name (ebl, idx), pos (chunk),
tag_name, value);
}
}
else
- ERROR (gettext ("\
+ ERROR (_("\
section [%2d] '%s': offset %zu: vendor '%s' unknown\n"),
idx, section_name (ebl, idx), pos (p), name);
}
if (left () != 0)
- ERROR (gettext ("\
+ ERROR (_("\
section [%2d] '%s': offset %zu: extra bytes after last attribute section\n"),
idx, section_name (ebl, idx), pos (p));
}
GElf_Shdr shdr_mem;
GElf_Shdr *shdr = gelf_getshdr (elf_getscn (ebl->elf, 0), &shdr_mem);
if (shdr == NULL)
- ERROR (gettext ("cannot get section header of zeroth section\n"));
+ ERROR (_("cannot get section header of zeroth section\n"));
else
{
if (shdr->sh_name != 0)
- ERROR (gettext ("zeroth section has nonzero name\n"));
+ ERROR (_("zeroth section has nonzero name\n"));
if (shdr->sh_type != 0)
- ERROR (gettext ("zeroth section has nonzero type\n"));
+ ERROR (_("zeroth section has nonzero type\n"));
if (shdr->sh_flags != 0)
- ERROR (gettext ("zeroth section has nonzero flags\n"));
+ ERROR (_("zeroth section has nonzero flags\n"));
if (shdr->sh_addr != 0)
- ERROR (gettext ("zeroth section has nonzero address\n"));
+ ERROR (_("zeroth section has nonzero address\n"));
if (shdr->sh_offset != 0)
- ERROR (gettext ("zeroth section has nonzero offset\n"));
+ ERROR (_("zeroth section has nonzero offset\n"));
if (shdr->sh_addralign != 0)
- ERROR (gettext ("zeroth section has nonzero align value\n"));
+ ERROR (_("zeroth section has nonzero align value\n"));
if (shdr->sh_entsize != 0)
- ERROR (gettext ("zeroth section has nonzero entry size value\n"));
+ ERROR (_("zeroth section has nonzero entry size value\n"));
if (shdr->sh_size != 0 && ehdr->e_shnum != 0)
- ERROR (gettext ("\
+ ERROR (_("\
zeroth section has nonzero size value while ELF header has nonzero shnum value\n"));
if (shdr->sh_link != 0 && ehdr->e_shstrndx != SHN_XINDEX)
- ERROR (gettext ("\
+ ERROR (_("\
zeroth section has nonzero link value while ELF header does not signal overflow in shstrndx\n"));
if (shdr->sh_info != 0 && ehdr->e_phnum != PN_XNUM)
- ERROR (gettext ("\
+ ERROR (_("\
zeroth section has nonzero link value while ELF header does not signal overflow in phnum\n"));
}
shdr = gelf_getshdr (scn, &shdr_mem);
if (shdr == NULL)
{
- ERROR (gettext ("\
+ ERROR (_("\
cannot get section header for section [%2zu] '%s': %s\n"),
cnt, section_name (ebl, cnt), elf_errmsg (-1));
continue;
const char *scnname = elf_strptr (ebl->elf, shstrndx, shdr->sh_name);
if (scnname == NULL)
- ERROR (gettext ("section [%2zu]: invalid name\n"), cnt);
+ ERROR (_("section [%2zu]: invalid name\n"), cnt);
else
{
/* Check whether it is one of the special sections defined in
|| IS_KNOWN_SPECIAL (s, ".debug_str", false)
|| IS_KNOWN_SPECIAL (s, ".debug", true)
|| IS_KNOWN_SPECIAL (s, ".shstrtab", false)))
- ERROR (gettext ("\
+ ERROR (_("\
section [%2d] '%s' has wrong type: expected %s, is %s\n"),
(int) cnt, scnname,
ebl_section_type_name (ebl, special_sections[s].type,
& ~(SHF_LINK_ORDER | SHF_GROUP | SHF_COMPRESSED))
!= special_sections[s].attr
&& (special_sections[s].attrflag == exact || !gnuld))
- ERROR (gettext ("\
+ ERROR (_("\
section [%2zu] '%s' has wrong flags: expected %s, is %s\n"),
cnt, scnname,
section_flags_string (special_sections[s].attr,
| special_sections[s].attr
| special_sections[s].attr2))
!= 0))
- ERROR (gettext ("\
+ ERROR (_("\
section [%2zu] '%s' has wrong flags: expected %s and possibly %s, is %s\n"),
cnt, scnname,
section_flags_string (special_sections[s].attr,
dot_interp_section = true;
if (ehdr->e_type == ET_REL)
- ERROR (gettext ("\
+ ERROR (_("\
section [%2zu] '%s' present in object file\n"),
cnt, scnname);
if ((shdr->sh_flags & SHF_ALLOC) != 0
&& !has_loadable_segment)
- ERROR (gettext ("\
+ ERROR (_("\
section [%2zu] '%s' has SHF_ALLOC flag set but there is no loadable segment\n"),
cnt, scnname);
else if ((shdr->sh_flags & SHF_ALLOC) == 0
&& has_loadable_segment)
- ERROR (gettext ("\
+ ERROR (_("\
section [%2zu] '%s' has SHF_ALLOC flag not set but there are loadable segments\n"),
cnt, scnname);
}
{
if (strcmp (scnname, ".symtab_shndx") == 0
&& ehdr->e_type != ET_REL)
- ERROR (gettext ("\
+ ERROR (_("\
section [%2zu] '%s' is extension section index table in non-object file\n"),
cnt, scnname);
// XXX TODO
if ((shdr->sh_flags & SHF_ALLOC) != 0
&& !has_loadable_segment)
- ERROR (gettext ("\
+ ERROR (_("\
section [%2zu] '%s' has SHF_ALLOC flag set but there is no loadable segment\n"),
cnt, scnname);
else if ((shdr->sh_flags & SHF_ALLOC) == 0
&& has_loadable_segment)
- ERROR (gettext ("\
+ ERROR (_("\
section [%2zu] '%s' has SHF_ALLOC flag not set but there are loadable segments\n"),
cnt, scnname);
#endif
}
if (shdr->sh_entsize != 0 && shdr->sh_size % shdr->sh_entsize)
- ERROR (gettext ("\
+ ERROR (_("\
section [%2zu] '%s': size not multiple of entry size\n"),
cnt, section_name (ebl, cnt));
if (elf_strptr (ebl->elf, shstrndx, shdr->sh_name) == NULL)
- ERROR (gettext ("cannot get section header\n"));
+ ERROR (_("cannot get section header\n"));
if (shdr->sh_type >= SHT_NUM
&& shdr->sh_type != SHT_GNU_ATTRIBUTES
&& shdr->sh_type != SHT_GNU_verneed
&& shdr->sh_type != SHT_GNU_versym
&& ebl_section_type_name (ebl, shdr->sh_type, NULL, 0) == NULL)
- ERROR (gettext ("section [%2zu] '%s' has unsupported type %d\n"),
+ ERROR (_("section [%2zu] '%s' has unsupported type %d\n"),
cnt, section_name (ebl, cnt),
(int) shdr->sh_type);
{
if (!ebl_machine_section_flag_check (ebl,
sh_flags & SHF_MASKPROC))
- ERROR (gettext ("section [%2zu] '%s'"
+ ERROR (_("section [%2zu] '%s'"
" contains invalid processor-specific flag(s)"
" %#" PRIx64 "\n"),
cnt, section_name (ebl, cnt), sh_flags & SHF_MASKPROC);
sh_flags &= ~(GElf_Xword) SHF_MASKPROC;
}
if (sh_flags != 0)
- ERROR (gettext ("section [%2zu] '%s' contains unknown flag(s)"
+ ERROR (_("section [%2zu] '%s' contains unknown flag(s)"
" %#" PRIx64 "\n"),
cnt, section_name (ebl, cnt), sh_flags);
}
{
// XXX Correct?
if (shdr->sh_addr != 0 && !gnuld)
- ERROR (gettext ("\
+ ERROR (_("\
section [%2zu] '%s': thread-local data sections address not zero\n"),
cnt, section_name (ebl, cnt));
if (shdr->sh_flags & SHF_COMPRESSED)
{
if (shdr->sh_flags & SHF_ALLOC)
- ERROR (gettext ("\
+ ERROR (_("\
section [%2zu] '%s': allocated section cannot be compressed\n"),
cnt, section_name (ebl, cnt));
if (shdr->sh_type == SHT_NOBITS)
- ERROR (gettext ("\
+ ERROR (_("\
section [%2zu] '%s': nobits section cannot be compressed\n"),
cnt, section_name (ebl, cnt));
GElf_Chdr chdr;
if (gelf_getchdr (scn, &chdr) == NULL)
- ERROR (gettext ("\
+ ERROR (_("\
section [%2zu] '%s': compressed section with no compression header: %s\n"),
cnt, section_name (ebl, cnt), elf_errmsg (-1));
}
if (shdr->sh_link >= shnum)
- ERROR (gettext ("\
+ ERROR (_("\
section [%2zu] '%s': invalid section reference in link value\n"),
cnt, section_name (ebl, cnt));
if (SH_INFO_LINK_P (shdr) && shdr->sh_info >= shnum)
- ERROR (gettext ("\
+ ERROR (_("\
section [%2zu] '%s': invalid section reference in info value\n"),
cnt, section_name (ebl, cnt));
if ((shdr->sh_flags & SHF_MERGE) == 0
&& (shdr->sh_flags & SHF_STRINGS) != 0
&& be_strict)
- ERROR (gettext ("\
+ ERROR (_("\
section [%2zu] '%s': strings flag set without merge flag\n"),
cnt, section_name (ebl, cnt));
if ((shdr->sh_flags & SHF_MERGE) != 0 && shdr->sh_entsize == 0)
- ERROR (gettext ("\
+ ERROR (_("\
section [%2zu] '%s': merge flag set but entry size is zero\n"),
cnt, section_name (ebl, cnt));
break;
FALLTHROUGH;
default:
- ERROR (gettext ("\
+ ERROR (_("\
section [%2zu] '%s' has unexpected type %d for an executable section\n"),
cnt, section_name (ebl, cnt), shdr->sh_type);
break;
if (shdr->sh_flags & SHF_WRITE)
{
if (is_debuginfo && shdr->sh_type != SHT_NOBITS)
- ERROR (gettext ("\
+ ERROR (_("\
section [%2zu] '%s' must be of type NOBITS in debuginfo files\n"),
cnt, section_name (ebl, cnt));
if (!is_debuginfo
&& !ebl_check_special_section (ebl, cnt, shdr,
section_name (ebl, cnt)))
- ERROR (gettext ("\
+ ERROR (_("\
section [%2zu] '%s' is both executable and writable\n"),
cnt, section_name (ebl, cnt));
}
/* Found the segment. */
if (phdr->p_offset + phdr->p_memsz
< shdr->sh_offset + shdr->sh_size)
- ERROR (gettext ("\
+ ERROR (_("\
section [%2zu] '%s' not fully contained in segment of program header entry %d\n"),
cnt, section_name (ebl, cnt), pcnt);
&& !is_debuginfo)
{
if (!gnuld)
- ERROR (gettext ("\
+ ERROR (_("\
section [%2zu] '%s' has type NOBITS but is read from the file in segment of program header entry %d\n"),
cnt, section_name (ebl, cnt), pcnt);
else
bad = ((char *) databits->d_buf)[idx] != 0;
if (bad)
- ERROR (gettext ("\
+ ERROR (_("\
section [%2zu] '%s' has type NOBITS but is read from the file in segment of program header entry %d and file contents is non-zero\n"),
cnt, section_name (ebl, cnt), pcnt);
}
const GElf_Off end = phdr->p_offset + phdr->p_filesz;
if (shdr->sh_offset > end ||
(shdr->sh_offset == end && shdr->sh_size != 0))
- ERROR (gettext ("\
+ ERROR (_("\
section [%2zu] '%s' has not type NOBITS but is not read from the file in segment of program header entry %d\n"),
cnt, section_name (ebl, cnt), pcnt);
}
{
segment_flags[pcnt] |= PF_X;
if ((phdr->p_flags & PF_X) == 0)
- ERROR (gettext ("\
+ ERROR (_("\
section [%2zu] '%s' is executable in nonexecutable segment %d\n"),
cnt, section_name (ebl, cnt), pcnt);
}
segment_flags[pcnt] |= PF_W;
if (0 /* XXX vdso images have this */
&& (phdr->p_flags & PF_W) == 0)
- ERROR (gettext ("\
+ ERROR (_("\
section [%2zu] '%s' is writable in unwritable segment %d\n"),
cnt, section_name (ebl, cnt), pcnt);
}
}
if (pcnt == phnum)
- ERROR (gettext ("\
+ ERROR (_("\
section [%2zu] '%s': alloc flag set but section not in any loaded segment\n"),
cnt, section_name (ebl, cnt));
}
if (cnt == shstrndx && shdr->sh_type != SHT_STRTAB)
- ERROR (gettext ("\
+ ERROR (_("\
section [%2zu] '%s': ELF header says this is the section header string table but type is not SHT_TYPE\n"),
cnt, section_name (ebl, cnt));
{
case SHT_DYNSYM:
if (ehdr->e_type == ET_REL)
- ERROR (gettext ("\
+ ERROR (_("\
section [%2zu] '%s': relocatable files cannot have dynamic symbol tables\n"),
cnt, section_name (ebl, cnt));
FALLTHROUGH;
that the verneed and verdef sections have already been read.
Just remember the section index. */
if (versym_scnndx != 0)
- ERROR (gettext ("more than one version symbol table present\n"));
+ ERROR (_("more than one version symbol table present\n"));
versym_scnndx = cnt;
break;
}
if (has_interp_segment && !dot_interp_section)
- ERROR (gettext ("INTERP program header entry but no .interp section\n"));
+ ERROR (_("INTERP program header entry but no .interp section\n"));
if (!is_debuginfo)
for (unsigned int pcnt = 0; pcnt < phnum; ++pcnt)
{
if ((phdr->p_flags & PF_X) != 0
&& (segment_flags[pcnt] & PF_X) == 0)
- ERROR (gettext ("\
+ ERROR (_("\
loadable segment [%u] is executable but contains no executable sections\n"),
pcnt);
if ((phdr->p_flags & PF_W) != 0
&& (segment_flags[pcnt] & PF_W) == 0)
- ERROR (gettext ("\
+ ERROR (_("\
loadable segment [%u] is writable but contains no writable sections\n"),
pcnt);
}
if (version_namelist != NULL)
{
if (versym_scnndx == 0)
- ERROR (gettext ("\
+ ERROR (_("\
no .gnu.versym section present but .gnu.versym_d or .gnu.versym_r section exist\n"));
else
check_versym (ebl, versym_scnndx);
{
if (version_namelist->ndx == runp->ndx)
{
- ERROR (gettext ("duplicate version index %d\n"),
+ ERROR (_("duplicate version index %d\n"),
(int) version_namelist->ndx);
break;
}
while (version_namelist != NULL);
}
else if (versym_scnndx != 0)
- ERROR (gettext ("\
+ ERROR (_("\
.gnu.versym section present without .gnu.versym_d or .gnu.versym_r\n"));
if (hash_idx != 0 && gnu_hash_idx != 0)
default:
if (shndx == 0)
- ERROR (gettext ("\
+ ERROR (_("\
phdr[%d]: unknown core file note type %" PRIu32 " at offset %" PRIu64 "\n"),
phndx, (uint32_t) nhdr.n_type, start + offset);
else
- ERROR (gettext ("\
+ ERROR (_("\
section [%2d] '%s': unknown core file note type %" PRIu32
" at offset %zu\n"),
shndx, section_name (ebl, shndx),
{
unknown_note:
if (shndx == 0)
- ERROR (gettext ("\
+ ERROR (_("\
phdr[%d]: unknown object file note type %" PRIu32 " with owner name '%s' at offset %zu\n"),
phndx, (uint32_t) nhdr.n_type,
(char *) data->d_buf + name_offset, offset);
else
- ERROR (gettext ("\
+ ERROR (_("\
section [%2d] '%s': unknown object file note type %" PRIu32
" with owner name '%s' at offset %zu\n"),
shndx, section_name (ebl, shndx),
{
if (ehdr->e_type != ET_CORE && ehdr->e_type != ET_REL
&& ehdr->e_type != ET_EXEC && ehdr->e_type != ET_DYN)
- ERROR (gettext ("\
+ ERROR (_("\
phdr[%d]: no note entries defined for the type of file\n"),
cnt);
notes_size = check_note_data (ebl, ehdr, data, 0, cnt, phdr->p_offset);
if (notes_size == 0)
- ERROR (gettext ("phdr[%d]: cannot get content of note section: %s\n"),
+ ERROR (_("phdr[%d]: cannot get content of note section: %s\n"),
cnt, elf_errmsg (-1));
else if (notes_size != phdr->p_filesz)
- ERROR (gettext ("phdr[%d]: extra %" PRIu64 " bytes after last note\n"),
+ ERROR (_("phdr[%d]: extra %" PRIu64 " bytes after last note\n"),
cnt, phdr->p_filesz - notes_size);
}
Elf_Data *data = elf_getdata (elf_getscn (ebl->elf, idx), NULL);
if (data == NULL || data->d_buf == NULL)
{
- ERROR (gettext ("section [%2d] '%s': cannot get section data\n"),
+ ERROR (_("section [%2d] '%s': cannot get section data\n"),
idx, section_name (ebl, idx));
return;
}
if (ehdr->e_type != ET_CORE && ehdr->e_type != ET_REL
&& ehdr->e_type != ET_EXEC && ehdr->e_type != ET_DYN)
- ERROR (gettext ("\
+ ERROR (_("\
section [%2d] '%s': no note entries defined for the type of file\n"),
idx, section_name (ebl, idx));
GElf_Off notes_size = check_note_data (ebl, ehdr, data, idx, 0, 0);
if (notes_size == 0)
- ERROR (gettext ("section [%2d] '%s': cannot get content of note section\n"),
+ ERROR (_("section [%2d] '%s': cannot get content of note section\n"),
idx, section_name (ebl, idx));
else if (notes_size != shdr->sh_size)
- ERROR (gettext ("section [%2d] '%s': extra %" PRIu64
+ ERROR (_("section [%2d] '%s': extra %" PRIu64
" bytes after last note\n"),
idx, section_name (ebl, idx), shdr->sh_size - notes_size);
}
if (ehdr->e_type != ET_EXEC && ehdr->e_type != ET_DYN
&& ehdr->e_type != ET_CORE)
- ERROR (gettext ("\
+ ERROR (_("\
only executables, shared objects, and core files can have program headers\n"));
int num_pt_interp = 0;
phdr = gelf_getphdr (ebl->elf, cnt, &phdr_mem);
if (phdr == NULL)
{
- ERROR (gettext ("cannot get program header entry %d: %s\n"),
+ ERROR (_("cannot get program header entry %d: %s\n"),
cnt, elf_errmsg (-1));
continue;
}
&& phdr->p_type != PT_GNU_STACK && phdr->p_type != PT_GNU_RELRO
/* Check for a known machine-specific type. */
&& ebl_segment_type_name (ebl, phdr->p_type, NULL, 0) == NULL)
- ERROR (gettext ("\
+ ERROR (_("\
program header entry %d: unknown program header entry type %#" PRIx64 "\n"),
cnt, (uint64_t) phdr->p_type);
if (++num_pt_interp != 1)
{
if (num_pt_interp == 2)
- ERROR (gettext ("\
+ ERROR (_("\
more than one INTERP entry in program header\n"));
}
has_interp_segment = true;
else if (phdr->p_type == PT_TLS)
{
if (++num_pt_tls == 2)
- ERROR (gettext ("more than one TLS entry in program header\n"));
+ ERROR (_("more than one TLS entry in program header\n"));
}
else if (phdr->p_type == PT_NOTE)
check_note (ebl, ehdr, phdr, cnt);
else if (phdr->p_type == PT_DYNAMIC)
{
if (ehdr->e_type == ET_EXEC && ! has_interp_segment)
- ERROR (gettext ("\
+ ERROR (_("\
static executable cannot have dynamic sections\n"));
else
{
if (shdr != NULL && shdr->sh_type == SHT_DYNAMIC)
{
if (phdr->p_offset != shdr->sh_offset)
- ERROR (gettext ("\
+ ERROR (_("\
dynamic section reference in program header has wrong offset\n"));
if (phdr->p_memsz != shdr->sh_size)
- ERROR (gettext ("\
+ ERROR (_("\
dynamic section size mismatch in program and section header\n"));
break;
}
else if (phdr->p_type == PT_GNU_RELRO)
{
if (++num_pt_relro == 2)
- ERROR (gettext ("\
+ ERROR (_("\
more than one GNU_RELRO entry in program header\n"));
else
{
<= phdr2->p_vaddr + phdr2->p_memsz))
{
if ((phdr2->p_flags & PF_W) == 0)
- ERROR (gettext ("\
+ ERROR (_("\
loadable segment GNU_RELRO applies to is not writable\n"));
/* Unless fully covered, relro flags could be a
subset of the phdrs2 flags. For example the load
{
if ((phdr2->p_flags & ~PF_W)
!= (phdr->p_flags & ~PF_W))
- ERROR (gettext ("\
+ ERROR (_("\
loadable segment [%u] flags do not match GNU_RELRO [%u] flags\n"),
cnt, inner);
}
else
{
if ((phdr->p_flags & ~phdr2->p_flags) != 0)
- ERROR (gettext ("\
+ ERROR (_("\
GNU_RELRO [%u] flags are not a subset of the loadable segment [%u] flags\n"),
inner, cnt);
}
}
if (inner >= phnum)
- ERROR (gettext ("\
+ ERROR (_("\
%s segment not contained in a loaded segment\n"), "GNU_RELRO");
}
}
}
if (inner >= phnum)
- ERROR (gettext ("\
+ ERROR (_("\
%s segment not contained in a loaded segment\n"), "PHDR");
/* Check that offset in segment corresponds to offset in ELF
header. */
if (phdr->p_offset != ehdr->e_phoff)
- ERROR (gettext ("\
+ ERROR (_("\
program header offset in ELF header and PHDR entry do not match"));
}
else if (phdr->p_type == PT_GNU_EH_FRAME)
if (! is_debuginfo)
{
if (phdr->p_offset != shdr->sh_offset)
- ERROR (gettext ("\
+ ERROR (_("\
call frame search table reference in program header has wrong offset\n"));
if (phdr->p_memsz != shdr->sh_size)
- ERROR (gettext ("\
+ ERROR (_("\
call frame search table size mismatch in program and section header\n"));
}
break;
complain. But if there is one there should be an
entry for .eh_frame_hdr. */
if (any)
- ERROR (gettext ("\
+ ERROR (_("\
PT_GNU_EH_FRAME present but no .eh_frame_hdr section\n"));
}
else
/* The section must be allocated and not be writable and
executable. */
if ((phdr->p_flags & PF_R) == 0)
- ERROR (gettext ("\
+ ERROR (_("\
call frame search table must be allocated\n"));
else if (shdr != NULL && (shdr->sh_flags & SHF_ALLOC) == 0)
- ERROR (gettext ("\
+ ERROR (_("\
section [%2zu] '%s' must be allocated\n"), elf_ndxscn (scn), ".eh_frame_hdr");
if ((phdr->p_flags & PF_W) != 0)
- ERROR (gettext ("\
+ ERROR (_("\
call frame search table must not be writable\n"));
else if (shdr != NULL && (shdr->sh_flags & SHF_WRITE) != 0)
- ERROR (gettext ("\
+ ERROR (_("\
section [%2zu] '%s' must not be writable\n"),
elf_ndxscn (scn), ".eh_frame_hdr");
if ((phdr->p_flags & PF_X) != 0)
- ERROR (gettext ("\
+ ERROR (_("\
call frame search table must not be executable\n"));
else if (shdr != NULL && (shdr->sh_flags & SHF_EXECINSTR) != 0)
- ERROR (gettext ("\
+ ERROR (_("\
section [%2zu] '%s' must not be executable\n"),
elf_ndxscn (scn), ".eh_frame_hdr");
}
if (phdr->p_filesz > phdr->p_memsz
&& (phdr->p_memsz != 0 || phdr->p_type != PT_NOTE))
- ERROR (gettext ("\
+ ERROR (_("\
program header entry %d: file size greater than memory size\n"),
cnt);
if (phdr->p_align > 1)
{
if (!powerof2 (phdr->p_align))
- ERROR (gettext ("\
+ ERROR (_("\
program header entry %d: alignment not a power of 2\n"), cnt);
else if ((phdr->p_vaddr - phdr->p_offset) % phdr->p_align != 0)
- ERROR (gettext ("\
+ ERROR (_("\
program header entry %d: file offset and virtual address not module of alignment\n"), cnt);
}
}
{
if ((ehdr->e_type == ET_EXEC || ehdr->e_type == ET_DYN)
&& pt_gnu_eh_frame_pndx == 0 && eh_frame_hdr_scnndx != 0)
- ERROR (gettext ("executable/DSO with .eh_frame_hdr section does not have "
+ ERROR (_("executable/DSO with .eh_frame_hdr section does not have "
"a PT_GNU_EH_FRAME program header entry"));
}
if (ehdr == NULL)
{
- ERROR (gettext ("cannot read ELF header: %s\n"), elf_errmsg (-1));
+ ERROR (_("cannot read ELF header: %s\n"), elf_errmsg (-1));
return;
}
/* Report if no relocation section needed the text relocation flag. */
if (textrel && !needed_textrel)
- ERROR (gettext ("text relocation flag set but not needed\n"));
+ ERROR (_("text relocation flag set but not needed\n"));
/* Free the resources. */
ebl_closebackend (ebl);
int fd = open (real_fname, O_RDONLY);
if (fd == -1)
{
- error (0, errno, gettext ("cannot open '%s'"), fname);
+ error (0, errno, _("cannot open '%s'"), fname);
return 1;
}
Elf *elf = elf_begin (fd, ELF_C_READ_MMAP, NULL);
if (elf == NULL)
{
- error (0, 0, gettext ("cannot create ELF descriptor for '%s': %s"),
+ error (0, 0, _("cannot create ELF descriptor for '%s': %s"),
fname, elf_errmsg (-1));
goto err_close;
}
GElf_Ehdr *ehdr = gelf_getehdr (elf, &ehdr_mem);
if (ehdr == NULL)
{
- error (0, 0, gettext ("cannot get ELF header '%s': %s"),
+ error (0, 0, _("cannot get ELF header '%s': %s"),
fname, elf_errmsg (-1));
err_elf_close:
elf_end (elf);
if (ehdr->e_type != ET_DYN)
{
- error (0, 0, gettext ("'%s' is not a DSO or PIE"), fname);
+ error (0, 0, _("'%s' is not a DSO or PIE"), fname);
goto err_elf_close;
}
if (shdr == NULL)
{
error (0, 0,
- gettext ("getting get section header of section %zu: %s"),
+ _("getting get section header of section %zu: %s"),
elf_ndxscn (scn), elf_errmsg (-1));
goto err_elf_close;
}
dyn = gelf_getdyn (data, cnt, &dynmem);
if (dyn == NULL)
{
- error (0, 0, gettext ("cannot read dynamic section: %s"),
+ error (0, 0, _("cannot read dynamic section: %s"),
elf_errmsg (-1));
goto err_elf_close;
}
if (!have_textrel)
{
- error (0, 0, gettext ("no text relocations reported in '%s'"), fname);
+ error (0, 0, _("no text relocations reported in '%s'"), fname);
goto err_elf_close;
}
struct segments *segments
= (struct segments *) malloc (nsegments_max * sizeof (segments[0]));
if (segments == NULL)
- error (1, errno, gettext ("while reading ELF file"));
+ error (1, errno, _("while reading ELF file"));
size_t phnum;
if (elf_getphdrnum (elf, &phnum) != 0)
- error (1, 0, gettext ("cannot get program header count: %s"),
+ error (1, 0, _("cannot get program header count: %s"),
elf_errmsg (-1));
if (phdr == NULL)
{
error (0, 0,
- gettext ("cannot get program header index at offset %zd: %s"),
+ _("cannot get program header index at offset %zd: %s"),
i, elf_errmsg (-1));
result = 1;
goto next;
* sizeof (segments[0]));
if (segments == NULL)
{
- error (0, 0, gettext ("\
+ error (0, 0, _("\
cannot get program header index at offset %zd: %s"),
i, elf_errmsg (-1));
result = 1;
if (shdr == NULL)
{
error (0, 0,
- gettext ("cannot get section header of section %zu: %s"),
+ _("cannot get section header of section %zu: %s"),
elf_ndxscn (scn), elf_errmsg (-1));
result = 1;
goto next;
symscn = elf_getscn (elf, shdr->sh_link);
if (symscn == NULL)
{
- error (0, 0, gettext ("\
+ error (0, 0, _("\
cannot get symbol table section %zu in '%s': %s"),
(size_t) shdr->sh_link, fname, elf_errmsg (-1));
result = 1;
GElf_Rel *rel = gelf_getrel (data, cnt, &rel_mem);
if (rel == NULL)
{
- error (0, 0, gettext ("\
+ error (0, 0, _("\
cannot get relocation at index %d in section %zu in '%s': %s"),
cnt, elf_ndxscn (scn), fname, elf_errmsg (-1));
result = 1;
GElf_Rela *rela = gelf_getrela (data, cnt, &rela_mem);
if (rela == NULL)
{
- error (0, 0, gettext ("\
+ error (0, 0, _("\
cannot get relocation at index %d in section %zu in '%s': %s"),
cnt, elf_ndxscn (scn), fname, elf_errmsg (-1));
result = 1;
pointer comparison. */
if (tfind (src, knownsrcs, ptrcompare) == NULL)
{
- printf (gettext ("%s not compiled with -fpic/-fPIC\n"), src);
+ printf (_("%s not compiled with -fpic/-fPIC\n"), src);
tsearch (src, knownsrcs, ptrcompare);
}
return;
/* It is this function. */
if (tfind (lowstr, knownsrcs, ptrcompare) == NULL)
{
- printf (gettext ("\
+ printf (_("\
the file containing the function '%s' is not compiled with -fpic/-fPIC\n"),
lowstr);
tsearch (lowstr, knownsrcs, ptrcompare);
}
}
else if (highidx == -1)
- printf (gettext ("\
+ printf (_("\
the file containing the function '%s' might not be compiled with -fpic/-fPIC\n"),
lowstr);
else
sym = gelf_getsym (symdata, highidx, &sym_mem);
assert (sym != NULL);
- printf (gettext ("\
+ printf (_("\
either the file containing the function '%s' or the file containing the function '%s' is not compiled with -fpic/-fPIC\n"),
lowstr, elf_strptr (elf, shdr->sh_link,
sym->st_name));
sym = gelf_getsym (symdata, highidx, &sym_mem);
assert (sym != NULL);
- printf (gettext ("\
+ printf (_("\
the file containing the function '%s' might not be compiled with -fpic/-fPIC\n"),
elf_strptr (elf, shdr->sh_link, sym->st_name));
return;
}
}
- printf (gettext ("\
+ printf (_("\
a relocation modifies memory at offset %llu in a write-protected segment\n"),
(unsigned long long int) addr);
break;
#define INTERNAL_ERROR(fname) \
- error (EXIT_FAILURE, 0, gettext ("%s: INTERNAL ERROR %d (%s): %s"), \
+ error (EXIT_FAILURE, 0, _("%s: INTERNAL ERROR %d (%s): %s"), \
fname, __LINE__, PACKAGE_VERSION, elf_errmsg (-1))
int fd = open (fname, O_RDONLY);
if (fd == -1)
{
- error (0, errno, gettext ("cannot open '%s'"), fname);
+ error (0, errno, _("cannot open '%s'"), fname);
return 1;
}
INTERNAL_ERROR (fname);
if (close (fd) != 0)
- error (EXIT_FAILURE, errno, gettext ("while closing '%s'"), fname);
+ error (EXIT_FAILURE, errno, _("while closing '%s'"), fname);
return result;
}
INTERNAL_ERROR (fname);
if (close (fd) != 0)
- error (EXIT_FAILURE, errno, gettext ("while closing '%s'"), fname);
+ error (EXIT_FAILURE, errno, _("while closing '%s'"), fname);
return result;
}
INTERNAL_ERROR (fname);
}
- error (0, 0, gettext ("%s: File format not recognized"), fname);
+ error (0, 0, _("%s: File format not recognized"), fname);
return 1;
}
Elf_Arhdr *arhdr = NULL;
size_t arhdr_off = 0; /* Note: 0 is no valid offset. */
- fputs_unlocked (gettext("\nArchive index:\n"), stdout);
+ fputs_unlocked (_("\nArchive index:\n"), stdout);
while (arsym->as_off != 0)
{
|| (subelf = elf_begin (fd, cmd, elf)) == NULL
|| (arhdr = elf_getarhdr (subelf)) == NULL))
{
- error (0, 0, gettext ("invalid offset %zu for symbol %s"),
+ error (0, 0, _("invalid offset %zu for symbol %s"),
arsym->as_off, arsym->as_name);
break;
}
- printf (gettext ("%s in %s\n"), arsym->as_name, arhdr->ar_name);
+ printf (_("%s in %s\n"), arsym->as_name, arhdr->ar_name);
++arsym;
}
if (elf_rand (elf, SARMAG) != SARMAG)
{
error (0, 0,
- gettext ("cannot reset archive offset to beginning"));
+ _("cannot reset archive offset to beginning"));
return 1;
}
}
new_suffix);
else
{
- error (0, 0, gettext ("%s%s%s: file format not recognized"),
+ error (0, 0, _("%s%s%s: file format not recognized"),
new_prefix, arhdr->ar_name, new_suffix);
result = 1;
}
local_compare);
if (tres == NULL)
error (EXIT_FAILURE, errno,
- gettext ("cannot create search tree"));
+ _("cannot create search tree"));
else if (*tres != newp)
free (newp);
}
size_t shstrndx;
if (elf_getshdrstrndx (ebl->elf, &shstrndx) < 0)
error (EXIT_FAILURE, 0,
- gettext ("cannot get section header string table index"));
+ _("cannot get section header string table index"));
/* Cache the section names. */
Elf_Scn *scn = NULL;
int digits = length_map[gelf_getclass (ebl->elf) - 1][radix];
/* We always print this prolog. */
- printf (gettext ("\n\nSymbols from %s:\n\n"), fullname);
+ printf (_("\n\nSymbols from %s:\n\n"), fullname);
/* The header line. */
- printf (gettext ("%*s%-*s %-*s Class Type %-*s %*s Section\n\n"),
+ printf (_("%*s%-*s %-*s Class Type %-*s %*s Section\n\n"),
print_file_name ? (int) strlen (fullname) + 1: 0, "",
longest_name, sgettext ("sysv|Name"),
/* TRANS: the "sysv|" parts makes the string unique. */
size_t shstrndx;
if (elf_getshdrstrndx (ebl->elf, &shstrndx) < 0)
error (EXIT_FAILURE, 0,
- gettext ("cannot get section header string table index"));
+ _("cannot get section header string table index"));
/* The section is that large. */
size_t size = shdr->sh_size;
if (entsize == 0
|| entsize != gelf_fsize (ebl->elf, ELF_T_SYM, 1, EV_CURRENT))
error (0, 0,
- gettext ("%s: entry size in section %zd `%s' is not what we expect"),
+ _("%s: entry size in section %zd `%s' is not what we expect"),
fullname, elf_ndxscn (scn),
elf_strptr (ebl->elf, shstrndx, shdr->sh_name));
else if (size % entsize != 0)
error (0, 0,
- gettext ("%s: size of section %zd `%s' is not multiple of entry size"),
+ _("%s: size of section %zd `%s' is not multiple of entry size"),
fullname, elf_ndxscn (scn),
elf_strptr (ebl->elf, shstrndx, shdr->sh_name));
is a 64 bit file. */
if (nentries > SIZE_MAX / sizeof (GElf_SymX))
error (EXIT_FAILURE, 0,
- gettext ("%s: entries (%zd) in section %zd `%s' is too large"),
+ _("%s: entries (%zd) in section %zd `%s' is too large"),
fullname, nentries, elf_ndxscn (scn),
elf_strptr (ebl->elf, shstrndx, shdr->sh_name));
GElf_SymX *sym_mem;
&& ehdr->e_type != ET_EXEC && ehdr->e_type != ET_DYN)
{
/* XXX Add machine specific object file types. */
- error (0, 0, gettext ("%s%s%s%s: Invalid operation"),
+ error (0, 0, _("%s%s%s%s: Invalid operation"),
prefix ?: "", prefix ? "(" : "", fname, prefix ? ")" : "");
result = 1;
goto out;
if (! any)
{
- error (0, 0, gettext ("%s%s%s: no symbols"),
+ error (0, 0, _("%s%s%s: no symbols"),
prefix ?: "", prefix ? ":" : "", fname);
result = 1;
}
#define INTERNAL_ERROR(fname) \
- error (EXIT_FAILURE, 0, gettext ("%s: INTERNAL ERROR %d (%s): %s"), \
+ error (EXIT_FAILURE, 0, _("%s: INTERNAL ERROR %d (%s): %s"), \
fname, __LINE__, PACKAGE_VERSION, elf_errmsg (-1))
case ARGP_KEY_FINI:
if (! any_control_option)
{
- fputs (gettext ("No operation specified.\n"), stderr);
+ fputs (_("No operation specified.\n"), stderr);
argp_help (&argp, stderr, ARGP_HELP_SEE,
program_invocation_short_name);
exit (EXIT_FAILURE);
int fd = open (fname, O_RDONLY);
if (fd == -1)
{
- error (0, errno, gettext ("cannot open %s"), fname);
+ error (0, errno, _("cannot open %s"), fname);
return 1;
}
INTERNAL_ERROR (fname);
if (close (fd) != 0)
- error (EXIT_FAILURE, errno, gettext ("while close `%s'"), fname);
+ error (EXIT_FAILURE, errno, _("while close `%s'"), fname);
return result;
}
INTERNAL_ERROR (fname);
if (close (fd) != 0)
- error (EXIT_FAILURE, errno, gettext ("while close `%s'"), fname);
+ error (EXIT_FAILURE, errno, _("while close `%s'"), fname);
return result;
}
INTERNAL_ERROR (fname);
}
- error (0, 0, gettext ("%s: File format not recognized"), fname);
+ error (0, 0, _("%s: File format not recognized"), fname);
return 1;
}
new_suffix);
else
{
- error (0, 0, gettext ("%s%s%s: file format not recognized"),
+ error (0, 0, _("%s%s%s: file format not recognized"),
new_prefix, arhdr->ar_name, new_suffix);
result = 1;
}
if (sym == NULL)
printf ("<%s %ld>",
- gettext ("INVALID SYMBOL"), (long int) GELF_R_SYM (r_info));
+ _("INVALID SYMBOL"), (long int) GELF_R_SYM (r_info));
else if (GELF_ST_TYPE (sym->st_info) != STT_SECTION)
printf ("%s",
elf_strptr (ebl->elf, symstrndx, sym->st_name));
if (shdr == NULL || destshdr == NULL)
printf ("<%s %ld>",
- gettext ("INVALID SECTION"),
+ _("INVALID SECTION"),
(long int) (sym->st_shndx == SHN_XINDEX
? xndx : sym->st_shndx));
else
if (unlikely (destshdr == NULL))
continue;
- printf (gettext ("\nRELOCATION RECORDS FOR [%s]:\n"
+ printf (_("\nRELOCATION RECORDS FOR [%s]:\n"
"%-*s TYPE VALUE\n"),
elf_strptr (ebl->elf, shstrndx, destshdr->sh_name),
- elfclass == ELFCLASS32 ? 8 : 16, gettext ("OFFSET"));
+ elfclass == ELFCLASS32 ? 8 : 16, _("OFFSET"));
/* Get the data of the section. */
Elf_Data *data = elf_getdata (scn, NULL);
if (! section_match (ebl->elf, elf_ndxscn (scn), shdr, shstrndx))
continue;
- printf (gettext ("Contents of section %s:\n"),
+ printf (_("Contents of section %s:\n"),
elf_strptr (ebl->elf, shstrndx, shdr->sh_name));
/* Get the data of the section. */
{
DisasmCtx_t *ctx = disasm_begin (ebl, ebl->elf, NULL /* XXX TODO */);
if (ctx == NULL)
- error (EXIT_FAILURE, 0, gettext ("cannot disassemble"));
+ error (EXIT_FAILURE, 0, _("cannot disassemble"));
Elf_Scn *scn = NULL;
while ((scn = elf_nextscn (ebl->elf, scn)) != NULL)
size_t shstrndx;
if (elf_getshdrstrndx (ebl->elf, &shstrndx) < 0)
error (EXIT_FAILURE, 0,
- gettext ("cannot get section header string table index"));
+ _("cannot get section header string table index"));
int result = 0;
if (print_disasm)
/* There must at least be one more parameter specifying the archive. */
if (remaining == argc)
{
- error (0, 0, gettext ("Archive name required"));
+ error (0, 0, _("Archive name required"));
argp_help (&argp, stderr, ARGP_HELP_SEE, "ranlib");
exit (EXIT_FAILURE);
}
int fd = open (fname, O_RDONLY);
if (fd == -1)
{
- error (0, errno, gettext ("cannot open '%s'"), fname);
+ error (0, errno, _("cannot open '%s'"), fname);
return 1;
}
struct stat st;
if (fstat (fd, &st) != 0)
{
- error (0, errno, gettext ("cannot stat '%s'"), fname);
+ error (0, errno, _("cannot stat '%s'"), fname);
close (fd);
return 1;
}
Elf *arelf = elf_begin (fd, ELF_C_READ_MMAP, NULL);
if (arelf == NULL)
{
- error (0, 0, gettext ("cannot create ELF descriptor for '%s': %s"),
+ error (0, 0, _("cannot create ELF descriptor for '%s': %s"),
fname, elf_errmsg (-1));
close (fd);
return 1;
if (elf_kind (arelf) != ELF_K_AR)
{
- error (0, 0, gettext ("'%s' is no archive"), fname);
+ error (0, 0, _("'%s' is no archive"), fname);
elf_end (arelf);
close (fd);
return 1;
/* Get next archive element. */
cmd = elf_next (elf);
if (elf_end (elf) != 0)
- error (0, 0, gettext ("error while freeing sub-ELF descriptor: %s"),
+ error (0, 0, _("error while freeing sub-ELF descriptor: %s"),
elf_errmsg (-1));
}
if (unlikely (newfd == -1))
{
nonew:
- error (0, errno, gettext ("cannot create new file"));
+ error (0, errno, _("cannot create new file"));
status = 1;
}
else
textdomain (PACKAGE_TARNAME);
/* Look up once. */
- yes_str = gettext ("yes");
- no_str = gettext ("no");
+ yes_str = _("yes");
+ no_str = _("no");
/* Parse and process arguments. */
int remaining;
print_debug_sections |= section_gdb_index;
else
{
- fprintf (stderr, gettext ("Unknown DWARF debug section `%s'.\n"),
+ fprintf (stderr, _("Unknown DWARF debug section `%s'.\n"),
arg);
argp_help (&argp, stderr, ARGP_HELP_SEE,
program_invocation_short_name);
print_unresolved_addresses = true;
break;
case ARGP_KEY_NO_ARGS:
- fputs (gettext ("Missing file name.\n"), stderr);
+ fputs (_("Missing file name.\n"), stderr);
goto do_argp_help;
case ARGP_KEY_FINI:
if (! any_control_option && ! print_archive_index)
{
- fputs (gettext ("No operation specified.\n"), stderr);
+ fputs (_("No operation specified.\n"), stderr);
do_argp_help:
argp_help (&argp, stderr, ARGP_HELP_SEE,
program_invocation_short_name);
Elf *elf = elf_begin (fd, ELF_C_READ_MMAP, NULL);
if (elf == NULL)
{
- error (0, 0, gettext ("cannot generate Elf descriptor: %s"),
+ error (0, 0, _("cannot generate Elf descriptor: %s"),
elf_errmsg (-1));
return -1;
}
if (elf_getshdrnum (elf, &shnums) < 0)
{
- error (0, 0, gettext ("cannot determine number of sections: %s"),
+ error (0, 0, _("cannot determine number of sections: %s"),
elf_errmsg (-1));
open_error:
elf_end (elf);
if (elf_getshdrstrndx (elf, &shstrndx) < 0)
{
- error (0, 0, gettext ("cannot get section header string table index"));
+ error (0, 0, _("cannot get section header string table index"));
goto open_error;
}
Elf_Scn *scn = elf_getscn (elf, cnt);
if (scn == NULL)
{
- error (0, 0, gettext ("cannot get section: %s"),
+ error (0, 0, _("cannot get section: %s"),
elf_errmsg (-1));
goto open_error;
}
GElf_Shdr *shdr = gelf_getshdr (scn, &shdr_mem);
if (unlikely (shdr == NULL))
{
- error (0, 0, gettext ("cannot get section header: %s"),
+ error (0, 0, _("cannot get section header: %s"),
elf_errmsg (-1));
goto open_error;
}
const char *sname = elf_strptr (elf, shstrndx, shdr->sh_name);
if (sname == NULL)
{
- error (0, 0, gettext ("cannot get section name"));
+ error (0, 0, _("cannot get section name"));
goto open_error;
}
Elf_Data *data = elf_rawdata (scn, NULL);
if (data == NULL)
{
- error (0, 0, gettext ("cannot get %s content: %s"),
+ error (0, 0, _("cannot get %s content: %s"),
sname, elf_errmsg (-1));
goto open_error;
}
int sfd = mkstemp (tempname);
if (sfd == -1)
{
- error (0, 0, gettext ("cannot create temp file '%s'"),
+ error (0, 0, _("cannot create temp file '%s'"),
tempname);
goto open_error;
}
ssize_t size = data->d_size;
if (write_retry (sfd, data->d_buf, size) != size)
{
- error (0, 0, gettext ("cannot write section data"));
+ error (0, 0, _("cannot write section data"));
goto open_error;
}
if (elf_end (elf) != 0)
{
- error (0, 0, gettext ("error while closing Elf descriptor: %s"),
+ error (0, 0, _("error while closing Elf descriptor: %s"),
elf_errmsg (-1));
return -1;
}
if (lseek (sfd, 0, SEEK_SET) == -1)
{
- error (0, 0, gettext ("error while rewinding file descriptor"));
+ error (0, 0, _("error while rewinding file descriptor"));
return -1;
}
/* Named section not found. */
if (elf_end (elf) != 0)
- error (0, 0, gettext ("error while closing Elf descriptor: %s"),
+ error (0, 0, _("error while closing Elf descriptor: %s"),
elf_errmsg (-1));
return -1;
}
/* Create an `Elf' descriptor. */
Elf *elf = elf_begin (fd, ELF_C_READ_MMAP, NULL);
if (elf == NULL)
- error (0, 0, gettext ("cannot generate Elf descriptor: %s"),
+ error (0, 0, _("cannot generate Elf descriptor: %s"),
elf_errmsg (-1));
else
{
}
else
error (0, 0,
- gettext ("'%s' is not an archive, cannot print archive index"),
+ _("'%s' is not an archive, cannot print archive index"),
fname);
/* Now we can close the descriptor. */
if (elf_end (elf) != 0)
- error (0, 0, gettext ("error while closing Elf descriptor: %s"),
+ error (0, 0, _("error while closing Elf descriptor: %s"),
elf_errmsg (-1));
}
}
{
struct stat st;
if (fstat (dwfl_fd, &st) != 0)
- error (0, errno, gettext ("cannot stat input file"));
+ error (0, errno, _("cannot stat input file"));
else if (unlikely (st.st_size == 0))
- error (0, 0, gettext ("input file is empty"));
+ error (0, 0, _("input file is empty"));
else
- error (0, 0, gettext ("failed reading '%s': %s"),
+ error (0, 0, _("failed reading '%s': %s"),
fname, dwfl_errmsg (-1));
close (dwfl_fd); /* Consumed on success, not on failure. */
dwfl = NULL;
fd = open_input_section (fd);
if (fd == -1)
{
- error (0, 0, gettext ("No such section '%s' in '%s'"),
+ error (0, 0, _("No such section '%s' in '%s'"),
elf_input_section, fname);
return;
}
if (ehdr == NULL)
{
- error (0, 0, gettext ("cannot read ELF header: %s"), elf_errmsg (-1));
+ error (0, 0, _("cannot read ELF header: %s"), elf_errmsg (-1));
return;
}
if (unlikely (ebl == NULL))
{
ebl_error:
- error (0, errno, gettext ("cannot create EBL handle"));
+ error (0, errno, _("cannot create EBL handle"));
return;
}
/* Determine the number of sections. */
if (unlikely (elf_getshdrnum (ebl->elf, &shnum) < 0))
error (EXIT_FAILURE, 0,
- gettext ("cannot determine number of sections: %s"),
+ _("cannot determine number of sections: %s"),
elf_errmsg (-1));
/* Determine the number of phdrs. */
if (unlikely (elf_getphdrnum (ebl->elf, &phnum) < 0))
error (EXIT_FAILURE, 0,
- gettext ("cannot determine number of program headers: %s"),
+ _("cannot determine number of program headers: %s"),
elf_errmsg (-1));
/* For an ET_REL file, libdwfl has adjusted the in-core shdrs and
}
if (pure_elf == NULL)
{
- error (0, 0, gettext ("cannot read ELF: %s"), elf_errmsg (-1));
+ error (0, 0, _("cannot read ELF: %s"), elf_errmsg (-1));
return;
}
pure_ebl = ebl_openbackend (pure_elf);
N_("DYN (Shared object file)"),
N_("CORE (Core file)")
};
- puts (gettext (knowntypes[e_type]));
+ puts (_(knowntypes[e_type]));
}
else if (e_type >= ET_LOOS && e_type <= ET_HIOS)
- printf (gettext ("OS Specific: (%x)\n"), e_type);
+ printf (_("OS Specific: (%x)\n"), e_type);
else if (e_type >= ET_LOPROC /* && e_type <= ET_HIPROC always true */)
- printf (gettext ("Processor Specific: (%x)\n"), e_type);
+ printf (_("Processor Specific: (%x)\n"), e_type);
else
puts ("???");
}
static void
print_ehdr (Ebl *ebl, GElf_Ehdr *ehdr)
{
- fputs_unlocked (gettext ("ELF Header:\n Magic: "), stdout);
+ fputs_unlocked (_("ELF Header:\n Magic: "), stdout);
for (size_t cnt = 0; cnt < EI_NIDENT; ++cnt)
printf (" %02hhx", ehdr->e_ident[cnt]);
- printf (gettext ("\n Class: %s\n"),
+ printf (_("\n Class: %s\n"),
ehdr->e_ident[EI_CLASS] == ELFCLASS32 ? "ELF32"
: ehdr->e_ident[EI_CLASS] == ELFCLASS64 ? "ELF64"
: "\?\?\?");
- printf (gettext (" Data: %s\n"),
+ printf (_(" Data: %s\n"),
ehdr->e_ident[EI_DATA] == ELFDATA2LSB
? "2's complement, little endian"
: ehdr->e_ident[EI_DATA] == ELFDATA2MSB
? "2's complement, big endian" : "\?\?\?");
- printf (gettext (" Ident Version: %hhd %s\n"),
+ printf (_(" Ident Version: %hhd %s\n"),
ehdr->e_ident[EI_VERSION],
- ehdr->e_ident[EI_VERSION] == EV_CURRENT ? gettext ("(current)")
+ ehdr->e_ident[EI_VERSION] == EV_CURRENT ? _("(current)")
: "(\?\?\?)");
char buf[512];
- printf (gettext (" OS/ABI: %s\n"),
+ printf (_(" OS/ABI: %s\n"),
ebl_osabi_name (ebl, ehdr->e_ident[EI_OSABI], buf, sizeof (buf)));
- printf (gettext (" ABI Version: %hhd\n"),
+ printf (_(" ABI Version: %hhd\n"),
ehdr->e_ident[EI_ABIVERSION]);
- fputs_unlocked (gettext (" Type: "), stdout);
+ fputs_unlocked (_(" Type: "), stdout);
print_file_type (ehdr->e_type);
const char *machine = dwelf_elf_e_machine_string (ehdr->e_machine);
if (machine != NULL)
- printf (gettext (" Machine: %s\n"), machine);
+ printf (_(" Machine: %s\n"), machine);
else
- printf (gettext (" Machine: <unknown>: 0x%x\n"),
+ printf (_(" Machine: <unknown>: 0x%x\n"),
ehdr->e_machine);
- printf (gettext (" Version: %d %s\n"),
+ printf (_(" Version: %d %s\n"),
ehdr->e_version,
- ehdr->e_version == EV_CURRENT ? gettext ("(current)") : "(\?\?\?)");
+ ehdr->e_version == EV_CURRENT ? _("(current)") : "(\?\?\?)");
- printf (gettext (" Entry point address: %#" PRIx64 "\n"),
+ printf (_(" Entry point address: %#" PRIx64 "\n"),
ehdr->e_entry);
- printf (gettext (" Start of program headers: %" PRId64 " %s\n"),
- ehdr->e_phoff, gettext ("(bytes into file)"));
+ printf (_(" Start of program headers: %" PRId64 " %s\n"),
+ ehdr->e_phoff, _("(bytes into file)"));
- printf (gettext (" Start of section headers: %" PRId64 " %s\n"),
- ehdr->e_shoff, gettext ("(bytes into file)"));
+ printf (_(" Start of section headers: %" PRId64 " %s\n"),
+ ehdr->e_shoff, _("(bytes into file)"));
- printf (gettext (" Flags: %s\n"),
+ printf (_(" Flags: %s\n"),
ebl_machine_flag_name (ebl, ehdr->e_flags, buf, sizeof (buf)));
- printf (gettext (" Size of this header: %" PRId16 " %s\n"),
- ehdr->e_ehsize, gettext ("(bytes)"));
+ printf (_(" Size of this header: %" PRId16 " %s\n"),
+ ehdr->e_ehsize, _("(bytes)"));
- printf (gettext (" Size of program header entries: %" PRId16 " %s\n"),
- ehdr->e_phentsize, gettext ("(bytes)"));
+ printf (_(" Size of program header entries: %" PRId16 " %s\n"),
+ ehdr->e_phentsize, _("(bytes)"));
- printf (gettext (" Number of program headers entries: %" PRId16),
+ printf (_(" Number of program headers entries: %" PRId16),
ehdr->e_phnum);
if (ehdr->e_phnum == PN_XNUM)
{
GElf_Shdr shdr_mem;
GElf_Shdr *shdr = gelf_getshdr (elf_getscn (ebl->elf, 0), &shdr_mem);
if (shdr != NULL)
- printf (gettext (" (%" PRIu32 " in [0].sh_info)"),
+ printf (_(" (%" PRIu32 " in [0].sh_info)"),
(uint32_t) shdr->sh_info);
else
- fputs_unlocked (gettext (" ([0] not available)"), stdout);
+ fputs_unlocked (_(" ([0] not available)"), stdout);
}
fputc_unlocked ('\n', stdout);
- printf (gettext (" Size of section header entries: %" PRId16 " %s\n"),
- ehdr->e_shentsize, gettext ("(bytes)"));
+ printf (_(" Size of section header entries: %" PRId16 " %s\n"),
+ ehdr->e_shentsize, _("(bytes)"));
- printf (gettext (" Number of section headers entries: %" PRId16),
+ printf (_(" Number of section headers entries: %" PRId16),
ehdr->e_shnum);
if (ehdr->e_shnum == 0)
{
GElf_Shdr shdr_mem;
GElf_Shdr *shdr = gelf_getshdr (elf_getscn (ebl->elf, 0), &shdr_mem);
if (shdr != NULL)
- printf (gettext (" (%" PRIu32 " in [0].sh_size)"),
+ printf (_(" (%" PRIu32 " in [0].sh_size)"),
(uint32_t) shdr->sh_size);
else
- fputs_unlocked (gettext (" ([0] not available)"), stdout);
+ fputs_unlocked (_(" ([0] not available)"), stdout);
}
fputc_unlocked ('\n', stdout);
GElf_Shdr *shdr = gelf_getshdr (elf_getscn (ebl->elf, 0), &shdr_mem);
if (shdr != NULL)
/* We managed to get the zeroth section. */
- snprintf (buf, sizeof (buf), gettext (" (%" PRIu32 " in [0].sh_link)"),
+ snprintf (buf, sizeof (buf), _(" (%" PRIu32 " in [0].sh_link)"),
(uint32_t) shdr->sh_link);
else
{
- strncpy (buf, gettext (" ([0] not available)"), sizeof (buf));
+ strncpy (buf, _(" ([0] not available)"), sizeof (buf));
buf[sizeof (buf) - 1] = '\0';
}
- printf (gettext (" Section header string table index: XINDEX%s\n\n"),
+ printf (_(" Section header string table index: XINDEX%s\n\n"),
buf);
}
else
- printf (gettext (" Section header string table index: %" PRId16 "\n\n"),
+ printf (_(" Section header string table index: %" PRId16 "\n\n"),
ehdr->e_shstrndx);
}
size_t sections;
if (unlikely (elf_getshdrnum (ebl->elf, §ions) < 0))
error (EXIT_FAILURE, 0,
- gettext ("cannot get number of sections: %s"),
+ _("cannot get number of sections: %s"),
elf_errmsg (-1));
- printf (gettext ("\
+ printf (_("\
There are %zd section headers, starting at offset %#" PRIx64 ":\n\
\n"),
sections, ehdr->e_shoff);
/* Get the section header string table index. */
if (unlikely (elf_getshdrstrndx (ebl->elf, &shstrndx) < 0))
error (EXIT_FAILURE, 0,
- gettext ("cannot get section header string table index: %s"),
+ _("cannot get section header string table index: %s"),
elf_errmsg (-1));
- puts (gettext ("Section Headers:"));
+ puts (_("Section Headers:"));
if (ehdr->e_ident[EI_CLASS] == ELFCLASS32)
- puts (gettext ("[Nr] Name Type Addr Off Size ES Flags Lk Inf Al"));
+ puts (_("[Nr] Name Type Addr Off Size ES Flags Lk Inf Al"));
else
- puts (gettext ("[Nr] Name Type Addr Off Size ES Flags Lk Inf Al"));
+ puts (_("[Nr] Name Type Addr Off Size ES Flags Lk Inf Al"));
if (print_decompress)
{
if (ehdr->e_ident[EI_CLASS] == ELFCLASS32)
- puts (gettext (" [Compression Size Al]"));
+ puts (_(" [Compression Size Al]"));
else
- puts (gettext (" [Compression Size Al]"));
+ puts (_(" [Compression Size Al]"));
}
for (cnt = 0; cnt < shnum; ++cnt)
Elf_Scn *scn = elf_getscn (ebl->elf, cnt);
if (unlikely (scn == NULL))
- error (EXIT_FAILURE, 0, gettext ("cannot get section: %s"),
+ error (EXIT_FAILURE, 0, _("cannot get section: %s"),
elf_errmsg (-1));
/* Get the section header. */
GElf_Shdr shdr_mem;
GElf_Shdr *shdr = gelf_getshdr (scn, &shdr_mem);
if (unlikely (shdr == NULL))
- error (EXIT_FAILURE, 0, gettext ("cannot get section header: %s"),
+ error (EXIT_FAILURE, 0, _("cannot get section header: %s"),
elf_errmsg (-1));
char flagbuf[20];
chdr.ch_size, chdr.ch_addralign);
else
error (0, 0,
- gettext ("bad compression header for section %zd: %s"),
+ _("bad compression header for section %zd: %s"),
elf_ndxscn (scn), elf_errmsg (-1));
}
else if (strncmp(".zdebug", sname, strlen (".zdebug")) == 0)
ehdr->e_ident[EI_CLASS] == ELFCLASS32 ? 6 : 8, size);
else
error (0, 0,
- gettext ("bad gnu compressed size for section %zd: %s"),
+ _("bad gnu compressed size for section %zd: %s"),
elf_ndxscn (scn), elf_errmsg (-1));
}
}
/* No program header, this is OK in relocatable objects. */
return;
- puts (gettext ("Program Headers:"));
+ puts (_("Program Headers:"));
if (ehdr->e_ident[EI_CLASS] == ELFCLASS32)
- puts (gettext ("\
+ puts (_("\
Type Offset VirtAddr PhysAddr FileSiz MemSiz Flg Align"));
else
- puts (gettext ("\
+ puts (_("\
Type Offset VirtAddr PhysAddr FileSiz MemSiz Flg Align"));
/* Process all program headers. */
&& phdr->p_filesz <= maxsize - phdr->p_offset
&& memchr (filedata + phdr->p_offset, '\0',
phdr->p_filesz) != NULL)
- printf (gettext ("\t[Requesting program interpreter: %s]\n"),
+ printf (_("\t[Requesting program interpreter: %s]\n"),
filedata + phdr->p_offset);
}
else if (phdr->p_type == PT_GNU_RELRO)
size_t sections;
if (unlikely (elf_getshdrnum (ebl->elf, §ions) < 0))
error (EXIT_FAILURE, 0,
- gettext ("cannot get number of sections: %s"),
+ _("cannot get number of sections: %s"),
elf_errmsg (-1));
if (sections == 0)
size_t shstrndx;
if (unlikely (elf_getshdrstrndx (ebl->elf, &shstrndx) < 0))
error (EXIT_FAILURE, 0,
- gettext ("cannot get section header string table index"));
+ _("cannot get section header string table index"));
- puts (gettext ("\n Section to Segment mapping:\n Segment Sections..."));
+ puts (_("\n Section to Segment mapping:\n Segment Sections..."));
for (size_t cnt = 0; cnt < phnum; ++cnt)
{
GElf_Phdr *phdr = gelf_getphdr (ebl->elf, cnt, &phdr_mem);
/* This must not happen. */
if (unlikely (phdr == NULL))
- error (EXIT_FAILURE, 0, gettext ("cannot get program header: %s"),
+ error (EXIT_FAILURE, 0, _("cannot get program header: %s"),
elf_errmsg (-1));
/* Iterate over the sections. */
Elf_Scn *scn = elf_getscn (ebl->elf, inner);
/* This should not happen. */
if (unlikely (scn == NULL))
- error (EXIT_FAILURE, 0, gettext ("cannot get section: %s"),
+ error (EXIT_FAILURE, 0, _("cannot get section: %s"),
elf_errmsg (-1));
/* Get the section header. */
GElf_Shdr *shdr = gelf_getshdr (scn, &shdr_mem);
if (unlikely (shdr == NULL))
error (EXIT_FAILURE, 0,
- gettext ("cannot get section header: %s"),
+ _("cannot get section header: %s"),
elf_errmsg (-1));
if (shdr->sh_size > 0
size_t shstrndx;
if (unlikely (elf_getshdrstrndx (ebl->elf, &shstrndx) < 0))
error (EXIT_FAILURE, 0,
- gettext ("cannot get section header string table index"));
+ _("cannot get section header string table index"));
Elf32_Word *grpref = (Elf32_Word *) data->d_buf;
elf_strptr (ebl->elf, shstrndx, shdr->sh_name),
(sym == NULL ? NULL
: elf_strptr (ebl->elf, symshdr->sh_link, sym->st_name))
- ?: gettext ("<INVALID SYMBOL>"),
+ ?: _("<INVALID SYMBOL>"),
data->d_size / sizeof (Elf32_Word) - 1);
for (size_t cnt = 1; cnt < data->d_size / sizeof (Elf32_Word); ++cnt)
grpref[cnt],
grpshdr != NULL
&& (str = elf_strptr (ebl->elf, shstrndx, grpshdr->sh_name))
- ? str : gettext ("<INVALID SECTION>"));
+ ? str : _("<INVALID SECTION>"));
}
}
{
if (elf_compress (scn, 0, 0) < 0)
printf ("WARNING: %s [%zd]\n",
- gettext ("Couldn't uncompress section"),
+ _("Couldn't uncompress section"),
elf_ndxscn (scn));
shdr = gelf_getshdr (scn, &shdr_mem);
if (unlikely (shdr == NULL))
error (EXIT_FAILURE, 0,
- gettext ("cannot get section [%zd] header: %s"),
+ _("cannot get section [%zd] header: %s"),
elf_ndxscn (scn),
elf_errmsg (-1));
}
/* Get the section header string table index. */
if (unlikely (elf_getshdrstrndx (ebl->elf, &shstrndx) < 0))
error (EXIT_FAILURE, 0,
- gettext ("cannot get section header string table index"));
+ _("cannot get section header string table index"));
sh_entsize = gelf_fsize (ebl->elf, ELF_T_DYN, 1, EV_CURRENT);
glink = gelf_getshdr (elf_getscn (ebl->elf, shdr->sh_link), &glink_mem);
if (glink == NULL)
- error (EXIT_FAILURE, 0, gettext ("invalid sh_link value in section %zu"),
+ error (EXIT_FAILURE, 0, _("invalid sh_link value in section %zu"),
elf_ndxscn (scn));
printf (ngettext ("\
shdr->sh_offset,
(int) shdr->sh_link,
elf_strptr (ebl->elf, shstrndx, glink->sh_name));
- fputs_unlocked (gettext (" Type Value\n"), stdout);
+ fputs_unlocked (_(" Type Value\n"), stdout);
for (cnt = 0; cnt < shdr->sh_size / sh_entsize; ++cnt)
{
break;
case DT_NEEDED:
- printf (gettext ("Shared library: [%s]\n"),
+ printf (_("Shared library: [%s]\n"),
elf_strptr (ebl->elf, shdr->sh_link, dyn->d_un.d_val));
break;
case DT_SONAME:
- printf (gettext ("Library soname: [%s]\n"),
+ printf (_("Library soname: [%s]\n"),
elf_strptr (ebl->elf, shdr->sh_link, dyn->d_un.d_val));
break;
case DT_RPATH:
- printf (gettext ("Library rpath: [%s]\n"),
+ printf (_("Library rpath: [%s]\n"),
elf_strptr (ebl->elf, shdr->sh_link, dyn->d_un.d_val));
break;
case DT_RUNPATH:
- printf (gettext ("Library runpath: [%s]\n"),
+ printf (_("Library runpath: [%s]\n"),
elf_strptr (ebl->elf, shdr->sh_link, dyn->d_un.d_val));
break;
case DT_SYMINENT:
case DT_GNU_CONFLICTSZ:
case DT_GNU_LIBLISTSZ:
- printf (gettext ("%" PRId64 " (bytes)\n"), dyn->d_un.d_val);
+ printf (_("%" PRId64 " (bytes)\n"), dyn->d_un.d_val);
break;
case DT_VERDEFNUM:
if (unlikely (symshdr == NULL || symdata == NULL || destshdr == NULL))
{
- printf (gettext ("\nInvalid symbol table at offset %#0" PRIx64 "\n"),
+ printf (_("\nInvalid symbol table at offset %#0" PRIx64 "\n"),
shdr->sh_offset);
return;
}
size_t shstrndx;
if (unlikely (elf_getshdrstrndx (ebl->elf, &shstrndx) < 0))
error (EXIT_FAILURE, 0,
- gettext ("cannot get section header string table index"));
+ _("cannot get section header string table index"));
if (shdr->sh_info != 0)
printf (ngettext ("\
shdr->sh_offset,
nentries);
fputs_unlocked (class == ELFCLASS32
- ? gettext ("\
+ ? _("\
Offset Type Value Name\n")
- : gettext ("\
+ : _("\
Offset Type Value Name\n"),
stdout);
information. */
? ebl_reloc_type_name (ebl, GELF_R_TYPE (rel->r_info),
buf, sizeof (buf)) + 2
- : gettext ("<INVALID RELOC>"),
+ : _("<INVALID RELOC>"),
class == ELFCLASS32 ? 10 : 18, "",
elf_strptr (ebl->elf, shstrndx, destshdr->sh_name));
else
information. */
? ebl_reloc_type_name (ebl, GELF_R_TYPE (rel->r_info),
buf, sizeof (buf)) + 2
- : gettext ("<INVALID RELOC>"),
- gettext ("INVALID SYMBOL"),
+ : _("<INVALID RELOC>"),
+ _("INVALID SYMBOL"),
(long int) GELF_R_SYM (rel->r_info));
}
else if (GELF_ST_TYPE (sym->st_info) != STT_SECTION)
information. */
? ebl_reloc_type_name (ebl, GELF_R_TYPE (rel->r_info),
buf, sizeof (buf)) + 2
- : gettext ("<INVALID RELOC>"),
+ : _("<INVALID RELOC>"),
class == ELFCLASS32 ? 10 : 18, sym->st_value,
elf_strptr (ebl->elf, symshdr->sh_link, sym->st_name));
else
information. */
? ebl_reloc_type_name (ebl, GELF_R_TYPE (rel->r_info),
buf, sizeof (buf)) + 2
- : gettext ("<INVALID RELOC>"),
- gettext ("INVALID SECTION"),
+ : _("<INVALID RELOC>"),
+ _("INVALID SECTION"),
(long int) (sym->st_shndx == SHN_XINDEX
? xndx : sym->st_shndx));
else
information. */
? ebl_reloc_type_name (ebl, GELF_R_TYPE (rel->r_info),
buf, sizeof (buf)) + 2
- : gettext ("<INVALID RELOC>"),
+ : _("<INVALID RELOC>"),
class == ELFCLASS32 ? 10 : 18, sym->st_value,
elf_strptr (ebl->elf, shstrndx, secshdr->sh_name));
}
if (unlikely (symshdr == NULL || symdata == NULL || destshdr == NULL))
{
- printf (gettext ("\nInvalid symbol table at offset %#0" PRIx64 "\n"),
+ printf (_("\nInvalid symbol table at offset %#0" PRIx64 "\n"),
shdr->sh_offset);
return;
}
size_t shstrndx;
if (unlikely (elf_getshdrstrndx (ebl->elf, &shstrndx) < 0))
error (EXIT_FAILURE, 0,
- gettext ("cannot get section header string table index"));
+ _("cannot get section header string table index"));
if (shdr->sh_info != 0)
printf (ngettext ("\
shdr->sh_offset,
nentries);
fputs_unlocked (class == ELFCLASS32
- ? gettext ("\
+ ? _("\
Offset Type Value Addend Name\n")
- : gettext ("\
+ : _("\
Offset Type Value Addend Name\n"),
stdout);
information. */
? ebl_reloc_type_name (ebl, GELF_R_TYPE (rel->r_info),
buf, sizeof (buf)) + 2
- : gettext ("<INVALID RELOC>"),
+ : _("<INVALID RELOC>"),
class == ELFCLASS32 ? 10 : 18, "",
rel->r_addend,
elf_strptr (ebl->elf, shstrndx, destshdr->sh_name));
information. */
? ebl_reloc_type_name (ebl, GELF_R_TYPE (rel->r_info),
buf, sizeof (buf)) + 2
- : gettext ("<INVALID RELOC>"),
- gettext ("INVALID SYMBOL"),
+ : _("<INVALID RELOC>"),
+ _("INVALID SYMBOL"),
(long int) GELF_R_SYM (rel->r_info));
}
else if (GELF_ST_TYPE (sym->st_info) != STT_SECTION)
information. */
? ebl_reloc_type_name (ebl, GELF_R_TYPE (rel->r_info),
buf, sizeof (buf)) + 2
- : gettext ("<INVALID RELOC>"),
+ : _("<INVALID RELOC>"),
class == ELFCLASS32 ? 10 : 18, sym->st_value,
rel->r_addend,
elf_strptr (ebl->elf, symshdr->sh_link, sym->st_name));
information. */
? ebl_reloc_type_name (ebl, GELF_R_TYPE (rel->r_info),
buf, sizeof (buf)) + 2
- : gettext ("<INVALID RELOC>"),
- gettext ("INVALID SECTION"),
+ : _("<INVALID RELOC>"),
+ _("INVALID SECTION"),
(long int) (sym->st_shndx == SHN_XINDEX
? xndx : sym->st_shndx));
else
information. */
? ebl_reloc_type_name (ebl, GELF_R_TYPE (rel->r_info),
buf, sizeof (buf)) + 2
- : gettext ("<INVALID RELOC>"),
+ : _("<INVALID RELOC>"),
class == ELFCLASS32 ? 10 : 18, sym->st_value,
rel->r_addend,
elf_strptr (ebl->elf, shstrndx, secshdr->sh_name));
const char *sname;
if (unlikely (elf_getshdrstrndx (ebl->elf, &shstrndx) < 0))
error (EXIT_FAILURE, 0,
- gettext ("cannot get section header string table index"));
+ _("cannot get section header string table index"));
sname = elf_strptr (ebl->elf, shstrndx, shdr->sh_name);
if (sname == NULL || strcmp (sname, symbol_table_section) != 0)
continue;
{
if (elf_compress (scn, 0, 0) < 0)
printf ("WARNING: %s [%zd]\n",
- gettext ("Couldn't uncompress section"),
+ _("Couldn't uncompress section"),
elf_ndxscn (scn));
shdr = gelf_getshdr (scn, &shdr_mem);
if (unlikely (shdr == NULL))
error (EXIT_FAILURE, 0,
- gettext ("cannot get section [%zd] header: %s"),
+ _("cannot get section [%zd] header: %s"),
elf_ndxscn (scn), elf_errmsg (-1));
}
handle_symtab (ebl, scn, shdr);
size_t shstrndx;
if (unlikely (elf_getshdrstrndx (ebl->elf, &shstrndx) < 0))
error (EXIT_FAILURE, 0,
- gettext ("cannot get section header string table index"));
+ _("cannot get section header string table index"));
GElf_Shdr glink_mem;
GElf_Shdr *glink = gelf_getshdr (elf_getscn (ebl->elf, shdr->sh_link),
&glink_mem);
if (glink == NULL)
- error (EXIT_FAILURE, 0, gettext ("invalid sh_link value in section %zu"),
+ error (EXIT_FAILURE, 0, _("invalid sh_link value in section %zu"),
elf_ndxscn (scn));
/* Now we can compute the number of entries in the section. */
elf_strptr (ebl->elf, shstrndx, glink->sh_name));
fputs_unlocked (class == ELFCLASS32
- ? gettext ("\
+ ? _("\
Num: Value Size Type Bind Vis Ndx Name\n")
- : gettext ("\
+ : _("\
Num: Value Size Type Bind Vis Ndx Name\n"),
stdout);
if (likely (sym->st_shndx != SHN_XINDEX))
xndx = sym->st_shndx;
- printf (gettext ("\
+ printf (_("\
%5u: %0*" PRIx64 " %6" PRId64 " %-7s %-6s %-9s %6s %s"),
cnt,
class == ELFCLASS32 ? 8 : 16,
check_def = 0;
}
else if (unlikely (! is_nobits))
- error (0, 0, gettext ("bad dynamic symbol"));
+ error (0, 0, _("bad dynamic symbol"));
else
check_def = 1;
}
char *endp;
if (flags == 0)
- return gettext ("none");
+ return _("none");
if (flags & VER_FLG_BASE)
endp = stpcpy (buf, "BASE ");
if (unlikely (flags & ~(VER_FLG_BASE | VER_FLG_WEAK)))
{
- strncpy (endp, gettext ("| <unknown>"), buf + sizeof (buf) - endp);
+ strncpy (endp, _("| <unknown>"), buf + sizeof (buf) - endp);
buf[sizeof (buf) - 1] = '\0';
}
size_t shstrndx;
if (unlikely (elf_getshdrstrndx (ebl->elf, &shstrndx) < 0))
error (EXIT_FAILURE, 0,
- gettext ("cannot get section header string table index"));
+ _("cannot get section header string table index"));
GElf_Shdr glink_mem;
GElf_Shdr *glink = gelf_getshdr (elf_getscn (ebl->elf, shdr->sh_link),
&glink_mem);
if (glink == NULL)
- error (EXIT_FAILURE, 0, gettext ("invalid sh_link value in section %zu"),
+ error (EXIT_FAILURE, 0, _("invalid sh_link value in section %zu"),
elf_ndxscn (scn));
printf (ngettext ("\
if (unlikely (need == NULL))
break;
- printf (gettext (" %#06x: Version: %hu File: %s Cnt: %hu\n"),
+ printf (_(" %#06x: Version: %hu File: %s Cnt: %hu\n"),
offset, (unsigned short int) need->vn_version,
elf_strptr (ebl->elf, shdr->sh_link, need->vn_file),
(unsigned short int) need->vn_cnt);
if (unlikely (aux == NULL))
break;
- printf (gettext (" %#06x: Name: %s Flags: %s Version: %hu\n"),
+ printf (_(" %#06x: Name: %s Flags: %s Version: %hu\n"),
auxoffset,
elf_strptr (ebl->elf, shdr->sh_link, aux->vna_name),
get_ver_flags (aux->vna_flags),
size_t shstrndx;
if (unlikely (elf_getshdrstrndx (ebl->elf, &shstrndx) < 0))
error (EXIT_FAILURE, 0,
- gettext ("cannot get section header string table index"));
+ _("cannot get section header string table index"));
GElf_Shdr glink_mem;
GElf_Shdr *glink = gelf_getshdr (elf_getscn (ebl->elf, shdr->sh_link),
&glink_mem);
if (glink == NULL)
- error (EXIT_FAILURE, 0, gettext ("invalid sh_link value in section %zu"),
+ error (EXIT_FAILURE, 0, _("invalid sh_link value in section %zu"),
elf_ndxscn (scn));
int class = gelf_getclass (ebl->elf);
if (unlikely (aux == NULL))
break;
- printf (gettext ("\
+ printf (_("\
%#06x: Version: %hd Flags: %s Index: %hd Cnt: %hd Name: %s\n"),
offset, def->vd_version,
get_ver_flags (def->vd_flags),
if (unlikely (aux == NULL))
break;
- printf (gettext (" %#06x: Parent %d: %s\n"),
+ printf (_(" %#06x: Parent %d: %s\n"),
auxoffset, cnt2,
elf_strptr (ebl->elf, shdr->sh_link, aux->vda_name));
size_t shstrndx;
if (unlikely (elf_getshdrstrndx (ebl->elf, &shstrndx) < 0))
error (EXIT_FAILURE, 0,
- gettext ("cannot get section header string table index"));
+ _("cannot get section header string table index"));
/* We have to find the version definition section and extract the
version names. */
&glink_mem);
size_t sh_entsize = gelf_fsize (ebl->elf, ELF_T_HALF, 1, EV_CURRENT);
if (glink == NULL)
- error (EXIT_FAILURE, 0, gettext ("invalid sh_link value in section %zu"),
+ error (EXIT_FAILURE, 0, _("invalid sh_link value in section %zu"),
elf_ndxscn (scn));
/* Print the header. */
{
ssize_t n;
case 0:
- fputs_unlocked (gettext (" 0 *local* "),
+ fputs_unlocked (_(" 0 *local* "),
stdout);
break;
case 1:
- fputs_unlocked (gettext (" 1 *global* "),
+ fputs_unlocked (_(" 1 *global* "),
stdout);
break;
&glink_mem);
if (glink == NULL)
{
- error (0, 0, gettext ("invalid sh_link value in section %zu"),
+ error (0, 0, _("invalid sh_link value in section %zu"),
elf_ndxscn (scn));
return;
}
uint64_t success = 0;
/* xgettext:no-c-format */
- fputs_unlocked (gettext ("\
+ fputs_unlocked (_("\
Length Number % of total Coverage\n"), stdout);
- printf (gettext (" 0 %6" PRIu32 " %5.1f%%\n"),
+ printf (_(" 0 %6" PRIu32 " %5.1f%%\n"),
counts[0], (counts[0] * 100.0) / nbucket);
uint64_t nzero_counts = 0;
for (Elf32_Word cnt = 1; cnt <= maxlength; ++cnt)
{
nzero_counts += counts[cnt] * cnt;
- printf (gettext ("\
+ printf (_("\
%7d %6" PRIu32 " %5.1f%% %5.1f%%\n"),
(int) cnt, counts[cnt], (counts[cnt] * 100.0) / nbucket,
(nzero_counts * 100.0) / nsyms);
success += counts[cnt] * acc;
}
- printf (gettext ("\
+ printf (_("\
Average number of tests: successful lookup: %f\n\
unsuccessful lookup: %f\n"),
(double) success / (double) nzero_counts,
Elf_Data *data = elf_getdata (scn, NULL);
if (unlikely (data == NULL))
{
- error (0, 0, gettext ("cannot get data for section %d: %s"),
+ error (0, 0, _("cannot get data for section %d: %s"),
(int) elf_ndxscn (scn), elf_errmsg (-1));
return;
}
if (unlikely (data->d_size < 2 * sizeof (Elf32_Word)))
{
invalid_data:
- error (0, 0, gettext ("invalid data in sysv.hash section %d"),
+ error (0, 0, _("invalid data in sysv.hash section %d"),
(int) elf_ndxscn (scn));
return;
}
++chain_len;
if (chain_len > nchain)
{
- error (0, 0, gettext ("invalid chain in sysv.hash section %d"),
+ error (0, 0, _("invalid chain in sysv.hash section %d"),
(int) elf_ndxscn (scn));
free (lengths);
return;
Elf_Data *data = elf_getdata (scn, NULL);
if (unlikely (data == NULL))
{
- error (0, 0, gettext ("cannot get data for section %d: %s"),
+ error (0, 0, _("cannot get data for section %d: %s"),
(int) elf_ndxscn (scn), elf_errmsg (-1));
return;
}
if (unlikely (data->d_size < 2 * sizeof (Elf64_Xword)))
{
invalid_data:
- error (0, 0, gettext ("invalid data in sysv.hash64 section %d"),
+ error (0, 0, _("invalid data in sysv.hash64 section %d"),
(int) elf_ndxscn (scn));
return;
}
++chain_len;
if (chain_len > nchain)
{
- error (0, 0, gettext ("invalid chain in sysv.hash64 section %d"),
+ error (0, 0, _("invalid chain in sysv.hash64 section %d"),
(int) elf_ndxscn (scn));
free (lengths);
return;
Elf_Data *data = elf_getdata (scn, NULL);
if (unlikely (data == NULL))
{
- error (0, 0, gettext ("cannot get data for section %d: %s"),
+ error (0, 0, _("cannot get data for section %d: %s"),
(int) elf_ndxscn (scn), elf_errmsg (-1));
return;
}
{
invalid_data:
free (lengths);
- error (0, 0, gettext ("invalid data in gnu.hash section %d"),
+ error (0, 0, _("invalid data in gnu.hash section %d"),
(int) elf_ndxscn (scn));
return;
}
}
char *str;
- if (unlikely (asprintf (&str, gettext ("\
+ if (unlikely (asprintf (&str, _("\
Symbol Bias: %u\n\
Bitmask Size: %zu bytes %" PRIuFAST32 "%% bits set 2nd hash shift: %u\n"),
(unsigned int) symbias,
/ (uint_fast32_t) (bitmask_words
* sizeof (Elf32_Word) * 8)),
(unsigned int) shift) == -1))
- error (EXIT_FAILURE, 0, gettext ("memory exhausted"));
+ error (EXIT_FAILURE, 0, _("memory exhausted"));
print_hash_info (ebl, scn, shdr, shstrndx, maxlength, nbucket, nsyms,
lengths, str);
size_t shstrndx;
if (unlikely (elf_getshdrstrndx (ebl->elf, &shstrndx) < 0))
error (EXIT_FAILURE, 0,
- gettext ("cannot get section header string table index"));
+ _("cannot get section header string table index"));
Elf_Scn *scn = NULL;
while ((scn = elf_nextscn (ebl->elf, scn)) != NULL)
{
if (elf_compress (scn, 0, 0) < 0)
printf ("WARNING: %s [%zd]\n",
- gettext ("Couldn't uncompress section"),
+ _("Couldn't uncompress section"),
elf_ndxscn (scn));
shdr = gelf_getshdr (scn, &shdr_mem);
if (unlikely (shdr == NULL))
error (EXIT_FAILURE, 0,
- gettext ("cannot get section [%zd] header: %s"),
+ _("cannot get section [%zd] header: %s"),
elf_ndxscn (scn), elf_errmsg (-1));
}
size_t shstrndx;
if (unlikely (elf_getshdrstrndx (ebl->elf, &shstrndx) < 0))
error (EXIT_FAILURE, 0,
- gettext ("cannot get section header string table index"));
+ _("cannot get section header string table index"));
while ((scn = elf_nextscn (ebl->elf, scn)) != NULL)
{
if (data == NULL)
return;
- puts (gettext ("\
+ puts (_("\
Library Time Stamp Checksum Version Flags"));
for (int cnt = 0; cnt < nentries; ++cnt)
size_t shstrndx;
if (unlikely (elf_getshdrstrndx (ebl->elf, &shstrndx) < 0))
error (EXIT_FAILURE, 0,
- gettext ("cannot get section header string table index"));
+ _("cannot get section header string table index"));
while ((scn = elf_nextscn (ebl->elf, scn)) != NULL)
{
|| ehdr->e_machine != EM_CSKY)))
continue;
- printf (gettext ("\
+ printf (_("\
\nObject attributes section [%2zu] '%s' of %" PRIu64
" bytes at offset %#0" PRIx64 ":\n"),
elf_ndxscn (scn),
if (unlikely (*p++ != 'A'))
return;
- fputs_unlocked (gettext (" Owner Size\n"), stdout);
+ fputs_unlocked (_(" Owner Size\n"), stdout);
inline size_t left (void)
{
break;
++q;
- printf (gettext (" %-13s %4" PRIu32 "\n"), name, len);
+ printf (_(" %-13s %4" PRIu32 "\n"), name, len);
bool gnu_vendor = (q - name == sizeof "gnu"
&& !memcmp (name, "gnu", sizeof "gnu"));
{
default:
/* Unknown subsection, print and skip. */
- printf (gettext (" %-4u %12" PRIu32 "\n"),
+ printf (_(" %-4u %12" PRIu32 "\n"),
subsection_tag, subsection_len);
break;
case 1: /* Tag_File */
- printf (gettext (" File: %11" PRIu32 "\n"),
+ printf (_(" File: %11" PRIu32 "\n"),
subsection_len);
while (r < q)
if (tag_name != NULL)
{
if (tag == 32)
- printf (gettext (" %s: %" PRId64 ", %s\n"),
+ printf (_(" %s: %" PRId64 ", %s\n"),
tag_name, value, string);
else if (string == NULL && value_name == NULL)
- printf (gettext (" %s: %" PRId64 "\n"),
+ printf (_(" %s: %" PRId64 "\n"),
tag_name, value);
else
- printf (gettext (" %s: %s\n"),
+ printf (_(" %s: %s\n"),
tag_name, string ?: value_name);
}
else
assert (tag != 32
|| strcmp ((const char *) name, "gnu"));
if (string == NULL)
- printf (gettext (" %u: %" PRId64 "\n"),
+ printf (_(" %u: %" PRId64 "\n"),
tag, value);
else
- printf (gettext (" %u: %s\n"),
+ printf (_(" %u: %s\n"),
tag, string);
}
}
continue;
invalid:
- printf (gettext ("%*s[%2" PRIuMAX "] %s <TRUNCATED>\n"),
+ printf (_("%*s[%2" PRIuMAX "] %s <TRUNCATED>\n"),
indent, "", (uintmax_t) offset, op_name);
break;
}
{
p1->warned = p2->warned = true;
error (0, 0,
- gettext ("%s %#" PRIx64 " used with different address sizes"),
+ _("%s %#" PRIx64 " used with different address sizes"),
name, (uint64_t) p1->offset);
}
if (p1->dwarf64 != p2->dwarf64)
{
p1->warned = p2->warned = true;
error (0, 0,
- gettext ("%s %#" PRIx64 " used with different offset sizes"),
+ _("%s %#" PRIx64 " used with different offset sizes"),
name, (uint64_t) p1->offset);
}
if (listptr_base (p1) != listptr_base (p2))
{
p1->warned = p2->warned = true;
error (0, 0,
- gettext ("%s %#" PRIx64 " used with different base addresses"),
+ _("%s %#" PRIx64 " used with different base addresses"),
name, (uint64_t) p1->offset);
}
if (p1->attr != p2 ->attr)
{
p1->warned = p2->warned = true;
error (0, 0,
- gettext ("%s %#" PRIx64
+ _("%s %#" PRIx64
" used with different attribute %s and %s"),
name, (uint64_t) p1->offset, dwarf_attr_name (p2->attr),
dwarf_attr_name (p2->attr));
|| p->offset >= (Dwarf_Off) (endp - *readp + offset))
{
*readp = endp;
- printf (gettext (" [%6tx] <UNUSED GARBAGE IN REST OF SECTION>\n"),
+ printf (_(" [%6tx] <UNUSED GARBAGE IN REST OF SECTION>\n"),
offset);
return true;
}
if (p->offset != (Dwarf_Off) offset)
{
*readp += p->offset - offset;
- printf (gettext (" [%6tx] <UNUSED GARBAGE> ... %" PRIu64 " bytes ...\n"),
+ printf (_(" [%6tx] <UNUSED GARBAGE> ... %" PRIu64 " bytes ...\n"),
offset, (Dwarf_Off) p->offset - offset);
return true;
}
const size_t sh_size = (dbg->sectiondata[IDX_debug_abbrev] ?
dbg->sectiondata[IDX_debug_abbrev]->d_size : 0);
- printf (gettext ("\nDWARF section [%2zu] '%s' at offset %#" PRIx64 ":\n"
+ printf (_("\nDWARF section [%2zu] '%s' at offset %#" PRIx64 ":\n"
" [ Code]\n"),
elf_ndxscn (scn), section_name (ebl, shdr),
(uint64_t) shdr->sh_offset);
Dwarf_Off offset = 0;
while (offset < sh_size)
{
- printf (gettext ("\nAbbreviation section at offset %" PRIu64 ":\n"),
+ printf (_("\nAbbreviation section at offset %" PRIu64 ":\n"),
offset);
while (1)
{
if (unlikely (res < 0))
{
- printf (gettext ("\
+ printf (_("\
*** error while reading abbreviation: %s\n"),
dwarf_errmsg (-1));
return;
unsigned int tag = dwarf_getabbrevtag (&abbrev);
int has_children = dwarf_abbrevhaschildren (&abbrev);
- printf (gettext (" [%5u] offset: %" PRId64
+ printf (_(" [%5u] offset: %" PRId64
", children: %s, tag: %s\n"),
code, (int64_t) offset,
has_children ? yes_str : no_str,
Ebl *ebl, GElf_Ehdr *ehdr,
Elf_Scn *scn, GElf_Shdr *shdr, Dwarf *dbg)
{
- printf (gettext ("\
+ printf (_("\
\nDWARF section [%2zu] '%s' at offset %#" PRIx64 ":\n"),
elf_ndxscn (scn), section_name (ebl, shdr),
(uint64_t) shdr->sh_offset);
?: elf_rawdata (scn, NULL));
if (unlikely (data == NULL))
{
- error (0, 0, gettext ("cannot get .debug_addr section data: %s"),
+ error (0, 0, _("cannot get .debug_addr section data: %s"),
elf_errmsg (-1));
return;
}
/* Pretend we have a header. */
printf ("\n");
- printf (gettext (" Length: %8" PRIu64 "\n"),
+ printf (_(" Length: %8" PRIu64 "\n"),
unit_length);
- printf (gettext (" DWARF version: %8" PRIu16 "\n"), version);
- printf (gettext (" Address size: %8" PRIu64 "\n"),
+ printf (_(" DWARF version: %8" PRIu16 "\n"), version);
+ printf (_(" Address size: %8" PRIu64 "\n"),
(uint64_t) address_size);
- printf (gettext (" Segment size: %8" PRIu64 "\n"),
+ printf (_(" Segment size: %8" PRIu64 "\n"),
(uint64_t) segment_size);
printf ("\n");
}
unit_length = read_8ubyte_unaligned_inc (dbg, readp);
}
printf ("\n");
- printf (gettext (" Length: %8" PRIu64 "\n"),
+ printf (_(" Length: %8" PRIu64 "\n"),
unit_length);
/* We need at least 2-bytes (version) + 1-byte
next_unitp = readp + unit_length;
version = read_2ubyte_unaligned_inc (dbg, readp);
- printf (gettext (" DWARF version: %8" PRIu16 "\n"), version);
+ printf (_(" DWARF version: %8" PRIu16 "\n"), version);
if (version != 5)
{
- error (0, 0, gettext ("Unknown version"));
+ error (0, 0, _("Unknown version"));
goto next_unit;
}
address_size = *readp++;
- printf (gettext (" Address size: %8" PRIu64 "\n"),
+ printf (_(" Address size: %8" PRIu64 "\n"),
(uint64_t) address_size);
if (address_size != 4 && address_size != 8)
{
- error (0, 0, gettext ("unsupported address size"));
+ error (0, 0, _("unsupported address size"));
goto next_unit;
}
segment_size = *readp++;
- printf (gettext (" Segment size: %8" PRIu64 "\n"),
+ printf (_(" Segment size: %8" PRIu64 "\n"),
(uint64_t) segment_size);
printf ("\n");
if (segment_size != 0)
{
- error (0, 0, gettext ("unsupported segment size"));
+ error (0, 0, _("unsupported segment size"));
goto next_unit;
}
size_t cnt;
if (unlikely (dwarf_getaranges (dbg, &aranges, &cnt) != 0))
{
- error (0, 0, gettext ("cannot get .debug_aranges content: %s"),
+ error (0, 0, _("cannot get .debug_aranges content: %s"),
dwarf_errmsg (-1));
return;
}
glink = gelf_getshdr (elf_getscn (ebl->elf, shdr->sh_link), &glink_mem);
if (glink == NULL)
{
- error (0, 0, gettext ("invalid sh_link value in section %zu"),
+ error (0, 0, _("invalid sh_link value in section %zu"),
elf_ndxscn (scn));
return;
}
Dwarf_Off offset;
if (unlikely (dwarf_getarangeinfo (runp, &start, &length, &offset) != 0))
- printf (gettext (" [%*zu] ???\n"), digits, n);
+ printf (_(" [%*zu] ???\n"), digits, n);
else
- printf (gettext (" [%*zu] start: %0#*" PRIx64
+ printf (_(" [%*zu] start: %0#*" PRIx64
", length: %5" PRIu64 ", CU DIE offset: %6"
PRId64 "\n"),
digits, n, ehdr->e_ident[EI_CLASS] == ELFCLASS32 ? 10 : 18,
if (unlikely (data == NULL))
{
- error (0, 0, gettext ("cannot get .debug_aranges content: %s"),
+ error (0, 0, _("cannot get .debug_aranges content: %s"),
elf_errmsg (-1));
return;
}
- printf (gettext ("\
+ printf (_("\
\nDWARF section [%2zu] '%s' at offset %#" PRIx64 ":\n"),
elf_ndxscn (scn), section_name (ebl, shdr),
(uint64_t) shdr->sh_offset);
const unsigned char *hdrstart = readp;
size_t start_offset = hdrstart - (const unsigned char *) data->d_buf;
- printf (gettext ("\nTable at offset %zu:\n"), start_offset);
+ printf (_("\nTable at offset %zu:\n"), start_offset);
if (readp + 4 > readendp)
{
invalid_data:
- error (0, 0, gettext ("invalid data in section [%zu] '%s'"),
+ error (0, 0, _("invalid data in section [%zu] '%s'"),
elf_ndxscn (scn), section_name (ebl, shdr));
return;
}
}
const unsigned char *nexthdr = readp + length;
- printf (gettext ("\n Length: %6" PRIu64 "\n"),
+ printf (_("\n Length: %6" PRIu64 "\n"),
(uint64_t) length);
if (unlikely (length > (size_t) (readendp - readp)))
if (readp + 2 > readendp)
goto invalid_data;
uint_fast16_t version = read_2ubyte_unaligned_inc (dbg, readp);
- printf (gettext (" DWARF version: %6" PRIuFAST16 "\n"),
+ printf (_(" DWARF version: %6" PRIuFAST16 "\n"),
version);
if (version != 2)
{
- error (0, 0, gettext ("unsupported aranges version"));
+ error (0, 0, _("unsupported aranges version"));
goto next_table;
}
offset = read_8ubyte_unaligned_inc (dbg, readp);
else
offset = read_4ubyte_unaligned_inc (dbg, readp);
- printf (gettext (" CU offset: %6" PRIx64 "\n"),
+ printf (_(" CU offset: %6" PRIx64 "\n"),
(uint64_t) offset);
if (readp + 1 > readendp)
goto invalid_data;
unsigned int address_size = *readp++;
- printf (gettext (" Address size: %6" PRIu64 "\n"),
+ printf (_(" Address size: %6" PRIu64 "\n"),
(uint64_t) address_size);
if (address_size != 4 && address_size != 8)
{
- error (0, 0, gettext ("unsupported address size"));
+ error (0, 0, _("unsupported address size"));
goto next_table;
}
if (readp + 1 > readendp)
goto invalid_data;
unsigned int segment_size = *readp++;
- printf (gettext (" Segment size: %6" PRIu64 "\n\n"),
+ printf (_(" Segment size: %6" PRIu64 "\n\n"),
(uint64_t) segment_size);
if (segment_size != 0 && segment_size != 4 && segment_size != 8)
{
- error (0, 0, gettext ("unsupported segment size"));
+ error (0, 0, _("unsupported segment size"));
goto next_table;
}
if (readp != nexthdr)
{
size_t padding = nexthdr - readp;
- printf (gettext (" %zu padding bytes\n"), padding);
+ printf (_(" %zu padding bytes\n"), padding);
readp = nexthdr;
}
}
Elf_Scn *scn, GElf_Shdr *shdr,
Dwarf *dbg __attribute__((unused)))
{
- printf (gettext ("\
+ printf (_("\
\nDWARF section [%2zu] '%s' at offset %#" PRIx64 ":\n"),
elf_ndxscn (scn), section_name (ebl, shdr),
(uint64_t) shdr->sh_offset);
?: elf_rawdata (scn, NULL));
if (unlikely (data == NULL))
{
- error (0, 0, gettext ("cannot get .debug_rnglists content: %s"),
+ error (0, 0, _("cannot get .debug_rnglists content: %s"),
elf_errmsg (-1));
return;
}
if (unlikely (readp > dataend - 4))
{
invalid_data:
- error (0, 0, gettext ("invalid data in section [%zu] '%s'"),
+ error (0, 0, _("invalid data in section [%zu] '%s'"),
elf_ndxscn (scn), section_name (ebl, shdr));
return;
}
ptrdiff_t offset = readp - (unsigned char *) data->d_buf;
- printf (gettext ("Table at Offset 0x%" PRIx64 ":\n\n"),
+ printf (_("Table at Offset 0x%" PRIx64 ":\n\n"),
(uint64_t) offset);
uint64_t unit_length = read_4ubyte_unaligned_inc (dbg, readp);
unit_length = read_8ubyte_unaligned_inc (dbg, readp);
offset_size = 8;
}
- printf (gettext (" Length: %8" PRIu64 "\n"), unit_length);
+ printf (_(" Length: %8" PRIu64 "\n"), unit_length);
/* We need at least 2-bytes + 1-byte + 1-byte + 4-bytes = 8
bytes to complete the header. And this unit cannot go beyond
const unsigned char *nexthdr = readp + unit_length;
uint16_t version = read_2ubyte_unaligned_inc (dbg, readp);
- printf (gettext (" DWARF version: %8" PRIu16 "\n"), version);
+ printf (_(" DWARF version: %8" PRIu16 "\n"), version);
if (version != 5)
{
- error (0, 0, gettext ("Unknown version"));
+ error (0, 0, _("Unknown version"));
goto next_table;
}
uint8_t address_size = *readp++;
- printf (gettext (" Address size: %8" PRIu64 "\n"),
+ printf (_(" Address size: %8" PRIu64 "\n"),
(uint64_t) address_size);
if (address_size != 4 && address_size != 8)
{
- error (0, 0, gettext ("unsupported address size"));
+ error (0, 0, _("unsupported address size"));
goto next_table;
}
uint8_t segment_size = *readp++;
- printf (gettext (" Segment size: %8" PRIu64 "\n"),
+ printf (_(" Segment size: %8" PRIu64 "\n"),
(uint64_t) segment_size);
if (segment_size != 0 && segment_size != 4 && segment_size != 8)
{
- error (0, 0, gettext ("unsupported segment size"));
+ error (0, 0, _("unsupported segment size"));
goto next_table;
}
uint32_t offset_entry_count = read_4ubyte_unaligned_inc (dbg, readp);
- printf (gettext (" Offset entries: %8" PRIu64 "\n"),
+ printf (_(" Offset entries: %8" PRIu64 "\n"),
(uint64_t) offset_entry_count);
/* We need the CU that uses this unit to get the initial base address. */
if (dwarf_cu_die (cu, &cudie,
NULL, NULL, NULL, NULL,
NULL, NULL) == NULL)
- printf (gettext (" Unknown CU base: "));
+ printf (_(" Unknown CU base: "));
else
- printf (gettext (" CU [%6" PRIx64 "] base: "),
+ printf (_(" CU [%6" PRIx64 "] base: "),
dwarf_dieoffset (&cudie));
print_dwarf_addr (dwflmod, address_size, cu_base, cu_base);
printf ("\n");
}
else
- printf (gettext (" Not associated with a CU.\n"));
+ printf (_(" Not associated with a CU.\n"));
printf ("\n");
if (offset_entry_count > max_entries)
{
error (0, 0,
- gettext ("too many offset entries for unit length"));
+ _("too many offset entries for unit length"));
offset_entry_count = max_entries;
}
- printf (gettext (" Offsets starting at 0x%" PRIx64 ":\n"),
+ printf (_(" Offsets starting at 0x%" PRIx64 ":\n"),
(uint64_t) (offset_array_start
- (unsigned char *) data->d_buf));
for (uint32_t idx = 0; idx < offset_entry_count; idx++)
if ((uint64_t) (nexthdr - readp) < 1)
{
invalid_range:
- error (0, 0, gettext ("invalid range list data"));
+ error (0, 0, _("invalid range list data"));
goto next_table;
}
get_uleb128 (op1, readp, nexthdr);
if (readp != nexthdr)
{
size_t padding = nexthdr - readp;
- printf (gettext (" %zu padding bytes\n\n"), padding);
+ printf (_(" %zu padding bytes\n\n"), padding);
readp = nexthdr;
}
}
?: elf_rawdata (scn, NULL));
if (unlikely (data == NULL))
{
- error (0, 0, gettext ("cannot get .debug_ranges content: %s"),
+ error (0, 0, _("cannot get .debug_ranges content: %s"),
elf_errmsg (-1));
return;
}
- printf (gettext ("\
+ printf (_("\
\nDWARF section [%2zu] '%s' at offset %#" PRIx64 ":\n"),
elf_ndxscn (scn), section_name (ebl, shdr),
(uint64_t) shdr->sh_offset);
if (dwarf_cu_die (cu, &cudie,
NULL, NULL, NULL, NULL,
NULL, NULL) == NULL)
- printf (gettext ("\n Unknown CU base: "));
+ printf (_("\n Unknown CU base: "));
else
- printf (gettext ("\n CU [%6" PRIx64 "] base: "),
+ printf (_("\n CU [%6" PRIx64 "] base: "),
dwarf_dieoffset (&cudie));
print_dwarf_addr (dwflmod, address_size, base, base);
printf ("\n");
if (unlikely (data->d_size - offset < (size_t) address_size * 2))
{
- printf (gettext (" [%6tx] <INVALID DATA>\n"), offset);
+ printf (_(" [%6tx] <INVALID DATA>\n"), offset);
break;
}
if (begin == (Dwarf_Addr) -1l) /* Base address entry. */
{
- printf (gettext (" [%6tx] base address\n "), offset);
+ printf (_(" [%6tx] base address\n "), offset);
print_dwarf_addr (dwflmod, address_size, end, end);
printf ("\n");
base = end;
else if (begin == 0 && end == 0) /* End of list entry. */
{
if (first)
- printf (gettext (" [%6tx] empty list\n"), offset);
+ printf (_(" [%6tx] empty list\n"), offset);
first = true;
}
else
default:
invalid:
error (1, 0,
- gettext ("invalid encoding"));
+ _("invalid encoding"));
}
return readp;
if ((uint64_t) (endp - readp) < op1)
{
invalid:
- fputs (gettext (" <INVALID DATA>\n"), stdout);
+ fputs (_(" <INVALID DATA>\n"), stdout);
return;
}
print_ops (dwflmod, dbg, 10, 10, version, ptr_size, 0, NULL,
GElf_Addr bias;
if (dwfl_module_getelf (dwflmod, &bias) == NULL)
{
- error (0, 0, gettext ("cannot get ELF: %s"), dwfl_errmsg (-1));
+ error (0, 0, _("cannot get ELF: %s"), dwfl_errmsg (-1));
return;
}
if (unlikely (data == NULL))
{
- error (0, 0, gettext ("cannot get %s content: %s"),
+ error (0, 0, _("cannot get %s content: %s"),
scnname, elf_errmsg (-1));
return;
}
if (is_eh_frame)
- printf (gettext ("\
+ printf (_("\
\nCall frame information section [%2zu] '%s' at offset %#" PRIx64 ":\n"),
elf_ndxscn (scn), scnname, (uint64_t) shdr->sh_offset);
else
- printf (gettext ("\
+ printf (_("\
\nDWARF section [%2zu] '%s' at offset %#" PRIx64 ":\n"),
elf_ndxscn (scn), scnname, (uint64_t) shdr->sh_offset);
if (unlikely (readp + 4 > dataend))
{
invalid_data:
- error (0, 0, gettext ("invalid data in section [%zu] '%s'"),
+ error (0, 0, _("invalid data in section [%zu] '%s'"),
elf_ndxscn (scn), scnname);
return;
}
if (unlikely (unit_length == 0))
{
- printf (gettext ("\n [%6tx] Zero terminator\n"), offset);
+ printf (_("\n [%6tx] Zero terminator\n"), offset);
continue;
}
if (augmentationlen > (size_t) (cieend - readp))
{
- error (0, 0, gettext ("invalid augmentation length"));
+ error (0, 0, _("invalid augmentation length"));
readp = cieend;
continue;
}
if (*cp == 'R')
{
fde_encoding = *readp++;
- print_encoding_base (gettext ("FDE address encoding: "),
+ print_encoding_base (_("FDE address encoding: "),
fde_encoding);
}
else if (*cp == 'L')
{
lsda_encoding = *readp++;
- print_encoding_base (gettext ("LSDA pointer encoding: "),
+ print_encoding_base (_("LSDA pointer encoding: "),
lsda_encoding);
}
else if (*cp == 'P')
& (ptr_size == 4
? UINT64_C (0xffffffff)
: UINT64_C (0xffffffffffffffff)));
- printf (gettext (" (offset: %#" PRIx64 ")"),
+ printf (_(" (offset: %#" PRIx64 ")"),
(uint64_t) vma_base);
}
printf ("\n address_range: %#" PRIx64,
(uint64_t) address_range);
if ((fde_encoding & 0x70) == DW_EH_PE_pcrel)
- printf (gettext (" (end offset: %#" PRIx64 ")"),
+ printf (_(" (end offset: %#" PRIx64 ")"),
((uint64_t) vma_base + (uint64_t) address_range)
& (ptr_size == 4
? UINT64_C (0xffffffff)
if (augmentationlen > (size_t) (cieend - readp))
{
- error (0, 0, gettext ("invalid augmentation length"));
+ error (0, 0, _("invalid augmentation length"));
readp = cieend;
continue;
}
&readp[augmentationlen],
&lsda_pointer, dbg);
u = p - readp;
- printf (gettext ("\
+ printf (_("\
%-26sLSDA pointer: %#" PRIx64 "\n"),
hdr, lsda_pointer);
hdr = "";
if (unlikely (attr == 0))
{
if (!cbargs->silent)
- error (0, 0, gettext ("DIE [%" PRIx64 "] "
+ error (0, 0, _("DIE [%" PRIx64 "] "
"cannot get attribute code: %s"),
dwarf_dieoffset (die), dwarf_errmsg (-1));
return DWARF_CB_ABORT;
if (unlikely (form == 0))
{
if (!cbargs->silent)
- error (0, 0, gettext ("DIE [%" PRIx64 "] "
+ error (0, 0, _("DIE [%" PRIx64 "] "
"cannot get attribute form: %s"),
dwarf_dieoffset (die), dwarf_errmsg (-1));
return DWARF_CB_ABORT;
{
attrval_out:
if (!cbargs->silent)
- error (0, 0, gettext ("DIE [%" PRIx64 "] "
+ error (0, 0, _("DIE [%" PRIx64 "] "
"cannot get attribute '%s' (%s) value: "
"%s"),
dwarf_dieoffset (die),
valuestr = filename + 1;
}
else
- error (0, 0, gettext ("invalid file (%" PRId64 "): %s"),
+ error (0, 0, _("invalid file (%" PRId64 "): %s"),
num, dwarf_errmsg (-1));
}
else
- error (0, 0, gettext ("no srcfiles for CU [%" PRIx64 "]"),
+ error (0, 0, _("no srcfiles for CU [%" PRIx64 "]"),
dwarf_dieoffset (&cudie));
}
else
- error (0, 0, gettext ("couldn't get DWARF CU: %s"),
+ error (0, 0, _("couldn't get DWARF CU: %s"),
dwarf_errmsg (-1));
if (valuestr == NULL)
valuestr = "???";
const char *secname = section_name (ebl, shdr);
if (!silent)
- printf (gettext ("\
+ printf (_("\
\nDWARF section [%2zu] '%s' at offset %#" PRIx64 ":\n [Offset]\n"),
elf_ndxscn (scn), secname, (uint64_t) shdr->sh_offset);
if (unit_res == -1)
{
if (!silent)
- error (0, 0, gettext ("cannot get next unit: %s"), dwarf_errmsg (-1));
+ error (0, 0, _("cannot get next unit: %s"), dwarf_errmsg (-1));
goto do_return;
}
Dwarf_Off dieoffset;
dieoffset = dwarf_dieoffset (dwarf_offdie_types (dbg, subdie_off,
&typedie));
- printf (gettext (" Type unit at offset %" PRIu64 ":\n"
+ printf (_(" Type unit at offset %" PRIu64 ":\n"
" Version: %" PRIu16
", Abbreviation section offset: %" PRIu64
", Address size: %" PRIu8
}
else
{
- printf (gettext (" Compilation unit at offset %" PRIu64 ":\n"
+ printf (_(" Compilation unit at offset %" PRIu64 ":\n"
" Version: %" PRIu16
", Abbreviation section offset: %" PRIu64
", Address size: %" PRIu8
if (version >= 5 || (unit_type != DW_UT_compile
&& unit_type != DW_UT_partial))
{
- printf (gettext (" Unit type: %s (%" PRIu8 ")"),
+ printf (_(" Unit type: %s (%" PRIu8 ")"),
dwarf_unit_name (unit_type), unit_type);
if (unit_type == DW_UT_type
|| unit_type == DW_UT_skeleton
|| unit_type < DW_UT_compile || unit_type > DW_UT_split_type)
{
if (!silent)
- error (0, 0, gettext ("unknown version (%d) or unit type (%d)"),
+ error (0, 0, _("unknown version (%d) or unit type (%d)"),
version, unit_type);
goto next_cu;
}
if (unlikely (offset == (Dwarf_Off) -1))
{
if (!silent)
- error (0, 0, gettext ("cannot get DIE offset: %s"),
+ error (0, 0, _("cannot get DIE offset: %s"),
dwarf_errmsg (-1));
goto do_return;
}
if (unlikely (tag == DW_TAG_invalid))
{
if (!silent)
- error (0, 0, gettext ("cannot get tag of DIE at offset [%" PRIx64
+ error (0, 0, _("cannot get tag of DIE at offset [%" PRIx64
"] in section '%s': %s"),
(uint64_t) offset, secname, dwarf_errmsg (-1));
goto do_return;
if (unlikely (res == -1))
{
if (!silent)
- error (0, 0, gettext ("cannot get next DIE: %s\n"),
+ error (0, 0, _("cannot get next DIE: %s\n"),
dwarf_errmsg (-1));
goto do_return;
}
else if (unlikely (res < 0))
{
if (!silent)
- error (0, 0, gettext ("cannot get next DIE: %s"),
+ error (0, 0, _("cannot get next DIE: %s"),
dwarf_errmsg (-1));
goto do_return;
}
if (!silent)
{
- printf (gettext (" Split compilation unit at offset %"
+ printf (_(" Split compilation unit at offset %"
PRIu64 ":\n"
" Version: %" PRIu16
", Abbreviation section offset: %" PRIu64
", Offset size: %" PRIu8 "\n"),
(uint64_t) offset, version, abbroffset,
addrsize, offsize);
- printf (gettext (" Unit type: %s (%" PRIu8 ")"),
+ printf (_(" Unit type: %s (%" PRIu8 ")"),
dwarf_unit_name (unit_type), unit_type);
printf (", Unit id: 0x%.16" PRIx64 "", unit_id);
printf ("\n");
GElf_Ehdr *ehdr __attribute__ ((unused)),
Elf_Scn *scn, GElf_Shdr *shdr, Dwarf *dbg)
{
- printf (gettext ("\
+ printf (_("\
\nDWARF section [%2zu] '%s' at offset %#" PRIx64 ":\n\n"),
elf_ndxscn (scn), section_name (ebl, shdr),
(uint64_t) shdr->sh_offset);
goto strx_val;
default:
- error (0, 0, gettext ("unknown form: %s"), dwarf_form_name (form));
+ error (0, 0, _("unknown form: %s"), dwarf_form_name (form));
return readendp;
}
return;
}
- printf (gettext ("\
+ printf (_("\
\nDWARF section [%2zu] '%s' at offset %#" PRIx64 ":\n"),
elf_ndxscn (scn), section_name (ebl, shdr),
(uint64_t) shdr->sh_offset);
?: elf_rawdata (scn, NULL));
if (unlikely (data == NULL))
{
- error (0, 0, gettext ("cannot get line data section data: %s"),
+ error (0, 0, _("cannot get line data section data: %s"),
elf_errmsg (-1));
return;
}
{
size_t start_offset = linep - (const unsigned char *) data->d_buf;
- printf (gettext ("\nTable at offset %zu:\n"), start_offset);
+ printf (_("\nTable at offset %zu:\n"), start_offset);
if (unlikely (linep + 4 > lineendp))
goto invalid_data;
if (unlikely (linep + 8 > lineendp))
{
invalid_data:
- error (0, 0, gettext ("invalid data in section [%zu] '%s'"),
+ error (0, 0, _("invalid data in section [%zu] '%s'"),
elf_ndxscn (scn), section_name (ebl, shdr));
return;
}
uint_fast8_t opcode_base = *linep++;
/* Print what we got so far. */
- printf (gettext ("\n"
+ printf (_("\n"
" Length: %" PRIu64 "\n"
" DWARF version: %" PRIuFAST16 "\n"
" Prologue length: %" PRIu64 "\n"
if (version < 2 || version > 5)
{
- error (0, 0, gettext ("cannot handle .debug_line version: %u\n"),
+ error (0, 0, _("cannot handle .debug_line version: %u\n"),
(unsigned int) version);
linep = lineendp;
continue;
if (address_size != 4 && address_size != 8)
{
- error (0, 0, gettext ("cannot handle address size: %u\n"),
+ error (0, 0, _("cannot handle address size: %u\n"),
(unsigned int) address_size);
linep = lineendp;
continue;
if (segment_selector_size != 0)
{
- error (0, 0, gettext ("cannot handle segment selector size: %u\n"),
+ error (0, 0, _("cannot handle segment selector size: %u\n"),
(unsigned int) segment_selector_size);
linep = lineendp;
continue;
{
invalid_unit:
error (0, 0,
- gettext ("invalid data at offset %tu in section [%zu] '%s'"),
+ _("invalid data at offset %tu in section [%zu] '%s'"),
linep - (const unsigned char *) data->d_buf,
elf_ndxscn (scn), section_name (ebl, shdr));
linep = lineendp;
Dwarf_Off str_offsets_base = str_offsets_base_off (dbg, NULL);
- puts (gettext ("\nDirectory table:"));
+ puts (_("\nDirectory table:"));
if (version > 4)
{
struct encpair { uint16_t desc; uint16_t form; };
struct encpair enc[256];
- printf (gettext (" ["));
+ printf (_(" ["));
if ((size_t) (lineendp - linep) < 1)
goto invalid_data;
unsigned char directory_entry_format_count = *linep++;
if (unlikely (linep >= lineendp))
goto invalid_unit;
- puts (gettext ("\nFile name table:"));
+ puts (_("\nFile name table:"));
if (version > 4)
{
struct encpair { uint16_t desc; uint16_t form; };
struct encpair enc[256];
- printf (gettext (" ["));
+ printf (_(" ["));
if ((size_t) (lineendp - linep) < 1)
goto invalid_data;
unsigned char file_name_format_count = *linep++;
}
else
{
- puts (gettext (" Entry Dir Time Size Name"));
+ puts (_(" Entry Dir Time Size Name"));
for (unsigned int cnt = 1; linep < lineendp && *linep != 0; ++cnt)
{
/* First comes the file name. */
++linep;
}
- puts (gettext ("\nLine number statements:"));
+ puts (_("\nLine number statements:"));
Dwarf_Word address = 0;
unsigned int op_index = 0;
size_t line = 1;
if (max_ops_per_instr == 0)
{
error (0, 0,
- gettext ("invalid maximum operations per instruction is zero"));
+ _("invalid maximum operations per instruction is zero"));
linep = lineendp;
continue;
}
line += line_increment;
advance_pc ((opcode - opcode_base) / line_range);
- printf (gettext (" special opcode %u: address+%u = "),
+ printf (_(" special opcode %u: address+%u = "),
opcode, op_addr_advance);
print_dwarf_addr (dwflmod, 0, address, address);
if (show_op_index)
- printf (gettext (", op_index = %u, line%+d = %zu\n"),
+ printf (_(", op_index = %u, line%+d = %zu\n"),
op_index, line_increment, line);
else
- printf (gettext (", line%+d = %zu\n"),
+ printf (_(", line%+d = %zu\n"),
line_increment, line);
}
else if (opcode == 0)
/* The sub-opcode. */
opcode = *linep++;
- printf (gettext (" extended opcode %u: "), opcode);
+ printf (_(" extended opcode %u: "), opcode);
switch (opcode)
{
case DW_LNE_end_sequence:
- puts (gettext (" end of sequence"));
+ puts (_(" end of sequence"));
/* Reset the registers we care about. */
address = 0;
else
address = read_8ubyte_unaligned_inc (dbg, linep);
{
- printf (gettext (" set address to "));
+ printf (_(" set address to "));
print_dwarf_addr (dwflmod, 0, address, address);
printf ("\n");
}
goto invalid_unit;
get_uleb128 (filelength, linep, lineendp);
- printf (gettext ("\
+ printf (_("\
define new file: dir=%u, mtime=%" PRIu64 ", length=%" PRIu64 ", name=%s\n"),
diridx, (uint64_t) mtime, (uint64_t) filelength,
fname);
goto invalid_unit;
get_uleb128 (u128, linep, lineendp);
- printf (gettext (" set discriminator to %u\n"), u128);
+ printf (_(" set discriminator to %u\n"), u128);
break;
default:
/* Unknown, ignore it. */
- puts (gettext (" unknown opcode"));
+ puts (_(" unknown opcode"));
linep += len - 1;
break;
}
{
case DW_LNS_copy:
/* Takes no argument. */
- puts (gettext (" copy"));
+ puts (_(" copy"));
break;
case DW_LNS_advance_pc:
get_uleb128 (u128, linep, lineendp);
advance_pc (u128);
{
- printf (gettext (" advance address by %u to "),
+ printf (_(" advance address by %u to "),
op_addr_advance);
print_dwarf_addr (dwflmod, 0, address, address);
if (show_op_index)
- printf (gettext (", op_index to %u"), op_index);
+ printf (_(", op_index to %u"), op_index);
printf ("\n");
}
break;
goto invalid_unit;
get_sleb128 (s128, linep, lineendp);
line += s128;
- printf (gettext ("\
+ printf (_("\
advance line by constant %d to %" PRId64 "\n"),
s128, (int64_t) line);
break;
if (lineendp - linep < 1)
goto invalid_unit;
get_uleb128 (u128, linep, lineendp);
- printf (gettext (" set file to %" PRIu64 "\n"),
+ printf (_(" set file to %" PRIu64 "\n"),
(uint64_t) u128);
break;
goto invalid_unit;
get_uleb128 (u128, linep, lineendp);
- printf (gettext (" set column to %" PRIu64 "\n"),
+ printf (_(" set column to %" PRIu64 "\n"),
(uint64_t) u128);
break;
case DW_LNS_negate_stmt:
/* Takes no argument. */
is_stmt = 1 - is_stmt;
- printf (gettext (" set '%s' to %" PRIuFAST8 "\n"),
+ printf (_(" set '%s' to %" PRIuFAST8 "\n"),
"is_stmt", is_stmt);
break;
case DW_LNS_set_basic_block:
/* Takes no argument. */
- puts (gettext (" set basic block flag"));
+ puts (_(" set basic block flag"));
break;
case DW_LNS_const_add_pc:
advance_pc ((255 - opcode_base) / line_range);
{
- printf (gettext (" advance address by constant %u to "),
+ printf (_(" advance address by constant %u to "),
op_addr_advance);
print_dwarf_addr (dwflmod, 0, address, address);
if (show_op_index)
- printf (gettext (", op_index to %u"), op_index);
+ printf (_(", op_index to %u"), op_index);
printf ("\n");
}
break;
address += u128;
op_index = 0;
{
- printf (gettext ("\
+ printf (_("\
advance address by fixed value %u to \n"),
u128);
print_dwarf_addr (dwflmod, 0, address, address);
case DW_LNS_set_prologue_end:
/* Takes no argument. */
- puts (gettext (" set prologue end flag"));
+ puts (_(" set prologue end flag"));
break;
case DW_LNS_set_epilogue_begin:
/* Takes no argument. */
- puts (gettext (" set epilogue begin flag"));
+ puts (_(" set epilogue begin flag"));
break;
case DW_LNS_set_isa:
goto invalid_unit;
get_uleb128 (u128, linep, lineendp);
- printf (gettext (" set isa to %u\n"), u128);
+ printf (_(" set isa to %u\n"), u128);
break;
}
}
Elf_Scn *scn, GElf_Shdr *shdr,
Dwarf *dbg)
{
- printf (gettext ("\
+ printf (_("\
\nDWARF section [%2zu] '%s' at offset %#" PRIx64 ":\n"),
elf_ndxscn (scn), section_name (ebl, shdr),
(uint64_t) shdr->sh_offset);
?: elf_rawdata (scn, NULL));
if (unlikely (data == NULL))
{
- error (0, 0, gettext ("cannot get .debug_loclists content: %s"),
+ error (0, 0, _("cannot get .debug_loclists content: %s"),
elf_errmsg (-1));
return;
}
if (unlikely (readp > dataend - 4))
{
invalid_data:
- error (0, 0, gettext ("invalid data in section [%zu] '%s'"),
+ error (0, 0, _("invalid data in section [%zu] '%s'"),
elf_ndxscn (scn), section_name (ebl, shdr));
return;
}
ptrdiff_t offset = readp - (unsigned char *) data->d_buf;
- printf (gettext ("Table at Offset 0x%" PRIx64 ":\n\n"),
+ printf (_("Table at Offset 0x%" PRIx64 ":\n\n"),
(uint64_t) offset);
uint64_t unit_length = read_4ubyte_unaligned_inc (dbg, readp);
unit_length = read_8ubyte_unaligned_inc (dbg, readp);
offset_size = 8;
}
- printf (gettext (" Length: %8" PRIu64 "\n"), unit_length);
+ printf (_(" Length: %8" PRIu64 "\n"), unit_length);
/* We need at least 2-bytes + 1-byte + 1-byte + 4-bytes = 8
bytes to complete the header. And this unit cannot go beyond
const unsigned char *nexthdr = readp + unit_length;
uint16_t version = read_2ubyte_unaligned_inc (dbg, readp);
- printf (gettext (" DWARF version: %8" PRIu16 "\n"), version);
+ printf (_(" DWARF version: %8" PRIu16 "\n"), version);
if (version != 5)
{
- error (0, 0, gettext ("Unknown version"));
+ error (0, 0, _("Unknown version"));
goto next_table;
}
uint8_t address_size = *readp++;
- printf (gettext (" Address size: %8" PRIu64 "\n"),
+ printf (_(" Address size: %8" PRIu64 "\n"),
(uint64_t) address_size);
if (address_size != 4 && address_size != 8)
{
- error (0, 0, gettext ("unsupported address size"));
+ error (0, 0, _("unsupported address size"));
goto next_table;
}
uint8_t segment_size = *readp++;
- printf (gettext (" Segment size: %8" PRIu64 "\n"),
+ printf (_(" Segment size: %8" PRIu64 "\n"),
(uint64_t) segment_size);
if (segment_size != 0)
{
- error (0, 0, gettext ("unsupported segment size"));
+ error (0, 0, _("unsupported segment size"));
goto next_table;
}
uint32_t offset_entry_count = read_4ubyte_unaligned_inc (dbg, readp);
- printf (gettext (" Offset entries: %8" PRIu64 "\n"),
+ printf (_(" Offset entries: %8" PRIu64 "\n"),
(uint64_t) offset_entry_count);
/* We need the CU that uses this unit to get the initial base address. */
if (dwarf_cu_die (cu, &cudie,
NULL, NULL, NULL, NULL,
NULL, NULL) == NULL)
- printf (gettext (" Unknown CU base: "));
+ printf (_(" Unknown CU base: "));
else
- printf (gettext (" CU [%6" PRIx64 "] base: "),
+ printf (_(" CU [%6" PRIx64 "] base: "),
dwarf_dieoffset (&cudie));
print_dwarf_addr (dwflmod, address_size, cu_base, cu_base);
printf ("\n");
}
else
- printf (gettext (" Not associated with a CU.\n"));
+ printf (_(" Not associated with a CU.\n"));
printf ("\n");
if (offset_entry_count > max_entries)
{
error (0, 0,
- gettext ("too many offset entries for unit length"));
+ _("too many offset entries for unit length"));
offset_entry_count = max_entries;
}
- printf (gettext (" Offsets starting at 0x%" PRIx64 ":\n"),
+ printf (_(" Offsets starting at 0x%" PRIx64 ":\n"),
(uint64_t) (offset_array_start
- (unsigned char *) data->d_buf));
for (uint32_t idx = 0; idx < offset_entry_count; idx++)
if ((uint64_t) (nexthdr - readp) < 1)
{
invalid_entry:
- error (0, 0, gettext ("invalid loclists data"));
+ error (0, 0, _("invalid loclists data"));
goto next_table;
}
get_uleb128 (op1, readp, nexthdr);
if (readp != nexthdr)
{
size_t padding = nexthdr - readp;
- printf (gettext (" %zu padding bytes\n\n"), padding);
+ printf (_(" %zu padding bytes\n\n"), padding);
readp = nexthdr;
}
}
if (unlikely (data == NULL))
{
- error (0, 0, gettext ("cannot get .debug_loc content: %s"),
+ error (0, 0, _("cannot get .debug_loc content: %s"),
elf_errmsg (-1));
return;
}
- printf (gettext ("\
+ printf (_("\
\nDWARF section [%2zu] '%s' at offset %#" PRIx64 ":\n"),
elf_ndxscn (scn), section_name (ebl, shdr),
(uint64_t) shdr->sh_offset);
if (dwarf_cu_die (cu, &cudie,
NULL, NULL, NULL, NULL,
NULL, NULL) == NULL)
- printf (gettext ("\n Unknown CU base: "));
+ printf (_("\n Unknown CU base: "));
else
- printf (gettext ("\n CU [%6" PRIx64 "] base: "),
+ printf (_("\n CU [%6" PRIx64 "] base: "),
dwarf_dieoffset (&cudie));
print_dwarf_addr (dwflmod, address_size, base, base);
printf ("\n");
get_uleb128 (v1, locp, locendp);
if (locp >= locendp)
{
- printf (gettext (" [%6tx] <INVALID DATA>\n"), offset);
+ printf (_(" [%6tx] <INVALID DATA>\n"), offset);
break;
}
get_uleb128 (v2, locp, locendp);
&& unlikely (data->d_size - offset < (size_t) address_size * 2))
{
invalid_data:
- printf (gettext (" [%6tx] <INVALID DATA>\n"), offset);
+ printf (_(" [%6tx] <INVALID DATA>\n"), offset);
break;
}
if (begin == (Dwarf_Addr) -1l) /* Base address entry. */
{
- printf (gettext (" [%6tx] base address\n "), offset);
+ printf (_(" [%6tx] base address\n "), offset);
print_dwarf_addr (dwflmod, address_size, end, end);
printf ("\n");
base = end;
else if (begin == 0 && end == 0) /* End of list entry. */
{
if (first)
- printf (gettext (" [%6tx] empty list\n"), offset);
+ printf (_(" [%6tx] empty list\n"), offset);
first = true;
}
else
if (endp - readp <= (ptrdiff_t) len)
{
- fputs (gettext (" <INVALID DATA>\n"), stdout);
+ fputs (_(" <INVALID DATA>\n"), stdout);
break;
}
GElf_Ehdr *ehdr __attribute__ ((unused)),
Elf_Scn *scn, GElf_Shdr *shdr, Dwarf *dbg)
{
- printf (gettext ("\
+ printf (_("\
\nDWARF section [%2zu] '%s' at offset %#" PRIx64 ":\n"),
elf_ndxscn (scn), section_name (ebl, shdr),
(uint64_t) shdr->sh_offset);
?: elf_rawdata (scn, NULL));
if (unlikely (data == NULL))
{
- error (0, 0, gettext ("cannot get macro information section data: %s"),
+ error (0, 0, _("cannot get macro information section data: %s"),
elf_errmsg (-1));
return;
}
endp = memchr (readp, '\0', readendp - readp);
if (unlikely (endp == NULL))
{
- printf (gettext ("\
+ printf (_("\
%*s*** non-terminated string at end of section"),
level, "");
return;
get_uleb128 (u128, readp, readendp);
if (readendp - readp < 1)
{
- printf (gettext ("\
+ printf (_("\
%*s*** missing DW_MACINFO_start_file argument at end of section"),
level, "");
return;
GElf_Ehdr *ehdr __attribute__ ((unused)),
Elf_Scn *scn, GElf_Shdr *shdr, Dwarf *dbg)
{
- printf (gettext ("\
+ printf (_("\
\nDWARF section [%2zu] '%s' at offset %#" PRIx64 ":\n"),
elf_ndxscn (scn), section_name (ebl, shdr),
(uint64_t) shdr->sh_offset);
Elf_Data *data = elf_getdata (scn, NULL);
if (unlikely (data == NULL))
{
- error (0, 0, gettext ("cannot get macro information section data: %s"),
+ error (0, 0, _("cannot get macro information section data: %s"),
elf_errmsg (-1));
return;
}
while (readp < readendp)
{
- printf (gettext (" Offset: 0x%" PRIx64 "\n"),
+ printf (_(" Offset: 0x%" PRIx64 "\n"),
(uint64_t) (readp - (const unsigned char *) data->d_buf));
// Header, 2 byte version, 1 byte flag, optional .debug_line offset,
if (readp + 2 > readendp)
{
invalid_data:
- error (0, 0, gettext ("invalid data"));
+ error (0, 0, _("invalid data"));
return;
}
const uint16_t vers = read_2ubyte_unaligned_inc (dbg, readp);
- printf (gettext (" Version: %" PRIu16 "\n"), vers);
+ printf (_(" Version: %" PRIu16 "\n"), vers);
// Version 4 is the GNU extension for DWARF4. DWARF5 will use version
// 5 when it gets standardized.
if (vers != 4 && vers != 5)
{
- printf (gettext (" unknown version, cannot parse section\n"));
+ printf (_(" unknown version, cannot parse section\n"));
return;
}
if (readp + 1 > readendp)
goto invalid_data;
const unsigned char flag = *readp++;
- printf (gettext (" Flag: 0x%" PRIx8), flag);
+ printf (_(" Flag: 0x%" PRIx8), flag);
if (flag != 0)
{
printf (" (");
printf ("\n");
unsigned int offset_len = (flag & 0x01) ? 8 : 4;
- printf (gettext (" Offset length: %" PRIu8 "\n"), offset_len);
+ printf (_(" Offset length: %" PRIu8 "\n"), offset_len);
Dwarf_Off line_offset = -1;
if (flag & 0x02)
{
line_offset = read_8ubyte_unaligned_inc (dbg, readp);
else
line_offset = read_4ubyte_unaligned_inc (dbg, readp);
- printf (gettext (" .debug_line offset: 0x%" PRIx64 "\n"),
+ printf (_(" .debug_line offset: 0x%" PRIx64 "\n"),
line_offset);
}
if (readp + 1 > readendp)
goto invalid_data;
unsigned int tlen = *readp++;
- printf (gettext (" extension opcode table, %" PRIu8 " items:\n"),
+ printf (_(" extension opcode table, %" PRIu8 " items:\n"),
tlen);
for (unsigned int i = 0; i < tlen; i++)
{
if (readp + 1 > readendp)
goto invalid_data;
unsigned int opcode = *readp++;
- printf (gettext (" [%" PRIx8 "]"), opcode);
+ printf (_(" [%" PRIx8 "]"), opcode);
if (opcode < DW_MACRO_lo_user
|| opcode > DW_MACRO_hi_user)
goto invalid_data;
unsigned int args = *readp++;
if (args > 0)
{
- printf (gettext (" %" PRIu8 " arguments:"), args);
+ printf (_(" %" PRIu8 " arguments:"), args);
while (args > 0)
{
if (readp + 1 > readendp)
}
}
else
- printf (gettext (" no arguments."));
+ printf (_(" no arguments."));
putchar_unlocked ('\n');
}
}
{
int *np = (int *) arg;
- printf (gettext (" [%5d] DIE offset: %6" PRId64
+ printf (_(" [%5d] DIE offset: %6" PRId64
", CU DIE offset: %6" PRId64 ", name: %s\n"),
(*np)++, global->die_offset, global->cu_offset, global->name);
GElf_Ehdr *ehdr __attribute__ ((unused)),
Elf_Scn *scn, GElf_Shdr *shdr, Dwarf *dbg)
{
- printf (gettext ("\nDWARF section [%2zu] '%s' at offset %#" PRIx64 ":\n"),
+ printf (_("\nDWARF section [%2zu] '%s' at offset %#" PRIx64 ":\n"),
elf_ndxscn (scn), section_name (ebl, shdr),
(uint64_t) shdr->sh_offset);
}
digits = MAX (4, digits);
- printf (gettext ("\nDWARF section [%2zu] '%s' at offset %#" PRIx64 ":\n"
+ printf (_("\nDWARF section [%2zu] '%s' at offset %#" PRIx64 ":\n"
" %*s String\n"),
elf_ndxscn (scn),
section_name (ebl, shdr), (uint64_t) shdr->sh_offset,
const char *endp = memchr (str, '\0', sh_size - offset);
if (unlikely (endp == NULL))
{
- printf (gettext (" *** error, missing string terminator\n"));
+ printf (_(" *** error, missing string terminator\n"));
break;
}
GElf_Ehdr *ehdr __attribute__ ((unused)),
Elf_Scn *scn, GElf_Shdr *shdr, Dwarf *dbg)
{
- printf (gettext ("\
+ printf (_("\
\nDWARF section [%2zu] '%s' at offset %#" PRIx64 ":\n"),
elf_ndxscn (scn), section_name (ebl, shdr),
(uint64_t) shdr->sh_offset);
?: elf_rawdata (scn, NULL));
if (unlikely (data == NULL))
{
- error (0, 0, gettext ("cannot get .debug_str_offsets section data: %s"),
+ error (0, 0, _("cannot get .debug_str_offsets section data: %s"),
elf_errmsg (-1));
return;
}
offset_size = 4;
printf ("\n");
- printf (gettext (" Length: %8" PRIu64 "\n"),
+ printf (_(" Length: %8" PRIu64 "\n"),
unit_length);
- printf (gettext (" Offset size: %8" PRIu8 "\n"),
+ printf (_(" Offset size: %8" PRIu8 "\n"),
offset_size);
/* We need at least 2-bytes (version) + 2-bytes (padding) =
next_unitp = readp + unit_length;
version = read_2ubyte_unaligned_inc (dbg, readp);
- printf (gettext (" DWARF version: %8" PRIu16 "\n"), version);
+ printf (_(" DWARF version: %8" PRIu16 "\n"), version);
if (version != 5)
{
- error (0, 0, gettext ("Unknown version"));
+ error (0, 0, _("Unknown version"));
goto next_unit;
}
padding = read_2ubyte_unaligned_inc (dbg, readp);
- printf (gettext (" Padding: %8" PRIx16 "\n"), padding);
+ printf (_(" Padding: %8" PRIx16 "\n"), padding);
if (listptr != NULL
&& listptr->offset != (Dwarf_Off) (readp - start))
GElf_Ehdr *ehdr __attribute__ ((unused)),
Elf_Scn *scn, GElf_Shdr *shdr, Dwarf *dbg)
{
- printf (gettext ("\
+ printf (_("\
\nCall frame search table section [%2zu] '.eh_frame_hdr':\n"),
elf_ndxscn (scn));
if (unlikely (data == NULL))
{
- error (0, 0, gettext ("cannot get %s content: %s"),
+ error (0, 0, _("cannot get %s content: %s"),
".eh_frame_hdr", elf_errmsg (-1));
return;
}
if (unlikely (readp + 4 > dataend))
{
invalid_data:
- error (0, 0, gettext ("invalid data"));
+ error (0, 0, _("invalid data"));
return;
}
GElf_Shdr *shdr __attribute__ ((unused)),
Dwarf *dbg __attribute__ ((unused)))
{
- printf (gettext ("\
+ printf (_("\
\nException handling table section [%2zu] '.gcc_except_table':\n"),
elf_ndxscn (scn));
if (unlikely (data == NULL))
{
- error (0, 0, gettext ("cannot get %s content: %s"),
+ error (0, 0, _("cannot get %s content: %s"),
".gcc_except_table", elf_errmsg (-1));
return;
}
if (unlikely (readp + 1 > dataend))
{
invalid_data:
- error (0, 0, gettext ("invalid data"));
+ error (0, 0, _("invalid data"));
return;
}
unsigned int lpstart_encoding = *readp++;
- printf (gettext (" LPStart encoding: %#x "), lpstart_encoding);
+ printf (_(" LPStart encoding: %#x "), lpstart_encoding);
print_encoding_base ("", lpstart_encoding);
if (lpstart_encoding != DW_EH_PE_omit)
{
if (unlikely (readp + 1 > dataend))
goto invalid_data;
unsigned int ttype_encoding = *readp++;
- printf (gettext (" TType encoding: %#x "), ttype_encoding);
+ printf (_(" TType encoding: %#x "), ttype_encoding);
print_encoding_base ("", ttype_encoding);
const unsigned char *ttype_base = NULL;
if (ttype_encoding != DW_EH_PE_omit)
if (unlikely (readp + 1 > dataend))
goto invalid_data;
unsigned int call_site_encoding = *readp++;
- printf (gettext (" Call site encoding: %#x "), call_site_encoding);
+ printf (_(" Call site encoding: %#x "), call_site_encoding);
print_encoding_base ("", call_site_encoding);
unsigned int call_site_table_len;
get_uleb128 (call_site_table_len, readp, dataend);
while (readp < action_table)
{
if (u == 0)
- puts (gettext ("\n Call site table:"));
+ puts (_("\n Call site table:"));
uint64_t call_site_start;
readp = read_encoded (call_site_encoding, readp, dataend,
unsigned int action;
get_uleb128 (action, readp, dataend);
max_action = MAX (action, max_action);
- printf (gettext (" [%4u] Call site start: %#" PRIx64 "\n"
+ printf (_(" [%4u] Call site start: %#" PRIx64 "\n"
" Call site length: %" PRIu64 "\n"
" Landing pad: %#" PRIx64 "\n"
" Action: %u\n"),
if (max_action > maxdata || maxdata - max_action < 1)
{
invalid_action_table:
- fputs (gettext (" <INVALID DATA>\n"), stdout);
+ fputs (_(" <INVALID DATA>\n"), stdout);
return;
}
break;
default:
dsize = 0;
- error (1, 0, gettext ("invalid TType encoding"));
+ error (1, 0, _("invalid TType encoding"));
}
if (max_ar_filter
GElf_Ehdr *ehdr __attribute__ ((unused)),
Elf_Scn *scn, GElf_Shdr *shdr, Dwarf *dbg)
{
- printf (gettext ("\nGDB section [%2zu] '%s' at offset %#" PRIx64
+ printf (_("\nGDB section [%2zu] '%s' at offset %#" PRIx64
" contains %" PRId64 " bytes :\n"),
elf_ndxscn (scn), section_name (ebl, shdr),
(uint64_t) shdr->sh_offset, (uint64_t) shdr->sh_size);
if (unlikely (data == NULL))
{
- error (0, 0, gettext ("cannot get %s content: %s"),
+ error (0, 0, _("cannot get %s content: %s"),
".gdb_index", elf_errmsg (-1));
return;
}
if (unlikely (readp + 4 > dataend))
{
invalid_data:
- error (0, 0, gettext ("invalid data"));
+ error (0, 0, _("invalid data"));
return;
}
int32_t vers = read_4ubyte_unaligned (dbg, readp);
- printf (gettext (" Version: %" PRId32 "\n"), vers);
+ printf (_(" Version: %" PRId32 "\n"), vers);
// The only difference between version 4 and version 5 is the
// hash used for generating the table. Version 6 contains symbols
// TUs for symbols.
if (vers < 4 || vers > 8)
{
- printf (gettext (" unknown version, cannot parse section\n"));
+ printf (_(" unknown version, cannot parse section\n"));
return;
}
goto invalid_data;
uint32_t cu_off = read_4ubyte_unaligned (dbg, readp);
- printf (gettext (" CU offset: %#" PRIx32 "\n"), cu_off);
+ printf (_(" CU offset: %#" PRIx32 "\n"), cu_off);
readp += 4;
if (unlikely (readp + 4 > dataend))
goto invalid_data;
uint32_t tu_off = read_4ubyte_unaligned (dbg, readp);
- printf (gettext (" TU offset: %#" PRIx32 "\n"), tu_off);
+ printf (_(" TU offset: %#" PRIx32 "\n"), tu_off);
readp += 4;
if (unlikely (readp + 4 > dataend))
goto invalid_data;
uint32_t addr_off = read_4ubyte_unaligned (dbg, readp);
- printf (gettext (" address offset: %#" PRIx32 "\n"), addr_off);
+ printf (_(" address offset: %#" PRIx32 "\n"), addr_off);
readp += 4;
if (unlikely (readp + 4 > dataend))
goto invalid_data;
uint32_t sym_off = read_4ubyte_unaligned (dbg, readp);
- printf (gettext (" symbol offset: %#" PRIx32 "\n"), sym_off);
+ printf (_(" symbol offset: %#" PRIx32 "\n"), sym_off);
readp += 4;
if (unlikely (readp + 4 > dataend))
goto invalid_data;
uint32_t const_off = read_4ubyte_unaligned (dbg, readp);
- printf (gettext (" constant offset: %#" PRIx32 "\n"), const_off);
+ printf (_(" constant offset: %#" PRIx32 "\n"), const_off);
if (unlikely ((size_t) (dataend - (const unsigned char *) data->d_buf)
< const_off))
size_t cu_nr = (nextp - readp) / 16;
- printf (gettext ("\n CU list at offset %#" PRIx32
+ printf (_("\n CU list at offset %#" PRIx32
" contains %zu entries:\n"),
cu_off, cu_nr);
size_t tu_nr = (nextp - readp) / 24;
- printf (gettext ("\n TU list at offset %#" PRIx32
+ printf (_("\n TU list at offset %#" PRIx32
" contains %zu entries:\n"),
tu_off, tu_nr);
size_t addr_nr = (nextp - readp) / 20;
- printf (gettext ("\n Address list at offset %#" PRIx32
+ printf (_("\n Address list at offset %#" PRIx32
" contains %zu entries:\n"),
addr_off, addr_nr);
nextp = const_start;
size_t sym_nr = (nextp - readp) / 8;
- printf (gettext ("\n Symbol table at offset %#" PRIx32
+ printf (_("\n Symbol table at offset %#" PRIx32
" contains %zu slots:\n"),
addr_off, sym_nr);
if (dbg == NULL)
{
if ((print_debug_sections & ~section_exception) != 0)
- error (0, 0, gettext ("cannot get debug context descriptor: %s"),
+ error (0, 0, _("cannot get debug context descriptor: %s"),
dwfl_errmsg (-1));
dbg = &dummy_dbg;
}
size_t shstrndx;
if (unlikely (elf_getshdrstrndx (ebl->elf, &shstrndx) < 0))
error (EXIT_FAILURE, 0,
- gettext ("cannot get section header string table index"));
+ _("cannot get section header string table index"));
/* If the .debug_info section is listed as implicitly required then
we must make sure to handle it before handling any other debug
(&valuedata, &indata, elf_getident (core, NULL)[EI_DATA]);
if (d == NULL)
error (EXIT_FAILURE, 0,
- gettext ("cannot convert core note data: %s"), elf_errmsg (-1));
+ _("cannot convert core note data: %s"), elf_errmsg (-1));
return data + indata.d_size;
}
descsz += eltsz;
}
else if (reps > 1)
- printf (gettext ("\n%*s... <repeats %u more times> ..."),
+ printf (_("\n%*s... <repeats %u more times> ..."),
ITEM_INDENT, "", reps);
last = desc;
if (data == NULL)
elf_error:
error (EXIT_FAILURE, 0,
- gettext ("cannot convert core note data: %s"), elf_errmsg (-1));
+ _("cannot convert core note data: %s"), elf_errmsg (-1));
const size_t nauxv = descsz / gelf_fsize (core, ELF_T_AUXV, 1, EV_CURRENT);
for (size_t i = 0; i < nauxv; ++i)
Elf_Data *data = elf_getdata_rawchunk (core, desc_pos, descsz, ELF_T_BYTE);
if (data == NULL)
error (EXIT_FAILURE, 0,
- gettext ("cannot convert core note data: %s"), elf_errmsg (-1));
+ _("cannot convert core note data: %s"), elf_errmsg (-1));
unsigned char const *ptr = data->d_buf;
unsigned char const *const end = data->d_buf + data->d_size;
Elf_Data *data = elf_getdata_rawchunk (core, desc_pos, descsz, ELF_T_BYTE);
if (data == NULL)
error (EXIT_FAILURE, 0,
- gettext ("cannot convert core note data: %s"), elf_errmsg (-1));
+ _("cannot convert core note data: %s"), elf_errmsg (-1));
unsigned char const *ptr = data->d_buf;
unsigned char const *const end = data->d_buf + data->d_size;
handle_notes_data (Ebl *ebl, const GElf_Ehdr *ehdr,
GElf_Off start, Elf_Data *data)
{
- fputs_unlocked (gettext (" Owner Data size Type\n"), stdout);
+ fputs_unlocked (_(" Owner Data size Type\n"), stdout);
if (data == NULL)
goto bad_note;
char buf[100];
char buf2[100];
- printf (gettext (" %-13.*s %9" PRId32 " %s\n"),
+ printf (_(" %-13.*s %9" PRId32 " %s\n"),
(int) print_namesz, print_name, nhdr.n_descsz,
ehdr->e_type == ET_CORE
? ebl_core_note_type_name (ebl, nhdr.n_type,
bad_note:
error (0, 0,
- gettext ("cannot get content of note: %s"),
+ _("cannot get content of note: %s"),
data != NULL ? "garbage data" : elf_errmsg (-1));
}
size_t shstrndx;
if (elf_getshdrstrndx (ebl->elf, &shstrndx) < 0)
error (EXIT_FAILURE, 0,
- gettext ("cannot get section header string table index"));
+ _("cannot get section header string table index"));
Elf_Scn *scn = NULL;
while ((scn = elf_nextscn (ebl->elf, scn)) != NULL)
continue;
}
- printf (gettext ("\
+ printf (_("\
\nNote section [%2zu] '%s' of %" PRIu64 " bytes at offset %#0" PRIx64 ":\n"),
elf_ndxscn (scn),
elf_strptr (ebl->elf, shstrndx, shdr->sh_name),
/* Not what we are looking for. */
continue;
- printf (gettext ("\
+ printf (_("\
\nNote segment of %" PRIu64 " bytes at offset %#0" PRIx64 ":\n"),
phdr->p_filesz, phdr->p_offset);
dump_data_section (Elf_Scn *scn, const GElf_Shdr *shdr, const char *name)
{
if (shdr->sh_size == 0 || shdr->sh_type == SHT_NOBITS)
- printf (gettext ("\nSection [%zu] '%s' has no data to dump.\n"),
+ printf (_("\nSection [%zu] '%s' has no data to dump.\n"),
elf_ndxscn (scn), name);
else
{
{
if (elf_compress (scn, 0, 0) < 0)
printf ("WARNING: %s [%zd]\n",
- gettext ("Couldn't uncompress section"),
+ _("Couldn't uncompress section"),
elf_ndxscn (scn));
}
else if (strncmp (name, ".zdebug", strlen (".zdebug")) == 0)
{
if (elf_compress_gnu (scn, 0, 0) < 0)
printf ("WARNING: %s [%zd]\n",
- gettext ("Couldn't uncompress section"),
+ _("Couldn't uncompress section"),
elf_ndxscn (scn));
}
}
Elf_Data *data = elf_rawdata (scn, NULL);
if (data == NULL)
- error (0, 0, gettext ("cannot get data for section [%zu] '%s': %s"),
+ error (0, 0, _("cannot get data for section [%zu] '%s': %s"),
elf_ndxscn (scn), name, elf_errmsg (-1));
else
{
if (data->d_size == shdr->sh_size)
- printf (gettext ("\nHex dump of section [%zu] '%s', %" PRIu64
+ printf (_("\nHex dump of section [%zu] '%s', %" PRIu64
" bytes at offset %#0" PRIx64 ":\n"),
elf_ndxscn (scn), name,
shdr->sh_size, shdr->sh_offset);
else
- printf (gettext ("\nHex dump of section [%zu] '%s', %" PRIu64
+ printf (_("\nHex dump of section [%zu] '%s', %" PRIu64
" bytes (%zd uncompressed) at offset %#0"
PRIx64 ":\n"),
elf_ndxscn (scn), name,
print_string_section (Elf_Scn *scn, const GElf_Shdr *shdr, const char *name)
{
if (shdr->sh_size == 0 || shdr->sh_type == SHT_NOBITS)
- printf (gettext ("\nSection [%zu] '%s' has no strings to dump.\n"),
+ printf (_("\nSection [%zu] '%s' has no strings to dump.\n"),
elf_ndxscn (scn), name);
else
{
{
if (elf_compress (scn, 0, 0) < 0)
printf ("WARNING: %s [%zd]\n",
- gettext ("Couldn't uncompress section"),
+ _("Couldn't uncompress section"),
elf_ndxscn (scn));
}
else if (strncmp (name, ".zdebug", strlen (".zdebug")) == 0)
{
if (elf_compress_gnu (scn, 0, 0) < 0)
printf ("WARNING: %s [%zd]\n",
- gettext ("Couldn't uncompress section"),
+ _("Couldn't uncompress section"),
elf_ndxscn (scn));
}
}
Elf_Data *data = elf_rawdata (scn, NULL);
if (data == NULL)
- error (0, 0, gettext ("cannot get data for section [%zu] '%s': %s"),
+ error (0, 0, _("cannot get data for section [%zu] '%s': %s"),
elf_ndxscn (scn), name, elf_errmsg (-1));
else
{
if (data->d_size == shdr->sh_size)
- printf (gettext ("\nString section [%zu] '%s' contains %" PRIu64
+ printf (_("\nString section [%zu] '%s' contains %" PRIu64
" bytes at offset %#0" PRIx64 ":\n"),
elf_ndxscn (scn), name,
shdr->sh_size, shdr->sh_offset);
else
- printf (gettext ("\nString section [%zu] '%s' contains %" PRIu64
+ printf (_("\nString section [%zu] '%s' contains %" PRIu64
" bytes (%zd uncompressed) at offset %#0"
PRIx64 ":\n"),
elf_ndxscn (scn), name,
size_t shstrndx;
if (elf_getshdrstrndx (elf, &shstrndx) < 0)
error (EXIT_FAILURE, 0,
- gettext ("cannot get section header string table index"));
+ _("cannot get section header string table index"));
for (const struct section_argument *a = list; a != NULL; a = a->next)
{
scn = elf_getscn (elf, shndx);
if (scn == NULL)
{
- error (0, 0, gettext ("\nsection [%lu] does not exist"), shndx);
+ error (0, 0, _("\nsection [%lu] does not exist"), shndx);
continue;
}
if (gelf_getshdr (scn, &shdr_mem) == NULL)
- error (EXIT_FAILURE, 0, gettext ("cannot get section header: %s"),
+ error (EXIT_FAILURE, 0, _("cannot get section header: %s"),
elf_errmsg (-1));
name = elf_strptr (elf, shstrndx, shdr_mem.sh_name);
(*dump) (scn, &shdr_mem, name);
}
if (unlikely (!found) && !a->implicit)
- error (0, 0, gettext ("\nsection '%s' does not exist"), a->arg);
+ error (0, 0, _("\nsection '%s' does not exist"), a->arg);
}
}
}
size_t shstrndx;
if (unlikely (elf_getshdrstrndx (ebl->elf, &shstrndx) < 0))
error (EXIT_FAILURE, 0,
- gettext ("cannot get section header string table index"));
+ _("cannot get section header string table index"));
Elf_Scn *scn;
GElf_Shdr shdr_mem;
int result = elf_errno ();
if (unlikely (result != ELF_E_NO_INDEX))
error (EXIT_FAILURE, 0,
- gettext ("cannot get symbol index of archive '%s': %s"),
+ _("cannot get symbol index of archive '%s': %s"),
fname, elf_errmsg (result));
else
- printf (gettext ("\nArchive '%s' has no symbol index\n"), fname);
+ printf (_("\nArchive '%s' has no symbol index\n"), fname);
return;
}
- printf (gettext ("\nIndex of archive '%s' has %zu entries:\n"),
+ printf (_("\nIndex of archive '%s' has %zu entries:\n"),
fname, narsym);
size_t as_off = 0;
while (1)
#endif
error (EXIT_FAILURE, 0,
- gettext ("cannot extract member at offset %zu in '%s': %s"),
+ _("cannot extract member at offset %zu in '%s': %s"),
as_off, fname, elf_errmsg (-1));
const Elf_Arhdr *h = elf_getarhdr (subelf);
- printf (gettext ("Archive member '%s' contains:\n"), h->ar_name);
+ printf (_("Archive member '%s' contains:\n"), h->ar_name);
elf_end (subelf);
}
static void show_bsd_totals (void);
#define INTERNAL_ERROR(fname) \
- error (EXIT_FAILURE, 0, gettext ("%s: INTERNAL ERROR %d (%s): %s"), \
+ error (EXIT_FAILURE, 0, _("%s: INTERNAL ERROR %d (%s): %s"), \
fname, __LINE__, PACKAGE_VERSION, elf_errmsg (-1))
else if (likely (strcmp (arg, "sysv") == 0))
format = format_sysv;
else
- error (EXIT_FAILURE, 0, gettext ("Invalid format: %s"), arg);
+ error (EXIT_FAILURE, 0, _("Invalid format: %s"), arg);
break;
case OPT_RADIX:
else if (strcmp (arg, "o") == 0 || strcmp (arg, "8") == 0)
radix = radix_octal;
else
- error (EXIT_FAILURE, 0, gettext ("Invalid radix: %s"), arg);
+ error (EXIT_FAILURE, 0, _("Invalid radix: %s"), arg);
break;
case 't':
int fd = open (fname, O_RDONLY);
if (unlikely (fd == -1))
{
- error (0, errno, gettext ("cannot open '%s'"), fname);
+ error (0, errno, _("cannot open '%s'"), fname);
return 1;
}
INTERNAL_ERROR (fname);
if (unlikely (close (fd) != 0))
- error (EXIT_FAILURE, errno, gettext ("while closing '%s'"), fname);
+ error (EXIT_FAILURE, errno, _("while closing '%s'"), fname);
return 0;
}
int result = handle_ar (fd, elf, NULL, fname);
if (unlikely (close (fd) != 0))
- error (EXIT_FAILURE, errno, gettext ("while closing '%s'"), fname);
+ error (EXIT_FAILURE, errno, _("while closing '%s'"), fname);
return result;
}
}
if (unlikely (close (fd) != 0))
- error (EXIT_FAILURE, errno, gettext ("while closing '%s'"), fname);
+ error (EXIT_FAILURE, errno, _("while closing '%s'"), fname);
- error (0, 0, gettext ("%s: file format not recognized"), fname);
+ error (0, 0, _("%s: file format not recognized"), fname);
return 1;
}
size_t shstrndx;
if (unlikely (elf_getshdrstrndx (elf, &shstrndx) < 0))
error (EXIT_FAILURE, 0,
- gettext ("cannot get section header string table index"));
+ _("cannot get section header string table index"));
/* First round over the sections: determine the longest section name. */
Elf_Scn *scn = NULL;
fputs_unlocked (fname, stdout);
if (prefix != NULL)
- printf (gettext (" (ex %s)"), prefix);
+ printf (_(" (ex %s)"), prefix);
printf (":\n%-*s %*s %*s\n",
maxlen, sgettext ("sysv|section"),
digits - 2, sgettext ("sysv|size"),
size_t shstrndx;
if (unlikely (elf_getshdrstrndx (elf, &shstrndx) < 0))
error (EXIT_FAILURE, 0,
- gettext ("cannot get section header string table index"));
+ _("cannot get section header string table index"));
/* Iterate over all sections. */
GElf_Off total = 0;
GElf_Shdr *shdr = gelf_getshdr (scn, &shdr_mem);
if (unlikely (shdr == NULL))
- error (EXIT_FAILURE, 0, gettext ("cannot get section header"));
+ error (EXIT_FAILURE, 0, _("cannot get section header"));
/* Ignore all sections which are not used at runtime. */
if ((shdr->sh_flags & SHF_ALLOC) == 0)
xdigits - 2, textsize + datasize + bsssize,
fname);
if (prefix != NULL)
- printf (gettext (" (ex %s)"), prefix);
+ printf (_(" (ex %s)"), prefix);
fputs_unlocked ("\n", stdout);
total_textsize += textsize;
ddigits - 2, total_bsssize,
ddigits - 2, total_textsize + total_datasize + total_bsssize,
xdigits - 2, total_textsize + total_datasize + total_bsssize,
- gettext ("(TOTALS)\n"));
+ _("(TOTALS)\n"));
}
? STDIN_FILENO : open (argv[remaining], O_RDONLY));
if (unlikely (fd == -1))
{
- error (0, errno, gettext ("cannot open '%s'"), argv[remaining]);
+ error (0, errno, _("cannot open '%s'"), argv[remaining]);
result = 1;
}
else
break;
default:
- error (0, 0, gettext ("invalid value '%s' for %s parameter"),
+ error (0, 0, _("invalid value '%s' for %s parameter"),
arg, "-e");
argp_help (&argp, stderr, ARGP_HELP_SEE, "strings");
return ARGP_ERR_UNKNOWN;
break;
default:
- error (0, 0, gettext ("invalid value '%s' for %s parameter"),
+ error (0, 0, _("invalid value '%s' for %s parameter"),
arg, "-t");
argp_help (&argp, stderr, ARGP_HELP_SEE, "strings");
return ARGP_ERR_UNKNOWN;
/* Compute the length in bytes of any match. */
if (min_len <= 0 || min_len > INT_MAX / bytes_per_char)
error (EXIT_FAILURE, 0,
- gettext ("invalid minimum length of matched string size"));
+ _("invalid minimum length of matched string size"));
min_len_bytes = min_len * bytes_per_char;
break;
// XXX Eventually add flag which avoids this if the position
// XXX is known to match.
if (from != 0 && lseek (fd, from, SEEK_SET) != from)
- error (EXIT_FAILURE, errno, gettext ("lseek failed"));
+ error (EXIT_FAILURE, errno, _("lseek failed"));
return read_block_no_mmap (fd, fname, from, to - from);
}
if (mmap (elfmap, elfmap_size, PROT_READ,
MAP_PRIVATE | MAP_POPULATE | MAP_FIXED, fd, from)
== MAP_FAILED)
- error (EXIT_FAILURE, errno, gettext ("re-mmap failed"));
+ error (EXIT_FAILURE, errno, _("re-mmap failed"));
elfmap_base = elfmap;
}
and for this we have to make the data writable. */
if (unlikely (mprotect (elfmap, keep_area, PROT_READ | PROT_WRITE)
!= 0))
- error (EXIT_FAILURE, errno, gettext ("mprotect failed"));
+ error (EXIT_FAILURE, errno, _("mprotect failed"));
elfmap_base = elfmap + keep_area;
}
if (mmap (remap_base, read_now, PROT_READ,
MAP_PRIVATE | MAP_POPULATE | MAP_FIXED, fd, handled_to)
== MAP_FAILED)
- error (EXIT_FAILURE, errno, gettext ("re-mmap failed"));
+ error (EXIT_FAILURE, errno, _("re-mmap failed"));
elfmap_off = handled_to;
process_chunk (fname, remap_base - to_keep,
else
sname = elf_strptr (elf, strndx, shdr->sh_name) ?: "<unknown>";
error (0, 0,
- gettext ("Skipping section %zd '%s' data outside file"),
+ _("Skipping section %zd '%s' data outside file"),
elf_ndxscn (scn), sname);
result = 1;
}
#define INTERNAL_ERROR(fname) \
do { \
cleanup_debug (); \
- error (EXIT_FAILURE, 0, gettext ("%s: INTERNAL ERROR %d (%s): %s"), \
+ error (EXIT_FAILURE, 0, _("%s: INTERNAL ERROR %d (%s): %s"), \
fname, __LINE__, PACKAGE_VERSION, elf_errmsg (-1)); \
} while (0)
if (reloc_debug && debug_fname == NULL)
error (EXIT_FAILURE, 0,
- gettext ("--reloc-debug-sections used without -f"));
+ _("--reloc-debug-sections used without -f"));
if (reloc_debug_only &&
(debug_fname != NULL || remove_secs != NULL
|| remove_comment == true || remove_debug == true))
error (EXIT_FAILURE, 0,
- gettext ("--reloc-debug-sections-only incompatible with -f, -g, --remove-comment and --remove-section"));
+ _("--reloc-debug-sections-only incompatible with -f, -g, --remove-comment and --remove-section"));
/* Tell the library which version we are expecting. */
elf_version (EV_CURRENT);
input file. */
if ((output_fname != NULL || debug_fname != NULL)
&& remaining + 1 < argc)
- error (EXIT_FAILURE, 0, gettext ("\
+ error (EXIT_FAILURE, 0, _("\
Only one input file allowed together with '-o' and '-f'"));
/* Process all the remaining files. */
case 'f':
if (debug_fname != NULL)
{
- error (0, 0, gettext ("-f option specified twice"));
+ error (0, 0, _("-f option specified twice"));
return EINVAL;
}
debug_fname = arg;
case 'F':
if (debug_fname_embed != NULL)
{
- error (0, 0, gettext ("-F option specified twice"));
+ error (0, 0, _("-F option specified twice"));
return EINVAL;
}
debug_fname_embed = arg;
case 'o':
if (output_fname != NULL)
{
- error (0, 0, gettext ("-o option specified twice"));
+ error (0, 0, _("-o option specified twice"));
return EINVAL;
}
output_fname = arg;
&& section_name_matches (keep_secs, ".comment"))
{
argp_error (state,
- gettext ("cannot both keep and remove .comment section"));
+ _("cannot both keep and remove .comment section"));
return EINVAL;
}
break;
|| tdata->d_size - offset < size)
{
cleanup_debug ();
- error (EXIT_FAILURE, 0, gettext ("bad relocation"));
+ error (EXIT_FAILURE, 0, _("bad relocation"));
}
/* When the symbol value is zero then for SHT_REL
{
if (stat (fname, &pre_st) != 0)
{
- error (0, errno, gettext ("cannot stat input file '%s'"), fname);
+ error (0, errno, _("cannot stat input file '%s'"), fname);
return 1;
}
int fd = open (fname, output_fname == NULL ? O_RDWR : O_RDONLY);
if (fd == -1)
{
- error (0, errno, gettext ("while opening '%s'"), fname);
+ error (0, errno, _("while opening '%s'"), fname);
return 1;
}
struct stat st;
if (fstat (fd, &st) != 0)
{
- error (0, errno, gettext ("cannot stat input file '%s'"), fname);
+ error (0, errno, _("cannot stat input file '%s'"), fname);
return 1;
}
/* Paranoid mode on. */
the output to a specific file. */
if (unlikely (output_fname != NULL || debug_fname != NULL))
{
- error (0, 0, gettext ("%s: cannot use -o or -f when stripping archive"),
+ error (0, 0, _("%s: cannot use -o or -f when stripping archive"),
fname);
result = 1;
}
result = handle_ar (fd, elf, NULL, fname,
preserve_dates ? tv : NULL);
*/
- error (0, 0, gettext ("%s: no support for stripping archive"),
+ error (0, 0, _("%s: no support for stripping archive"),
fname);
result = 1;
}
break;
default:
- error (0, 0, gettext ("%s: File format not recognized"), fname);
+ error (0, 0, _("%s: File format not recognized"), fname);
result = 1;
break;
}
fd = open (output_fname, O_RDWR | O_CREAT, mode);
if (unlikely (fd == -1))
{
- error (0, errno, gettext ("cannot open '%s'"), output_fname);
+ error (0, errno, _("cannot open '%s'"), output_fname);
return 1;
}
}
ebl = ebl_openbackend (elf);
if (ebl == NULL)
{
- error (0, errno, gettext ("cannot open EBL backend"));
+ error (0, errno, _("cannot open EBL backend"));
result = 1;
goto fail;
}
debug_fd = mkstemp (tmp_debug_fname);
if (unlikely (debug_fd == -1))
{
- error (0, errno, gettext ("cannot open '%s'"), debug_fname);
+ error (0, errno, _("cannot open '%s'"), debug_fname);
result = 1;
goto fail;
}
{
cleanup_debug ();
error (EXIT_FAILURE, 0,
- gettext ("cannot get section header string table index"));
+ _("cannot get section header string table index"));
}
/* Get the number of phdrs in the old file. */
if (elf_getphdrnum (elf, &phnum) != 0)
{
cleanup_debug ();
- error (EXIT_FAILURE, 0, gettext ("cannot get number of phdrs"));
+ error (EXIT_FAILURE, 0, _("cannot get number of phdrs"));
}
/* We now create a new ELF descriptor for the same file. We
if (unlikely (gelf_newehdr (newelf, gelf_getclass (elf)) == 0))
{
- error (0, 0, gettext ("cannot create new ehdr for file '%s': %s"),
+ error (0, 0, _("cannot create new ehdr for file '%s': %s"),
output_fname ?: fname, elf_errmsg (-1));
goto fail;
}
{
if (unlikely (gelf_newphdr (newelf, phnum) == 0))
{
- error (0, 0, gettext ("cannot create new phdr for file '%s': %s"),
+ error (0, 0, _("cannot create new phdr for file '%s': %s"),
output_fname ?: fname, elf_errmsg (-1));
goto fail;
}
debugelf = elf_begin (debug_fd, ELF_C_WRITE, NULL);
if (unlikely (gelf_newehdr (debugelf, gelf_getclass (elf)) == 0))
{
- error (0, 0, gettext ("cannot create new ehdr for file '%s': %s"),
+ error (0, 0, _("cannot create new ehdr for file '%s': %s"),
debug_fname, elf_errmsg (-1));
goto fail_close;
}
{
if (unlikely (gelf_newphdr (debugelf, phnum) == 0))
{
- error (0, 0, gettext ("cannot create new phdr for file '%s': %s"),
+ error (0, 0, _("cannot create new phdr for file '%s': %s"),
debug_fname, elf_errmsg (-1));
goto fail_close;
}
size_t shnum;
if (unlikely (elf_getshdrnum (elf, &shnum) < 0))
{
- error (0, 0, gettext ("cannot determine number of sections: %s"),
+ error (0, 0, _("cannot determine number of sections: %s"),
elf_errmsg (-1));
goto fail_close;
}
if (shdr_info[cnt].name == NULL)
{
illformed:
- error (0, 0, gettext ("illformed file '%s'"), fname);
+ error (0, 0, _("illformed file '%s'"), fname);
goto fail_close;
}
if ((shdr_info[cnt].shdr.sh_flags & SHF_ALLOC) != 0)
{
error (0, 0,
- gettext ("Cannot remove allocated section '%s'"),
+ _("Cannot remove allocated section '%s'"),
shdr_info[cnt].name);
result = 1;
goto fail_close;
if (section_name_matches (keep_secs, shdr_info[cnt].name))
{
error (0, 0,
- gettext ("Cannot both keep and remove section '%s'"),
+ _("Cannot both keep and remove section '%s'"),
shdr_info[cnt].name);
result = 1;
goto fail_close;
{
cleanup_debug ();
error (EXIT_FAILURE, 0,
- gettext ("while generating output file: %s"),
+ _("while generating output file: %s"),
elf_errmsg (-1));
}
if (unlikely (gelf_update_ehdr (debugelf, debugehdr) == 0))
{
- error (0, 0, gettext ("%s: error while updating ELF header: %s"),
+ error (0, 0, _("%s: error while updating ELF header: %s"),
debug_fname, elf_errmsg (-1));
result = 1;
goto fail_close;
size_t shdrstrndx;
if (elf_getshdrstrndx (elf, &shdrstrndx) < 0)
{
- error (0, 0, gettext ("%s: error while getting shdrstrndx: %s"),
+ error (0, 0, _("%s: error while getting shdrstrndx: %s"),
fname, elf_errmsg (-1));
result = 1;
goto fail_close;
if (update_shdrstrndx (debugelf, shdrstrndx) != 0)
{
- error (0, 0, gettext ("%s: error updating shdrstrndx: %s"),
+ error (0, 0, _("%s: error updating shdrstrndx: %s"),
debug_fname, elf_errmsg (-1));
result = 1;
goto fail_close;
if (shst == NULL)
{
cleanup_debug ();
- error (EXIT_FAILURE, errno, gettext ("while preparing output for '%s'"),
+ error (EXIT_FAILURE, errno, _("while preparing output for '%s'"),
output_fname ?: fname);
}
{
cleanup_debug ();
error (EXIT_FAILURE, 0,
- gettext ("while generating output file: %s"),
+ _("while generating output file: %s"),
elf_errmsg (-1));
}
{
cleanup_debug ();
error (EXIT_FAILURE, 0,
- gettext ("while create section header section: %s"),
+ _("while create section header section: %s"),
elf_errmsg (-1));
}
elf_assert (elf_ndxscn (shdr_info[cnt].newscn) == shdr_info[cnt].idx);
if (shdr_info[cnt].data == NULL)
{
cleanup_debug ();
- error (EXIT_FAILURE, 0, gettext ("cannot allocate section data: %s"),
+ error (EXIT_FAILURE, 0, _("cannot allocate section data: %s"),
elf_errmsg (-1));
}
{
cleanup_debug ();
error (EXIT_FAILURE, 0,
- gettext ("while create section header section: %s"),
+ _("while create section header section: %s"),
elf_errmsg (-1));
}
elf_assert (elf_ndxscn (shdr_info[cnt].newscn) == idx);
{
cleanup_debug ();
error (EXIT_FAILURE, 0,
- gettext ("while create section header string table: %s"),
+ _("while create section header string table: %s"),
elf_errmsg (-1));
}
if (dwelf_strtab_finalize (shst, shstrtab_data) == NULL)
{
cleanup_debug ();
error (EXIT_FAILURE, 0,
- gettext ("no memory to create section header string table"));
+ _("no memory to create section header string table"));
}
/* We have to set the section size. */
sections. Just warn and set the symbol
section to UNDEF. */
error (0, 0,
- gettext ("Cannot remove symbol [%zd] from allocated symbol table [%zd]"), inner, cnt);
+ _("Cannot remove symbol [%zd] from allocated symbol table [%zd]"), inner, cnt);
sym->st_shndx = SHN_UNDEF;
if (gelf_update_sym (shdr_info[cnt].data, destidx,
sym) == 0)
/* Finally write the file. */
if (unlikely (elf_update (debugelf, ELF_C_WRITE) == -1))
{
- error (0, 0, gettext ("while writing '%s': %s"),
+ error (0, 0, _("while writing '%s': %s"),
tmp_debug_fname, elf_errmsg (-1));
result = 1;
goto fail_close;
if (rename (tmp_debug_fname, debug_fname) != 0
|| fchmod (debug_fd, mode) != 0)
{
- error (0, errno, gettext ("while creating '%s'"), debug_fname);
+ error (0, errno, _("while creating '%s'"), debug_fname);
result = 1;
goto fail_close;
}
/* Compute the checksum which we will add to the executable. */
if (crc32_file (debug_fd, &debug_crc) != 0)
{
- error (0, errno, gettext ("\
+ error (0, errno, _("\
while computing checksum for debug information"));
unlink (debug_fname);
result = 1;
if (gelf_update_ehdr (newelf, newehdr) == 0)
{
- error (0, 0, gettext ("%s: error while creating ELF header: %s"),
+ error (0, 0, _("%s: error while creating ELF header: %s"),
output_fname ?: fname, elf_errmsg (-1));
cleanup_debug ();
return 1;
/* The new section header string table index. */
if (update_shdrstrndx (newelf, idx) != 0)
{
- error (0, 0, gettext ("%s: error updating shdrstrndx: %s"),
+ error (0, 0, _("%s: error updating shdrstrndx: %s"),
output_fname ?: fname, elf_errmsg (-1));
cleanup_debug ();
return 1;
/* We have everything from the old file. */
if (elf_cntl (elf, ELF_C_FDDONE) != 0)
{
- error (0, 0, gettext ("%s: error while reading the file: %s"),
+ error (0, 0, _("%s: error while reading the file: %s"),
fname, elf_errmsg (-1));
cleanup_debug ();
return 1;
/* Finally write the file. */
if (elf_update (newelf, ELF_C_WRITE) == -1)
{
- error (0, 0, gettext ("while writing '%s': %s"),
+ error (0, 0, _("while writing '%s': %s"),
output_fname ?: fname, elf_errmsg (-1));
result = 1;
}
!= sizeof zero)
|| ftruncate (fd, lastsec_offset) < 0)
{
- error (0, errno, gettext ("while writing '%s'"),
+ error (0, errno, _("while writing '%s'"),
output_fname ?: fname);
result = 1;
}
!= sizeof zero)
|| ftruncate (fd, lastsec_offset) < 0)
{
- error (0, errno, gettext ("while writing '%s'"),
+ error (0, errno, _("while writing '%s'"),
output_fname ?: fname);
result = 1;
}
/* That was it. Close the descriptors. */
if (elf_end (newelf) != 0)
{
- error (0, 0, gettext ("error while finishing '%s': %s"),
+ error (0, 0, _("error while finishing '%s': %s"),
output_fname ?: fname, elf_errmsg (-1));
result = 1;
}
if (debugelf != NULL && elf_end (debugelf) != 0)
{
- error (0, 0, gettext ("error while finishing '%s': %s"), debug_fname,
+ error (0, 0, _("error while finishing '%s': %s"), debug_fname,
elf_errmsg (-1));
result = 1;
}
{
if (futimens (fd, tvp) != 0)
{
- error (0, errno, gettext ("\
+ error (0, errno, _("\
cannot set access and modification date of '%s'"),
output_fname ?: fname);
result = 1;
{
if (unlikely (futimens (fd, tvp) != 0))
{
- error (0, errno, gettext ("\
+ error (0, errno, _("\
cannot set access and modification date of '%s'"), fname);
result = 1;
}
}
if (unlikely (close (fd) != 0))
- error (EXIT_FAILURE, errno, gettext ("while closing '%s'"), fname);
+ error (EXIT_FAILURE, errno, _("while closing '%s'"), fname);
return result;
}
#include "printversion.h"
#ifndef _
-# define _(str) gettext (str)
+# define _(str) _(str)
#endif
/* Name and version of program. */