Don't use unsupported format string in ld.so (bug 29427)
authorAndreas Schwab <schwab@suse.de>
Mon, 1 Aug 2022 14:30:15 +0000 (16:30 +0200)
committerAndreas Schwab <schwab@suse.de>
Tue, 2 Aug 2022 08:24:21 +0000 (10:24 +0200)
The dynamic loader does not support printf format strings that contain a
literal field width or precision, they have to be specified indirectly.

elf/dl-diagnostics.c

index dd3871b..269c428 100644 (file)
@@ -108,7 +108,7 @@ _dl_diagnostics_print_labeled_value (const char *label, uint64_t value)
       if (high == 0)
         _dl_printf ("%s=0x%x\n", label, low);
       else
-        _dl_printf ("%s=0x%x%08x\n", label, high, low);
+        _dl_printf ("%s=0x%x%0*x\n", label, high, 8, low);
     }
 }