aboutsummaryrefslogtreecommitdiff
path: root/binutils
diff options
context:
space:
mode:
authorH.J. Lu <hjl.tools@gmail.com>2001-08-25 15:16:39 +0000
committerH.J. Lu <hjl.tools@gmail.com>2001-08-25 15:16:39 +0000
commit62a5a82d70b93406fd5006216c1f02f263fe9147 (patch)
tree910794673b4ce1143351d28d61e5d7d61a256783 /binutils
parent917583ad772872d4be81820c56aff7828ae4819b (diff)
downloadgdb-62a5a82d70b93406fd5006216c1f02f263fe9147.zip
gdb-62a5a82d70b93406fd5006216c1f02f263fe9147.tar.gz
gdb-62a5a82d70b93406fd5006216c1f02f263fe9147.tar.bz2
2001-08-25 H.J. Lu <hjl@gnu.org>
* nm.c (print_width): New. (display_rel_file): Set `print_width' according to bfd_sprintf_vma. (print_symbol_info_bsd): Check `print_width' instead of BFD64.
Diffstat (limited to 'binutils')
-rw-r--r--binutils/ChangeLog7
-rw-r--r--binutils/nm.c14
2 files changed, 18 insertions, 3 deletions
diff --git a/binutils/ChangeLog b/binutils/ChangeLog
index 50d8344..f186ff6 100644
--- a/binutils/ChangeLog
+++ b/binutils/ChangeLog
@@ -1,3 +1,10 @@
+2001-08-25 H.J. Lu <hjl@gnu.org>
+
+ * nm.c (print_width): New.
+ (display_rel_file): Set `print_width' according to
+ bfd_sprintf_vma.
+ (print_symbol_info_bsd): Check `print_width' instead of BFD64.
+
2001-08-24 Alexandre Oliva <aoliva@redhat.com>
* objcopy.c (use_alt_mach_code): New variable.
diff --git a/binutils/nm.c b/binutils/nm.c
index 3c5ca54..c422e9b 100644
--- a/binutils/nm.c
+++ b/binutils/nm.c
@@ -245,6 +245,11 @@ static char value_format[] = "%016lx";
/* We don't use value_format for this case. */
#endif
#endif
+#ifdef BFD64
+static int print_width = 16;
+#else
+static int print_width = 8;
+#endif
static int print_radix = 16;
/* Print formats for printing stab info. */
static char other_format[] = "%02x";
@@ -939,6 +944,7 @@ display_rel_file (abfd, archive_bfd)
PTR minisyms;
unsigned int size;
struct size_sym *symsizes;
+ char buf[30];
if (! dynamic)
{
@@ -959,6 +965,9 @@ display_rel_file (abfd, archive_bfd)
return;
}
+ bfd_sprintf_vma (abfd, buf, (bfd_vma) -1);
+ print_width = strlen (buf);
+
/* Discard the symbols we don't want to print.
It's OK to do this in place; we'll free the storage anyway
(after printing). */
@@ -1475,9 +1484,8 @@ print_symbol_info_bsd (info, abfd)
{
if (bfd_is_undefined_symclass (info->type))
{
-#ifdef BFD64
- printf (" ");
-#endif
+ if (print_width == 16)
+ printf (" ");
printf (" ");
}
else