2001-08-07 H.J. Lu <hjl@gnu.org>
* readelf.c (process_file): Return 0 if OK, otherwise return 1. (main): Return process_file ().
This commit is contained in:
parent
993e9275d7
commit
ff78d6d660
2 changed files with 18 additions and 8 deletions
|
@ -1,3 +1,8 @@
|
||||||
|
2001-08-07 H.J. Lu <hjl@gnu.org>
|
||||||
|
|
||||||
|
* readelf.c (process_file): Return 0 if OK, otherwise return 1.
|
||||||
|
(main): Return process_file ().
|
||||||
|
|
||||||
2001-08-05 Philip Blundell <philb@gnu.org>
|
2001-08-05 Philip Blundell <philb@gnu.org>
|
||||||
|
|
||||||
* doc/binutils.texi: Use "Thumb" not "THUMB".
|
* doc/binutils.texi: Use "Thumb" not "THUMB".
|
||||||
|
|
|
@ -185,7 +185,7 @@ static void dynamic_segment_parisc_val PARAMS ((Elf_Internal_Dyn
|
||||||
static int process_dynamic_segment PARAMS ((FILE *));
|
static int process_dynamic_segment PARAMS ((FILE *));
|
||||||
static int process_symbol_table PARAMS ((FILE *));
|
static int process_symbol_table PARAMS ((FILE *));
|
||||||
static int process_section_contents PARAMS ((FILE *));
|
static int process_section_contents PARAMS ((FILE *));
|
||||||
static void process_file PARAMS ((char *));
|
static int process_file PARAMS ((char *));
|
||||||
static int process_relocs PARAMS ((FILE *));
|
static int process_relocs PARAMS ((FILE *));
|
||||||
static int process_version_sections PARAMS ((FILE *));
|
static int process_version_sections PARAMS ((FILE *));
|
||||||
static char * get_ver_flags PARAMS ((unsigned int));
|
static char * get_ver_flags PARAMS ((unsigned int));
|
||||||
|
@ -8734,7 +8734,7 @@ get_file_header (file)
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static int
|
||||||
process_file (file_name)
|
process_file (file_name)
|
||||||
char * file_name;
|
char * file_name;
|
||||||
{
|
{
|
||||||
|
@ -8745,21 +8745,21 @@ process_file (file_name)
|
||||||
if (stat (file_name, & statbuf) < 0)
|
if (stat (file_name, & statbuf) < 0)
|
||||||
{
|
{
|
||||||
error (_("Cannot stat input file %s.\n"), file_name);
|
error (_("Cannot stat input file %s.\n"), file_name);
|
||||||
return;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
file = fopen (file_name, "rb");
|
file = fopen (file_name, "rb");
|
||||||
if (file == NULL)
|
if (file == NULL)
|
||||||
{
|
{
|
||||||
error (_("Input file %s not found.\n"), file_name);
|
error (_("Input file %s not found.\n"), file_name);
|
||||||
return;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (! get_file_header (file))
|
if (! get_file_header (file))
|
||||||
{
|
{
|
||||||
error (_("%s: Failed to read file header\n"), file_name);
|
error (_("%s: Failed to read file header\n"), file_name);
|
||||||
fclose (file);
|
fclose (file);
|
||||||
return;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Initialise per file variables. */
|
/* Initialise per file variables. */
|
||||||
|
@ -8776,7 +8776,7 @@ process_file (file_name)
|
||||||
if (! process_file_header ())
|
if (! process_file_header ())
|
||||||
{
|
{
|
||||||
fclose (file);
|
fclose (file);
|
||||||
return;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
process_section_headers (file);
|
process_section_headers (file);
|
||||||
|
@ -8834,6 +8834,8 @@ process_file (file_name)
|
||||||
free (dynamic_syminfo);
|
free (dynamic_syminfo);
|
||||||
dynamic_syminfo = NULL;
|
dynamic_syminfo = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef SUPPORT_DISASSEMBLY
|
#ifdef SUPPORT_DISASSEMBLY
|
||||||
|
@ -8860,6 +8862,8 @@ main (argc, argv)
|
||||||
int argc;
|
int argc;
|
||||||
char ** argv;
|
char ** argv;
|
||||||
{
|
{
|
||||||
|
int err;
|
||||||
|
|
||||||
#if defined (HAVE_SETLOCALE) && defined (HAVE_LC_MESSAGES)
|
#if defined (HAVE_SETLOCALE) && defined (HAVE_LC_MESSAGES)
|
||||||
setlocale (LC_MESSAGES, "");
|
setlocale (LC_MESSAGES, "");
|
||||||
#endif
|
#endif
|
||||||
|
@ -8871,11 +8875,12 @@ main (argc, argv)
|
||||||
if (optind < (argc - 1))
|
if (optind < (argc - 1))
|
||||||
show_name = 1;
|
show_name = 1;
|
||||||
|
|
||||||
|
err = 0;
|
||||||
while (optind < argc)
|
while (optind < argc)
|
||||||
process_file (argv [optind ++]);
|
err |= process_file (argv [optind ++]);
|
||||||
|
|
||||||
if (dump_sects != NULL)
|
if (dump_sects != NULL)
|
||||||
free (dump_sects);
|
free (dump_sects);
|
||||||
|
|
||||||
return 0;
|
return err;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue