*** empty log message ***
[deliverable/binutils-gdb.git] / ld / ldmain.c
index 29f00d621cd87816d434c0a5569075046c6f4412..e7b9c0f9d5cc6f3b4bb35c41fb9632da60486f7a 100644 (file)
@@ -1,6 +1,6 @@
 /* Main program of GNU linker.
    Copyright 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001,
-   2002, 2003, 2004, 2005, 2006, 2007
+   2002, 2003, 2004, 2005, 2006, 2007, 2008
    Free Software Foundation, Inc.
    Written by Steve Chamberlain steve@cygnus.com
 
@@ -60,6 +60,10 @@ extern void *sbrk ();
 
 /* EXPORTS */
 
+FILE *saved_script_handle = NULL;
+FILE *previous_script_handle = NULL;
+bfd_boolean force_make_executable = FALSE;
+
 char *default_target;
 const char *output_filename = "a.out";
 
@@ -73,9 +77,6 @@ const char *ld_sysroot;
 char * ld_canon_sysroot;
 int ld_canon_sysroot_len;
 
-/* The file that we're creating.  */
-bfd *output_bfd = 0;
-
 /* Set by -G argument, for MIPS ECOFF target.  */
 int g_switch_value = 8;
 
@@ -173,8 +174,8 @@ remove_output (void)
 {
   if (output_filename)
     {
-      if (output_bfd)
-       bfd_cache_close (output_bfd);
+      if (link_info.output_bfd)
+       bfd_cache_close (link_info.output_bfd);
       if (delete_output_file_on_failure)
        unlink_if_ordinary (output_filename);
     }
@@ -275,6 +276,7 @@ main (int argc, char **argv)
   link_info.relax_pass = 1;
   link_info.pei386_auto_import = -1;
   link_info.spare_dynamic_tags = 5;
+  link_info.path_separator = ':';
 
   ldfile_add_arch ("");
   emulation = get_emulation (argc, argv);
@@ -459,9 +461,9 @@ main (int argc, char **argv)
   /* Print error messages for any missing symbols, for any warning
      symbols, and possibly multiple definitions.  */
   if (link_info.relocatable)
-    output_bfd->flags &= ~EXEC_P;
+    link_info.output_bfd->flags &= ~EXEC_P;
   else
-    output_bfd->flags |= EXEC_P;
+    link_info.output_bfd->flags |= EXEC_P;
 
   ldwrite ();
 
@@ -488,8 +490,8 @@ main (int argc, char **argv)
     }
   else
     {
-      if (! bfd_close (output_bfd))
-       einfo (_("%F%B: final close failed: %E\n"), output_bfd);
+      if (! bfd_close (link_info.output_bfd))
+       einfo (_("%F%B: final close failed: %E\n"), link_info.output_bfd);
 
       /* If the --force-exe-suffix is enabled, and we're making an
         executable file and it doesn't end in .exe, copy it to one
@@ -1147,7 +1149,7 @@ constructor_callback (struct bfd_link_info *info,
 
   /* Ensure that BFD_RELOC_CTOR exists now, so that we can give a
      useful error message.  */
-  if (bfd_reloc_type_lookup (output_bfd, BFD_RELOC_CTOR) == NULL
+  if (bfd_reloc_type_lookup (link_info.output_bfd, BFD_RELOC_CTOR) == NULL
       && (info->relocatable
          || bfd_reloc_type_lookup (abfd, BFD_RELOC_CTOR) == NULL))
     einfo (_("%P%F: BFD backend error: BFD_RELOC_CTOR unsupported\n"));
@@ -1453,7 +1455,7 @@ reloc_overflow (struct bfd_link_info *info ATTRIBUTE_UNUSED,
                 reloc_name, entry->root.string,
                 entry->u.def.section,
                 entry->u.def.section == bfd_abs_section_ptr
-                ? output_bfd : entry->u.def.section->owner);
+                ? link_info.output_bfd : entry->u.def.section->owner);
          break;
        default:
          abort ();
This page took 0.029733 seconds and 4 git commands to generate.