aboutsummaryrefslogtreecommitdiff
path: root/binutils/size.c
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2008-07-28 04:07:32 +0000
committerAlan Modra <amodra@gmail.com>2008-07-28 04:07:32 +0000
commit14a9197011818108c904f8c8eb5fbba48f3cfd7d (patch)
tree9365cef928ad49a13356580e77cd41d1c619d94f /binutils/size.c
parent17bdf94d94144206c30bf035c70025231c906439 (diff)
downloadgdb-14a9197011818108c904f8c8eb5fbba48f3cfd7d.zip
gdb-14a9197011818108c904f8c8eb5fbba48f3cfd7d.tar.gz
gdb-14a9197011818108c904f8c8eb5fbba48f3cfd7d.tar.bz2
bfd/
PR 6769 * bfd-in.h (BFD_VMA_FMT): Define. (printf_vma, sprintf_vma): Use the above. (_bfd_int64_low, _bfd_int64_high): Delete. * bfd-in2.h: Regenerate. binutils/ PR 6769 * readelf.c (print_dec_vma, print_hex_vma): Delete. (print_vma): Use BFD_VMA_FMT. * size.c (size_number, rprint_number): Likewise.
Diffstat (limited to 'binutils/size.c')
-rw-r--r--binutils/size.c17
1 files changed, 8 insertions, 9 deletions
diff --git a/binutils/size.c b/binutils/size.c
index f035cab..415fee1 100644
--- a/binutils/size.c
+++ b/binutils/size.c
@@ -1,6 +1,7 @@
/* size.c -- report size of various sections of an executable file.
Copyright 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
- 2001, 2002, 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc.
+ 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008
+ Free Software Foundation, Inc.
This file is part of GNU Binutils.
@@ -406,17 +407,15 @@ display_file (char *filename)
}
}
-/* This is what lexical functions are for. */
-
static int
size_number (bfd_size_type num)
{
char buffer[40];
sprintf (buffer,
- (radix == decimal ? "%lu" :
- ((radix == octal) ? "0%lo" : "0x%lx")),
- (unsigned long) num);
+ (radix == decimal ? "%" BFD_VMA_FMT "u" :
+ ((radix == octal) ? "0%" BFD_VMA_FMT "o" : "0x%" BFD_VMA_FMT "x")),
+ num);
return strlen (buffer);
}
@@ -427,9 +426,9 @@ rprint_number (int width, bfd_size_type num)
char buffer[40];
sprintf (buffer,
- (radix == decimal ? "%lu" :
- ((radix == octal) ? "0%lo" : "0x%lx")),
- (unsigned long) num);
+ (radix == decimal ? "%" BFD_VMA_FMT "u" :
+ ((radix == octal) ? "0%" BFD_VMA_FMT "o" : "0x%" BFD_VMA_FMT "x")),
+ num);
printf ("%*s", width, buffer);
}