mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-09-10 23:57:03 +08:00
* readelf.c (main): Reset dump request after each file.
This commit is contained in:
@ -1,3 +1,7 @@
|
|||||||
|
2002-12-23 Andreas Schwab <schwab@suse.de>
|
||||||
|
|
||||||
|
* readelf.c (main): Reset dump request after each file.
|
||||||
|
|
||||||
2002-12-23 Nick Clifton <nickc@redhat.com>
|
2002-12-23 Nick Clifton <nickc@redhat.com>
|
||||||
|
|
||||||
* nlmconv.c (main): Pass TRUE as third argument to
|
* nlmconv.c (main): Pass TRUE as third argument to
|
||||||
|
@ -10275,6 +10275,8 @@ main (argc, argv)
|
|||||||
char **argv;
|
char **argv;
|
||||||
{
|
{
|
||||||
int err;
|
int err;
|
||||||
|
char *cmdline_dump_sects = NULL;
|
||||||
|
unsigned num_cmdline_dump_sects = 0;
|
||||||
|
|
||||||
#if defined (HAVE_SETLOCALE) && defined (HAVE_LC_MESSAGES)
|
#if defined (HAVE_SETLOCALE) && defined (HAVE_LC_MESSAGES)
|
||||||
setlocale (LC_MESSAGES, "");
|
setlocale (LC_MESSAGES, "");
|
||||||
@ -10290,12 +10292,38 @@ main (argc, argv)
|
|||||||
if (optind < (argc - 1))
|
if (optind < (argc - 1))
|
||||||
show_name = 1;
|
show_name = 1;
|
||||||
|
|
||||||
|
/* When processing more than one file remember the dump requests
|
||||||
|
issued on command line to reset them after each file. */
|
||||||
|
if (optind + 1 < argc && dump_sects != NULL)
|
||||||
|
{
|
||||||
|
cmdline_dump_sects = malloc (num_dump_sects);
|
||||||
|
if (cmdline_dump_sects == NULL)
|
||||||
|
error (_("Out of memory allocating dump request table."));
|
||||||
|
else
|
||||||
|
{
|
||||||
|
memcpy (cmdline_dump_sects, dump_sects, num_dump_sects);
|
||||||
|
num_cmdline_dump_sects = num_dump_sects;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
err = 0;
|
err = 0;
|
||||||
while (optind < argc)
|
while (optind < argc)
|
||||||
err |= process_file (argv[optind++]);
|
{
|
||||||
|
err |= process_file (argv[optind++]);
|
||||||
|
|
||||||
|
/* Reset dump requests. */
|
||||||
|
if (optind < argc && dump_sects != NULL)
|
||||||
|
{
|
||||||
|
num_dump_sects = num_cmdline_dump_sects;
|
||||||
|
if (num_cmdline_dump_sects > 0)
|
||||||
|
memcpy (dump_sects, cmdline_dump_sects, num_cmdline_dump_sects);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (dump_sects != NULL)
|
if (dump_sects != NULL)
|
||||||
free (dump_sects);
|
free (dump_sects);
|
||||||
|
if (cmdline_dump_sects != NULL)
|
||||||
|
free (cmdline_dump_sects);
|
||||||
|
|
||||||
return err;
|
return err;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user