1999-07-21 Mark Elbrecht <snowball3@bigfoot.com>
[deliverable/binutils-gdb.git] / bfd / coffcode.h
index f905c940a266533b227a17781e63f81051b4b876..185cbcf17de3a7dee2f55fcc0d6f416d4623256b 100644 (file)
@@ -687,6 +687,17 @@ styp_to_sec_flags (abfd, hdr, name)
     }
 #endif
 
+#if defined (COFF_LONG_SECTION_NAMES) && defined (COFF_SUPPORT_GNU_LINKONCE)
+  /* As a GNU extension, if the name begins with .gnu.linkonce, we
+     only link a single copy of the section.  This is used to support
+     g++.  g++ will emit each template expansion in its own section.
+     The symbols will be defined as weak, so that multiple definitions
+     are permitted.  The GNU linker extension is to actually discard
+     all but one of the sections.  */
+  if (strncmp (name, ".gnu.linkonce", sizeof ".gnu.linkonce" - 1) == 0)
+    sec_flags |= SEC_LINK_ONCE | SEC_LINK_DUPLICATES_DISCARD;
+#endif
+
   return (sec_flags);
 }
 
This page took 0.023385 seconds and 4 git commands to generate.