This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


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

Re: [Proposed binutils PATCH] Re: Diagnosing an intricate C++ problem


>>>>> Loren James Rittle <rittle@latour.rsch.comm.mot.com> writes:

 >   /* 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)
 >     flags |= SEC_LINK_ONCE | SEC_LINK_DUPLICATES_SAME_CONTENTS;

This is unacceptable.  Linkonce sections must be allowed to differ, to
allow for people using different optimization options in different .o's.
If you'd like, I suppose you could make this an option, but this must not
be the default behavior.

Microsoft uses DISCARD for code and SAME_SIZE for data, which seems
reasonable to me.  I would even support SAME_CONTENTS for data, but code
should stay with DISCARD.

Jason

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