Index: binutils/bfd/coffcode.h =================================================================== RCS file: /cvs/binutils/binutils/bfd/coffcode.h,v retrieving revision 1.7 diff -c -4 -p -r1.7 coffcode.h *** coffcode.h 1999/07/19 14:55:15 1.7 --- coffcode.h 1999/07/20 18:12:48 *************** styp_to_sec_flags (abfd, hdr, name) *** 686,693 **** --- 686,704 ---- } } #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); } #define get_index(symbol) ((symbol)->udata.i) Index: binutils/gas/config/te-go32.h =================================================================== RCS file: /cvs/binutils/binutils/gas/config/te-go32.h,v retrieving revision 1.1.1.1 diff -c -4 -p -r1.1.1.1 te-go32.h *** te-go32.h 1999/05/03 07:28:44 1.1.1.1 --- te-go32.h 1999/07/20 18:10:35 *************** *** 11,16 **** --- 11,19 ---- /* GAS should treat '.align value' as an alignment of 2**value */ #define USE_ALIGN_PTWO + #define COFF_LONG_SECTION_NAMES + #define COFF_SUPPORT_GNU_LINKONCE + /* these define interfaces */ #include "obj-format.h" Index: binutils/bfd/coff-go32.c =================================================================== RCS file: /cvs/binutils/binutils/bfd/coff-go32.c,v retrieving revision 1.1.1.1 diff -c -4 -p -r1.1.1.1 coff-go32.c *** coff-go32.c 1999/05/03 07:28:55 1.1.1.1 --- coff-go32.c 1999/07/20 18:11:03 *************** Foundation, Inc., 59 Temple Place - Suit *** 20,25 **** --- 20,27 ---- #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" Index: binutils/bfd/coff-stgo32.c =================================================================== RCS file: /cvs/binutils/binutils/bfd/coff-stgo32.c,v retrieving revision 1.2 diff -c -4 -p -r1.2 coff-stgo32.c *** coff-stgo32.c 1999/07/12 10:28:47 1.2 --- coff-stgo32.c 1999/07/20 18:11:16 *************** *** 38,45 **** --- 38,47 ---- #define TARGET_SYM go32stubbedcoff_vec #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" /* At first the prototypes */ Index: binutils/ld/scripttempl/i386go32.sc =================================================================== RCS file: /cvs/binutils/binutils/ld/scripttempl/i386go32.sc,v retrieving revision 1.1.1.1 diff -c -4 -p -r1.1.1.1 i386go32.sc *** i386go32.sc 1999/05/03 07:29:08 1.1.1.1 --- i386go32.sc 1999/07/20 18:12:07 *************** ENTRY(${ENTRY}) *** 16,23 **** --- 16,25 ---- SECTIONS { .text ${RELOCATING+ ${TARGET_PAGE_SIZE}+SIZEOF_HEADERS} : { *(.text) + ${RELOCATING+*(.gnu.linkonce.t*) + *(.gnu.linkonce.r*)} *(.const*) *(.ro*) ${RELOCATING+etext = . ; _etext = .}; ${RELOCATING+. = ALIGN(${SEGMENT_SIZE});} *************** SECTIONS *** 29,38 **** ${RELOCATING+djgpp_first_dtor = . ; *(.dtor) djgpp_last_dtor = . ;} *(.data) ! ${RELOCATING+ edata = . ; _edata = .}; ! ${RELOCATING+ . = ALIGN(${SEGMENT_SIZE});} } ${CONSTRUCTING+${RELOCATING-$CTOR}} ${CONSTRUCTING+${RELOCATING-$DTOR}} .bss ${RELOCATING+ SIZEOF(.data) + ADDR(.data)} : --- 31,41 ---- ${RELOCATING+djgpp_first_dtor = . ; *(.dtor) djgpp_last_dtor = . ;} *(.data) ! ${RELOCATING+*(.gnu.linkonce.d*)} ! ${RELOCATING+edata = . ; _edata = .}; ! ${RELOCATING+. = ALIGN(${SEGMENT_SIZE});} } ${CONSTRUCTING+${RELOCATING-$CTOR}} ${CONSTRUCTING+${RELOCATING-$DTOR}} .bss ${RELOCATING+ SIZEOF(.data) + ADDR(.data)} :