This is the mail archive of the
mailing list for the GCC project.
Re: [PATCH] Don't use .gnu.linkonce with COMDAT
- From: Julian Brown <julian at codesourcery dot com>
- To: Andrew Pinski <pinskia at physics dot uc dot edu>
- Cc: Mark Mitchell <mark at codesourcery dot com>, Daniel Jacobowitz <drow at false dot org>,"H. J. Lu" <hjl at lucon dot org>, GCC Patches <gcc-patches at gcc dot gnu dot org>, Paul Brook <paul at codesourcery dot com>
- Date: Fri, 06 May 2005 19:09:43 +0100
- Subject: Re: [PATCH] Don't use .gnu.linkonce with COMDAT
- References: <200505061804.j46I4wD0017098@earth.phy.uc.edu>
Andrew Pinski wrote:
Daniel Jacobowitz wrote:
How does this patch interact with non-GNU linkers? This is one of the
problems with version-number based checks...
All the ld_vers* stuff is conditionalized on GNU ld, so I think this
patch would disable COMDAT for non-GNU linkers. Julian, I suggest you
change it so that if $ld_vers is empty, you just set HAVE_COMDAT_GROUP
based on the the assembler, as is done at present. That's no more or
less broken than the current state.
+ memcpy (rname, ".rodata", 7);
+ memcpy (rname + 7, name + 5, len - 5);
We shouldn't right "7" and such here; use strlen (".rodata"), instead.
GCC knows to collapse that at compile time. And, for that matter, just
use strcpy; GCC knows to turn that into more efficient operations if the
string is known.
Why not just use strcpy and strcat?
If GCC does not optimize the strcat into a memcpy, please file a bug.
The reason was to be consistent with code later in the same function.
I'll change it.