Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#include "bfd.h"
-#include "getopt.h"
#include "progress.h"
#include "bucomm.h"
-#include <ctype.h>
+#include "getopt.h"
+#include "safe-ctype.h"
#include "dis-asm.h"
#include "libiberty.h"
#include "demangle.h"
FILE *stream;
int status;
{
- fprintf (stream, _("Usage: %s OPTION... FILE...\n"), program_name);
- fprintf (stream, _("Display information from object FILE.\n"));
- fprintf (stream, _("\n At least one of the following switches must be given:\n"));
+ fprintf (stream, _("Usage: %s <option(s)> <file(s)>\n"), program_name);
+ fprintf (stream, _(" Display information from object <file(s)>.\n"));
+ fprintf (stream, _(" At least one of the following switches must be given:\n"));
fprintf (stream, _("\
-a, --archive-headers Display archive header information\n\
-f, --file-headers Display the contents of the overall file header\n\
-T, --dynamic-syms Display the contents of the dynamic symbol table\n\
-r, --reloc Display the relocation entries in the file\n\
-R, --dynamic-reloc Display the dynamic relocation entries in the file\n\
- -V, --version Display this program's version number\n\
+ -v, --version Display this program's version number\n\
-i, --info List object formats and architectures supported\n\
-H, --help Display this information\n\
"));
PF (SEC_CONSTRUCTOR_BSS, "CONSTRUCTOR BSS");
PF (SEC_LOAD, "LOAD");
PF (SEC_RELOC, "RELOC");
-#ifdef SEC_BALIGN
- PF (SEC_BALIGN, "BALIGN");
-#endif
PF (SEC_READONLY, "READONLY");
PF (SEC_CODE, "CODE");
PF (SEC_DATA, "DATA");
PF (SEC_CLINK, "CLINK");
PF (SEC_SMALL_DATA, "SMALL_DATA");
PF (SEC_SHARED, "SHARED");
+ PF (SEC_ARCH_BIT_0, "ARCH_BIT_0");
if ((section->flags & SEC_LINK_ONCE) != 0)
{
/* sprintf to a "stream" */
static int
-#ifdef ANSI_PROTOTYPES
-objdump_sprintf (SFILE *f, const char *format, ...)
-#else
-objdump_sprintf (va_alist)
- va_dcl
-#endif
+objdump_sprintf VPARAMS ((SFILE *f, const char *format, ...))
{
-#ifndef ANSI_PROTOTYPES
- SFILE *f;
- const char *format;
-#endif
char *buf;
- va_list args;
size_t n;
-#ifdef ANSI_PROTOTYPES
- va_start (args, format);
-#else
- va_start (args);
- f = va_arg (args, SFILE *);
- format = va_arg (args, const char *);
-#endif
+ VA_OPEN (args, format);
+ VA_FIXEDARG (args, SFILE *, f);
+ VA_FIXEDARG (args, const char *, format);
vasprintf (&buf, format, args);
- va_end (args);
-
if (buf == NULL)
{
+ va_end (args);
fatal (_("Out of virtual memory"));
}
free (buf);
+ VA_CLOSE (args);
return n;
}
for (j = addr_offset * opb; j < addr_offset * opb + octets; ++j)
{
- if (isprint (data[j]))
+ if (ISPRINT (data[j]))
buf[j - addr_offset * opb] = data[j];
else
buf[j - addr_offset * opb] = '.';
match or a section followed by a number. */
if (strncmp (stabsect_name, s->name, len) == 0
&& (s->name[len] == '\000'
- || isdigit ((unsigned char) s->name[len])))
+ || ISDIGIT (s->name[len])))
{
if (read_section_stabs (abfd, s->name, strsect_name))
{
if (j >= stop_offset * opb)
printf (" ");
else
- printf ("%c", isprint (data[j]) ? data[j] : '.');
+ printf ("%c", ISPRINT (data[j]) ? data[j] : '.');
}
putchar ('\n');
}
static void
display_info ()
{
- printf (_("BFD header file version %s\n"), BFD_VERSION);
+ printf (_("BFD header file version %s\n"), BFD_VERSION_STRING);
display_target_list ();
display_target_tables ();
}
+int main PARAMS ((int, char **));
+
int
main (argc, argv)
int argc;
#if defined (HAVE_SETLOCALE) && defined (HAVE_LC_MESSAGES)
setlocale (LC_MESSAGES, "");
+#endif
+#if defined (HAVE_SETLOCALE)
+ setlocale (LC_CTYPE, "");
#endif
bindtextdomain (PACKAGE, LOCALEDIR);
textdomain (PACKAGE);
bfd_init ();
set_default_bfd_target ();
- while ((c = getopt_long (argc, argv, "pib:m:M:VCdDlfahHrRtTxsSj:wE:zgG",
+ while ((c = getopt_long (argc, argv, "pib:m:M:VvCdDlfaHhrRtTxsSj:wE:zgG",
long_options, (int *) 0))
!= EOF)
{
switch (c)
{
case 0:
- break; /* we've been given a long option */
+ break; /* We've been given a long option. */
case 'm':
machine = optarg;
break;
if (optarg != NULL)
{
enum demangling_styles style;
-
+
style = cplus_demangle_name_to_style (optarg);
if (style == unknown_demangling)
fatal (_("unknown demangling style `%s'"),
optarg);
-
+
cplus_demangle_set_style (style);
}
break;
usage (stderr, 1);
}
break;
-
+
case 'f':
dump_file_header = true;
seenflag = true;
case 'H':
usage (stdout, 0);
seenflag = true;
+ case 'v':
case 'V':
show_version = true;
seenflag = true;