+1999-07-21 Mark Elbrecht <snowball3@bigfoot.com>
+
+ * coffcode.h (styp_to_sec_flags): If COFF_LONG_SECTION_NAMES and
+ COFF_SUPPORT_GNU_LINKONCE, mark sections whose names begin with
+ .gnu.linkonce with SEC_LINKONCE and SEC_LINK_DUPLICATES_DISCARD.
+ * coff-go32.c: (COFF_LONG_SECTION_NAMES): Define.
+ (COFF_SUPPORT_GNU_LINKONCE): Define.
+ * coff-stgo32.c: (COFF_LONG_SECTION_NAMES): Define.
+ (COFF_SUPPORT_GNU_LINKONCE): Define.
+
1999-07-21 Ian Lance Taylor <ian@zembu.com>
From Mark Elbrecht:
#define TARGET_SYM go32coff_vec
#define TARGET_NAME "coff-go32"
#define TARGET_UNDERSCORE '_'
+#define COFF_LONG_SECTION_NAMES
+#define COFF_SUPPORT_GNU_LINKONCE
#include "coff-i386.c"
#define TARGET_NAME "coff-go32-exe"
#define TARGET_UNDERSCORE '_'
#define COFF_GO32_EXE
+#define COFF_LONG_SECTION_NAMES
+#define COFF_SUPPORT_GNU_LINKONCE
#include "bfd.h"
}
#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);
}