This is the mail archive of the binutils@sourceware.cygnus.com mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: .gnu.linkonce COFF support


   From: "Mark E." <snowball3@bigfoot.com>
   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

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]