diff options
Diffstat (limited to 'ld/ldmisc.c')
-rw-r--r-- | ld/ldmisc.c | 29 |
1 files changed, 13 insertions, 16 deletions
diff --git a/ld/ldmisc.c b/ld/ldmisc.c index ee52487..3a02f75 100644 --- a/ld/ldmisc.c +++ b/ld/ldmisc.c @@ -47,7 +47,7 @@ %H like %C but in addition emit section+offset %P print program name %V hex bfd_vma - %W hex bfd_vma with 0x with no leading zeros taking up 8 spaces + %W hex bfd_vma with 0x with no leading zeros taking up 10 spaces %X no object output, fail return %d integer, like printf %ld long, like printf @@ -241,9 +241,13 @@ vfinfo (FILE *fp, const char *fmt, va_list ap, bool is_warning) case 'V': /* hex bfd_vma */ { - uint64_t value = args[arg_no].v; + char buf[32]; + bfd_vma value; + + value = args[arg_no].v; ++arg_count; - fprintf (fp, "%016" PRIx64, value); + bfd_sprintf_vma (link_info.output_bfd, buf, value); + fprintf (fp, "%s", buf); } break; @@ -258,22 +262,15 @@ vfinfo (FILE *fp, const char *fmt, va_list ap, bool is_warning) case 'W': /* hex bfd_vma with 0x with no leading zeroes taking up - 8 spaces. */ + 10 spaces (including the 0x). */ { - char buf[100]; + char buf[32]; uint64_t value; - int len; value = args[arg_no].v; ++arg_count; - sprintf (buf, "%" PRIx64, value); - len = strlen (buf); - while (len < 8) - { - putc (' ', fp); - ++len; - } - fprintf (fp, "0x%s", buf); + sprintf (buf, "0x%" PRIx64, value); + fprintf (fp, "%10s", buf); } break; @@ -653,9 +650,9 @@ lfinfo (FILE *file, const char *fmt, ...) /* Functions to print the link map. */ void -print_space (void) +print_spaces (int count) { - fprintf (config.map_file, " "); + fprintf (config.map_file, "%*s", count, ""); } void |