* ldlang.c (section_already_linked): Only discard link once
authorIan Lance Taylor <ian@airs.com>
Tue, 22 Jun 1999 21:13:24 +0000 (21:13 +0000)
committerIan Lance Taylor <ian@airs.com>
Tue, 22 Jun 1999 21:13:24 +0000 (21:13 +0000)
sections if we are building constructors.

ld/ChangeLog
ld/ldlang.c

index 70572de0fd80a3a2978c78d51954794db07e0ca2..0c2bf7b0794b145adac4ede30b390ed1003c372d 100644 (file)
@@ -1,3 +1,8 @@
+1999-06-23  Ian Lance Taylor  <ian@zembu.com>
+
+       * ldlang.c (section_already_linked): Only discard link once
+       sections if we are building constructors.
+
 1999-06-22  Nick Clifton  <nickc@cygnus.com>
 
        * ld.texinfo (Location Counter): Describe behaviour of
index 862e4e2dbbf17ca22f8507404994ad907d9735f1..d4c431ce5db767f21c917244d021bdca22fd3523 100644 (file)
@@ -890,6 +890,11 @@ section_already_linked (abfd, sec, data)
       return;
     }
 
+  /* If we aren't building constructors, don't discard link once
+     sections.  Otherwise we can get confused when generating relocs.  */
+  if (! config.build_constructors)
+    return;
+
   flags = bfd_get_section_flags (abfd, sec);
 
   if ((flags & SEC_LINK_ONCE) == 0)