+2018-06-04 Mark Wielaard <mark@klomp.org>
+
+ * readelf.c (yes_str): New static char pointer.
+ (no_str): Likewise.
+ (main): Set yes_str and no_str using gettext.
+ (attr_callback): Use yes_str and no_str instead of calling gettext.
+
2018-06-04 Mark Wielaard <mark@klomp.org>
* readelf.c (main): Call __fsetlocking (stdout, FSETLOCKING_BYCALLER).
static void dump_archive_index (Elf *, const char *);
+/* Looked up once with gettext in main. */
+static char *yes_str;
+static char *no_str;
+
int
main (int argc, char *argv[])
{
/* Initialize the message catalog. */
textdomain (PACKAGE_TARNAME);
+ /* Look up once. */
+ yes_str = gettext ("yes");
+ no_str = gettext ("yes");
+
/* Parse and process arguments. */
int remaining;
argp_parse (&argp, argc, argv, 0, &remaining, NULL);
printf (" %*s%-20s (%s) %s\n",
(int) (level * 2), "", dwarf_attr_name (attr),
- dwarf_form_name (form), flag ? gettext ("yes") : gettext ("no"));
+ dwarf_form_name (form), flag ? yes_str : no_str);
break;
case DW_FORM_flag_present:
break;
printf (" %*s%-20s (%s) %s\n",
(int) (level * 2), "", dwarf_attr_name (attr),
- dwarf_form_name (form), gettext ("yes"));
+ dwarf_form_name (form), yes_str);
break;
case DW_FORM_exprloc: