Add translations
[deliverable/binutils-gdb.git] / ld / ldwrite.c
index 37e258030a526ec73145259bffe95cce4a181d17..e559825cd3e65b5a04fa02b09b6473b51f463c24 100644 (file)
@@ -1,5 +1,5 @@
 /* ldwrite.c -- write out the linked file
-   Copyright (C) 1991, 92, 93, 94, 95, 96, 97, 98, 2000
+   Copyright 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 2000
    Free Software Foundation, Inc.
    Written by Steve Chamberlain sac@cygnus.com
 
@@ -290,10 +290,8 @@ build_link_order (statement)
 
 /* Call BFD to write out the linked file.  */
 
-
 /**********************************************************************/
 
-
 /* Wander around the input sections, make sure that
    we'll never try and create an output section with more relocs
    than will fit.. Do this by always assuming the worst case, and
@@ -306,23 +304,26 @@ clone_section (abfd, s, name, count)
      const char *name;
      int *count;
 {
-  char template[6];
+  char templ[6];
   char *sname;
   asection *n;
   struct bfd_link_hash_entry *h;
 
   /* Invent a section name from the first five chars of the base
      section name and a digit suffix.  */
-  strncpy (template, name, sizeof (template) - 1);
-  template[sizeof (template) - 1] = '\0';
-  sname = bfd_get_unique_section_name (abfd, template, count);
-
-  n = bfd_make_section_anyway (abfd, sname);
-
-  /* Create a symbol of the same name.  */
+  strncpy (templ, name, sizeof (templ) - 1);
+  templ[sizeof (templ) - 1] = '\0';
+  if ((sname = bfd_get_unique_section_name (abfd, templ, count)) == NULL
+      || (n = bfd_make_section_anyway (abfd, sname)) == NULL
+      || (h = bfd_link_hash_lookup (link_info.hash,
+                                   sname, true, true, false)) == NULL)
+    {
+      einfo (_("%F%P: clone section failed: %E\n"));
+      /* Silence gcc warnings.  einfo exits, so we never reach here.  */
+      return NULL;
+    }
 
-  h = bfd_link_hash_lookup (link_info.hash,
-                           sname, true, true, false);
+  /* Set up section symbol.  */
   h->type = bfd_link_hash_defined;
   h->u.def.value = 0;
   h->u.def.section = n;
@@ -342,7 +343,7 @@ clone_section (abfd, s, name, count)
 }
 
 #if TESTING
-static void 
+static void
 ds (s)
      asection *s;
 {
@@ -362,6 +363,7 @@ ds (s)
     }
   printf ("\n");
 }
+
 dump (s, a1, a2)
      char *s;
      asection *a1;
@@ -372,7 +374,7 @@ dump (s, a1, a2)
   ds (a2);
 }
 
-static void 
+static void
 sanity_check (abfd)
      bfd *abfd;
 {
@@ -396,7 +398,7 @@ sanity_check (abfd)
 #define dump(a, b, c)
 #endif
 
-static void 
+static void
 split_sections (abfd, info)
      bfd *abfd;
      struct bfd_link_info *info;
@@ -517,7 +519,9 @@ split_sections (abfd, info)
     }
   sanity_check (abfd);
 }
+
 /**********************************************************************/
+
 void
 ldwrite ()
 {
@@ -536,8 +540,8 @@ ldwrite ()
         out.  */
 
       if (bfd_get_error () != bfd_error_no_error)
-       einfo (_("%F%P: final link failed: %E\n"), output_bfd);
+       einfo (_("%F%P: final link failed: %E\n"));
       else
-       xexit(1);
+       xexit (1);
     }
 }
This page took 0.024917 seconds and 4 git commands to generate.