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: Static linkage and anonymous namespace


>>>>> Martin von Loewis <martin@mira.isdn.cs.tu-berlin.de> writes:

 >> I can't think of any examples offhand that the compiler currently supports,
 >> but passing the address of a variable in the unnamed namespace to an
 >> exported template would break.  I'd like not to have to change this back
 >> when we implement export.

 > I thought you'd bring up export, and I can't really defend myself here
 > because I have no clue how to implement exported templates.

My plan is to encode the necessary information in another ELF section and
have the prelinker extract it and feed it to the compiler at link time.
This is the only way to support separate compilation properly; otherwise,
people can't put exported templates into libraries.

 > It is currently easy to produce duplicate symbols if you know the
 > algorithm for the anonymous namespace name. Is this a problem?
 > If so, should we merge the current time into the name?

I think so, yes.

Jason


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