This is the mail archive of the binutils@sourceware.cygnus.com mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

A patch for choose_temp_base


This patch removes choose_temp_base on some files. As indicated in
libiberty/choose-temp.c, the usage of choose_temp_base () is not
recommended. I don't know enough about Windows to change the Windows
files.


-- 
H.J. Lu (hjl@gnu.org)
--
2000-05-08  H.J. Lu  (hjl@gnu.org)

	* nlmconv.c (temp_filename): Removed.

	* nlmconv.c (link_inputs): Use make_temp_file () instead of
	choose_temp_base ().
	* objdump.c (display_target_list): Likewise.
	(display_info_table): Likewise.

Index: nlmconv.c
===================================================================
RCS file: /work/cvs/gnu/binutils/binutils/nlmconv.c,v
retrieving revision 1.5
diff -u -p -r1.5 nlmconv.c
--- nlmconv.c	2000/04/12 17:27:32	1.5
+++ nlmconv.c	2000/05/08 16:50:04
@@ -2086,9 +2086,6 @@ powerpc_mangle_relocs (outbfd, insec, re
 #define LD_NAME "ld"
 #endif
 
-/* Temporary file name base.  */
-static char *temp_filename;
-
 /* The user has specified several input files.  Invoke the linker to
    link them all together, and convert and delete the resulting output
    file.  */
@@ -2136,11 +2133,8 @@ link_inputs (inputs, ld)
 
   if (ld == NULL)
     ld = (char *) LD_NAME;
-
-  temp_filename = choose_temp_base ();
 
-  unlink_on_exit = xmalloc (strlen (temp_filename) + 3);
-  sprintf (unlink_on_exit, "%s.O", temp_filename);
+  unlink_on_exit = make_temp_file (".O");
 
   argv[0] = ld;
   argv[1] = (char *) "-Ur";
Index: objdump.c
===================================================================
RCS file: /work/cvs/gnu/binutils/binutils/objdump.c,v
retrieving revision 1.17
diff -u -p -r1.17 objdump.c
--- objdump.c	2000/04/20 22:25:48	1.17
+++ objdump.c	2000/05/08 16:51:06
@@ -2639,7 +2639,7 @@ display_target_list ()
   char *dummy_name;
   int t;
 
-  dummy_name = choose_temp_base ();
+  dummy_name = make_temp_file (NULL);
   for (t = 0; bfd_target_vector[t]; t++)
     {
       bfd_target *p = bfd_target_vector[t];
@@ -2691,7 +2691,7 @@ display_info_table (first, last)
     printf ("%s ", bfd_target_vector[t]->name);
   putchar ('\n');
 
-  dummy_name = choose_temp_base ();
+  dummy_name = make_temp_file (NULL);
   for (a = (int) bfd_arch_obscure + 1; a < (int) bfd_arch_last; a++)
     if (strcmp (bfd_printable_arch_mach (a, 0), "UNKNOWN!") != 0)
       {

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]