* ldmain.c (undefined_symbol): Handle section being NULL.
authorIan Lance Taylor <ian@airs.com>
Mon, 6 Feb 1995 23:24:20 +0000 (23:24 +0000)
committerIan Lance Taylor <ian@airs.com>
Mon, 6 Feb 1995 23:24:20 +0000 (23:24 +0000)
ld/ChangeLog
ld/ldmain.c

index 4d3462aed8e6e6863a622ce00dbec744604c5e96..f7be828c7ca86de007abf85e1f095695b8b87bb4 100644 (file)
@@ -1,5 +1,7 @@
 Mon Feb  6 12:17:24 1995  Ian Lance Taylor  <ian@cygnus.com>
 
+       * ldmain.c (undefined_symbol): Handle section being NULL.
+
        * ldctor.c (ldctor_build_sets): Handle bfd_link_hash_defweak.
        * ldexp.c (fold_name): Likewise.
        * ldlang.c (print_one_symbol): Likewise.
index a9b836a70b818a2d19a853d4d74900a94e26a3c5..091f776f42281b4df2a166b3122d8192c92c66a7 100644 (file)
@@ -833,12 +833,24 @@ undefined_symbol (info, name, abfd, section, address)
       error_name = buystring (name);
     }
 
-  if (error_count < MAX_ERRORS_IN_A_ROW)
-    einfo ("%X%C: undefined reference to `%T'\n",
-          abfd, section, address, name);
-  else if (error_count == MAX_ERRORS_IN_A_ROW)
-    einfo ("%D: more undefined references to `%T' follow\n",
-          abfd, section, address, name);
+  if (section != NULL)
+    {
+      if (error_count < MAX_ERRORS_IN_A_ROW)
+       einfo ("%X%C: undefined reference to `%T'\n",
+              abfd, section, address, name);
+      else if (error_count == MAX_ERRORS_IN_A_ROW)
+       einfo ("%D: more undefined references to `%T' follow\n",
+              abfd, section, address, name);
+    }
+  else
+    {
+      if (error_count < MAX_ERRORS_IN_A_ROW)
+       einfo ("%X%B: undefined reference to `%T'\n",
+              abfd, name);
+      else if (error_count == MAX_ERRORS_IN_A_ROW)
+       einfo ("%B: more undefined references to `%T' follow\n",
+              abfd, name);
+    }
 
   return true;
 }