From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ian Lance Taylor To: snowball3@bigfoot.com Cc: binutils@sourceware.cygnus.com Subject: Re: .gnu.linkonce COFF support Date: Tue, 13 Jul 1999 14:55:00 -0000 Message-id: <19990713215439.6511.qmail@daffy.airs.com> References: <199907132141.VAA91050@out4.ibm.net> X-SW-Source: 1999-q3/msg00186.html From: "Mark E." Date: Tue, 13 Jul 1999 17:41:22 -0400 Some questions about possibilities for DJGPP COFF. Would enabling .gnu.linkonce.* for DJGPP COFF improve template support much over what weak symbols do already? My understanding is that it would. At least when using ELF, current g++ generates the required template functions whenever it needs them. Thus in a final link you may wind up with many copies of a particular template function. The .gnu.linkonce.* sections are used to throw away the unnecessary duplicates, resulting in a smaller program. However, there are other schemes g++ can use to generate template functions. They all have various disadvantages. The disadvantage of the ELF scheme is that g++ compiles a bunch of duplicate code you don't need, so compilations take longer, and also your object files are bigger; the advantage is that you don't have to think about it, and your final executable is no larger than it has to be. I'm not up on all the details. I don't know which scheme is used for DJGPP. This would require enabling the long section name feature (> 8 characters) , but it can be turned on by one line. As I recall DJGPP doesn't use BFD_ASSEMBLER, so I think you'll probably need at least two lines: one in BFD and one in gas. And from what I can gather from reading the source, existing object files would still be readable by the new binutils binaries produced (ld, objdump, etc). without this feature. Did I read correctly? And also new object files using just short names produced with the long section name feature would be readable by old binutils binaries? Yes, this should all be correct. In fact, old binutils binaries should be able to read new object files with long names, but the long section names will look funny. Ian