2002-03-18 David O'Brien <obrien@FreeBSD.org>
[deliverable/binutils-gdb.git] / ld / emultempl / elf32.em
index b2fd9694836880b59d9c204e7c859cf904b78ec8..077a8fc0f32dbae3a41e32081a1004fcfb5cca94 100644 (file)
@@ -12,8 +12,8 @@ cat >e${EMULATION_NAME}.c <<EOF
 /* This file is is generated by a shell script.  DO NOT EDIT! */
 
 /* ${ELFSIZE} bit ELF emulation code for ${EMULATION_NAME}
-   Copyright 1991, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001
-   Free Software Foundation, Inc.
+   Copyright 1991, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001,
+   2002 Free Software Foundation, Inc.
    Written by Steve Chamberlain <sac@cygnus.com>
    ELF support by Ian Lance Taylor <ian@cygnus.com>
 
@@ -165,7 +165,7 @@ gld${EMULATION_NAME}_vercheck (s)
 
   soname = bfd_elf_get_dt_soname (s->the_bfd);
   if (soname == NULL)
-    soname = basename (bfd_get_filename (s->the_bfd));
+    soname = lbasename (bfd_get_filename (s->the_bfd));
 
   for (l = global_vercheck_needed; l != NULL; l = l->next)
     {
@@ -247,7 +247,7 @@ gld${EMULATION_NAME}_stat_needed (s)
 
   soname = bfd_elf_get_dt_soname (s->the_bfd);
   if (soname == NULL)
-    soname = basename (s->filename);
+    soname = lbasename (s->filename);
 
   if (strncmp (soname, global_needed->name, suffix - global_needed->name) == 0)
     einfo ("%P: warning: %s, needed by %B, may conflict with %s\n",
@@ -351,7 +351,7 @@ cat >>e${EMULATION_NAME}.c <<EOF
     einfo ("%F%P:%B: bfd_stat failed: %E\n", abfd);
 
   /* First strip off everything before the last '/'.  */
-  soname = basename (abfd->filename);
+  soname = lbasename (abfd->filename);
 
   if (trace_file_tries)
     info_msg (_("found %s at %s\n"), soname, name);
@@ -369,9 +369,6 @@ cat >>e${EMULATION_NAME}.c <<EOF
      DT_NEEDED entry for this file.  */
   bfd_elf_set_dt_needed_name (abfd, "");
 
-  /* Previos basename call was clobbered in lang_for_each_input_file.  */
-  soname = basename (abfd->filename);
-
   /* Tell the ELF backend that the output file needs a DT_NEEDED
      entry for this file if it is used to resolve the reference in
      a regular object.  */
@@ -976,7 +973,7 @@ gld${EMULATION_NAME}_open_dynamic_archive (arch, search, entry)
       /* Rather than duplicating the logic above.  Just use the
         filename we recorded earlier.  */
 
-      filename = xstrdup (basename (entry->filename));
+      filename = lbasename (entry->filename);
       bfd_elf_set_dt_needed_name (entry->the_bfd, filename);
     }
 
@@ -1330,6 +1327,8 @@ gld${EMULATION_NAME}_finish ()
 {
   if (bfd_elf${ELFSIZE}_discard_info (output_bfd, &link_info))
     {
+      lang_reset_memory_regions ();
+
       /* Resize the sections.  */
       lang_size_sections (stat_ptr->head, abs_output_section,
                          &stat_ptr->head, 0, (bfd_vma) 0, NULL);
@@ -1339,7 +1338,7 @@ gld${EMULATION_NAME}_finish ()
 
       /* Do the assignments again.  */
       lang_do_assignments (stat_ptr->head, abs_output_section,
-                          (fill_type) 0, (bfd_vma) 0);
+                          (fill_type *) 0, (bfd_vma) 0);
     }
 }
 EOF
This page took 0.040473 seconds and 4 git commands to generate.