/* size.c -- report size of various sections of an executable file.
- Copyright (C) 1991-2020 Free Software Foundation, Inc.
+ Copyright (C) 1991-2023 Free Software Foundation, Inc.
This file is part of GNU Binutils.
-A|-B|-G --format={sysv|berkeley|gnu} Select output style (default is %s)\n\
-o|-d|-x --radix={8|10|16} Display numbers in octal, decimal or hex\n\
-t --totals Display the total sizes (Berkeley only)\n\
+ -f Ignored.\n\
--common Display total size for *COM* syms\n\
--target=<bfdname> Set the binary file format\n\
@<file> Read options from <file>\n\
- -h --help Display this information\n\
- -v --version Display the program's version\n\
+ -h|-H|-? --help Display this information\n\
+ -v|-V --version Display the program's version\n\
\n"),
#if BSD_DEFAULT
"berkeley"
int temp;
int c;
-#if defined (HAVE_SETLOCALE) && defined (HAVE_LC_MESSAGES)
+#ifdef HAVE_LC_MESSAGES
setlocale (LC_MESSAGES, "");
#endif
-#if defined (HAVE_SETLOCALE)
setlocale (LC_CTYPE, "");
-#endif
bindtextdomain (PACKAGE, LOCALEDIR);
textdomain (PACKAGE);
{
bfd_nonfatal (bfd_get_filename (abfd));
list_matching_formats (matching);
- free (matching);
return_code = 3;
return;
}
bfd_nonfatal (bfd_get_filename (abfd));
if (bfd_get_error () == bfd_error_file_ambiguously_recognized)
- {
- list_matching_formats (matching);
- free (matching);
- }
+ list_matching_formats (matching);
return_code = 3;
}
{
char buffer[40];
- sprintf (buffer,
- (radix == decimal ? "%" BFD_VMA_FMT "u" :
- ((radix == octal) ? "0%" BFD_VMA_FMT "o" : "0x%" BFD_VMA_FMT "x")),
- num);
-
- return strlen (buffer);
+ return sprintf (buffer, (radix == decimal ? "%" PRIu64
+ : radix == octal ? "0%" PRIo64 : "0x%" PRIx64),
+ (uint64_t) num);
}
static void
{
char buffer[40];
- sprintf (buffer,
- (radix == decimal ? "%" BFD_VMA_FMT "u" :
- ((radix == octal) ? "0%" BFD_VMA_FMT "o" : "0x%" BFD_VMA_FMT "x")),
- num);
+ sprintf (buffer, (radix == decimal ? "%" PRIu64
+ : radix == octal ? "0%" PRIo64 : "0x%" PRIx64),
+ (uint64_t) num);
printf ("%*s", width, buffer);
}