* objdump.c (_DUMMY_NAME_): Don't define.
(display_target_list): Use tmpnam to get a file name rather than using _DUMMY_NAME_. Unlink it when done. (display_info_table): Likewise.
This commit is contained in:
parent
da988c2013
commit
de04bcebc0
2 changed files with 20 additions and 12 deletions
|
@ -1,5 +1,10 @@
|
||||||
Thu Apr 21 12:12:26 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com)
|
Thu Apr 21 12:12:26 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com)
|
||||||
|
|
||||||
|
* objdump.c (_DUMMY_NAME_): Don't define.
|
||||||
|
(display_target_list): Use tmpnam to get a file name rather than
|
||||||
|
using _DUMMY_NAME_. Unlink it when done.
|
||||||
|
(display_info_table): Likewise.
|
||||||
|
|
||||||
* nlmconv.c (secsec): New static variable.
|
* nlmconv.c (secsec): New static variable.
|
||||||
(main): Create .nlmsections section in output BFD. Store
|
(main): Create .nlmsections section in output BFD. Store
|
||||||
information about it in sections header.
|
information about it in sections header.
|
||||||
|
|
|
@ -1322,13 +1322,6 @@ dump_reloc_set (abfd, relpp, relcount)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* A file to open each BFD on. It will never actually be written to. */
|
|
||||||
#ifdef __GO32__
|
|
||||||
#define _DUMMY_NAME_ "##dummy"
|
|
||||||
#else
|
|
||||||
#define _DUMMY_NAME_ "/dev/null"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* The length of the longest architecture name + 1. */
|
/* The length of the longest architecture name + 1. */
|
||||||
#define LONGEST_ARCH sizeof("rs6000:6000")
|
#define LONGEST_ARCH sizeof("rs6000:6000")
|
||||||
|
|
||||||
|
@ -1338,20 +1331,24 @@ dump_reloc_set (abfd, relpp, relcount)
|
||||||
static void
|
static void
|
||||||
display_target_list ()
|
display_target_list ()
|
||||||
{
|
{
|
||||||
|
extern char *tmpnam ();
|
||||||
extern bfd_target *bfd_target_vector[];
|
extern bfd_target *bfd_target_vector[];
|
||||||
|
char *dummy_name;
|
||||||
int t;
|
int t;
|
||||||
|
|
||||||
|
dummy_name = tmpnam ((char *) NULL);
|
||||||
for (t = 0; bfd_target_vector[t]; t++)
|
for (t = 0; bfd_target_vector[t]; t++)
|
||||||
{
|
{
|
||||||
int a;
|
int a;
|
||||||
bfd_target *p = bfd_target_vector[t];
|
bfd_target *p = bfd_target_vector[t];
|
||||||
bfd *abfd = bfd_openw (_DUMMY_NAME_, p->name);
|
bfd *abfd = bfd_openw (dummy_name, p->name);
|
||||||
|
|
||||||
/* It *is* possible that bfd_openw might fail; avoid the
|
/* It *is* possible that bfd_openw might fail; avoid the
|
||||||
tragic consequences that would otherwise ensue. */
|
tragic consequences that would otherwise ensue. */
|
||||||
if (abfd == NULL)
|
if (abfd == NULL)
|
||||||
{
|
{
|
||||||
bfd_nonfatal (_DUMMY_NAME_);
|
bfd_nonfatal (dummy_name);
|
||||||
|
unlink (dummy_name);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
bfd_set_format (abfd, bfd_object);
|
bfd_set_format (abfd, bfd_object);
|
||||||
|
@ -1363,6 +1360,7 @@ display_target_list ()
|
||||||
printf (" %s\n",
|
printf (" %s\n",
|
||||||
bfd_printable_arch_mach ((enum bfd_architecture) a, 0));
|
bfd_printable_arch_mach ((enum bfd_architecture) a, 0));
|
||||||
}
|
}
|
||||||
|
unlink (dummy_name);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Print a table showing which architectures are supported for entries
|
/* Print a table showing which architectures are supported for entries
|
||||||
|
@ -1374,8 +1372,10 @@ display_info_table (first, last)
|
||||||
int first;
|
int first;
|
||||||
int last;
|
int last;
|
||||||
{
|
{
|
||||||
int t, a;
|
|
||||||
extern bfd_target *bfd_target_vector[];
|
extern bfd_target *bfd_target_vector[];
|
||||||
|
extern char *tmpnam ();
|
||||||
|
int t, a;
|
||||||
|
char *dummy_name;
|
||||||
|
|
||||||
/* Print heading of target names. */
|
/* Print heading of target names. */
|
||||||
printf ("\n%*s", (int) LONGEST_ARCH, " ");
|
printf ("\n%*s", (int) LONGEST_ARCH, " ");
|
||||||
|
@ -1383,6 +1383,7 @@ display_info_table (first, last)
|
||||||
printf ("%s ", bfd_target_vector[t]->name);
|
printf ("%s ", bfd_target_vector[t]->name);
|
||||||
putchar ('\n');
|
putchar ('\n');
|
||||||
|
|
||||||
|
dummy_name = tmpnam ((char *) NULL);
|
||||||
for (a = (int) bfd_arch_obscure + 1; a < (int) bfd_arch_last; a++)
|
for (a = (int) bfd_arch_obscure + 1; a < (int) bfd_arch_last; a++)
|
||||||
if (strcmp (bfd_printable_arch_mach (a, 0), "UNKNOWN!") != 0)
|
if (strcmp (bfd_printable_arch_mach (a, 0), "UNKNOWN!") != 0)
|
||||||
{
|
{
|
||||||
|
@ -1391,12 +1392,13 @@ display_info_table (first, last)
|
||||||
for (t = first; t++ < last && bfd_target_vector[t];)
|
for (t = first; t++ < last && bfd_target_vector[t];)
|
||||||
{
|
{
|
||||||
bfd_target *p = bfd_target_vector[t];
|
bfd_target *p = bfd_target_vector[t];
|
||||||
bfd *abfd = bfd_openw (_DUMMY_NAME_, p->name);
|
bfd *abfd = bfd_openw (dummy_name, p->name);
|
||||||
|
|
||||||
/* Just in case the open failed somehow. */
|
/* Just in case the open failed somehow. */
|
||||||
if (abfd == NULL)
|
if (abfd == NULL)
|
||||||
{
|
{
|
||||||
bfd_nonfatal (_DUMMY_NAME_);
|
bfd_nonfatal (dummy_name);
|
||||||
|
unlink (dummy_name);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
bfd_set_format (abfd, bfd_object);
|
bfd_set_format (abfd, bfd_object);
|
||||||
|
@ -1412,6 +1414,7 @@ display_info_table (first, last)
|
||||||
}
|
}
|
||||||
putchar ('\n');
|
putchar ('\n');
|
||||||
}
|
}
|
||||||
|
unlink (dummy_name);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Print tables of all the target-architecture combinations that
|
/* Print tables of all the target-architecture combinations that
|
||||||
|
|
Loading…
Reference in a new issue