+2023-04-27 Nick Clifton <nickc@redhat.com>
+
+ * ldmisc.c (vfinfo): Add support for %x and %lx.
+
2023-04-18 mengqinggang <mengqinggang@loongson.cn>
* testsuite/ld-loongarch-elf/macro_op.d: Regenerated.
%d integer, like printf
%ld long, like printf
%lu unsigned long, like printf
+ %lx unsigned long, like printf
%p native (host) void* pointer, like printf
%pA section name from a section
%pB filename from a bfd
%s arbitrary string, like printf
%u integer, like printf
%v hex bfd_vma, no leading zeros
+ %x integer, like printf
*/
void
case 'd':
case 'u':
+ case 'x':
arg_type = Int;
break;
case 'l':
- if (*scan == 'd' || *scan == 'u')
+ if (*scan == 'd' || *scan == 'u' || *scan == 'x')
{
++scan;
arg_type = Long;
++arg_count;
break;
+ case 'x':
+ /* unsigned integer, like printf */
+ fprintf (fp, "%x", args[arg_no].i);
+ ++arg_count;
+ break;
+
case 'l':
if (*fmt == 'd')
{
++fmt;
break;
}
+ else if (*fmt == 'x')
+ {
+ fprintf (fp, "%lx", args[arg_no].l);
+ ++arg_count;
+ ++fmt;
+ break;
+ }
/* Fallthru */
default: