This is the mail archive of the
mailing list for the GCC project.
Re: Use normal section names for comdat group?
- From: James E Wilson <wilson at specifixinc dot com>
- To: "H. J. Lu" <hjl at lucon dot org>
- Cc: gcc at gcc dot gnu dot org
- Date: Thu, 07 Apr 2005 15:36:18 -0700
- Subject: Re: Use normal section names for comdat group?
- References: <20050405231158.GA29657@lucon.org>
H. J. Lu wrote:
Gcc 4,0 generates
for comdat group. Can gcc use
instead? At least, there will be less characters for linker to process.
I know of no reason why we must continue using .gnu.linkonce for targets
that have proper comdat support.
However, I don't think this will be an easy transition, because there
are too many places that make assumptions about the fact that
.gnu.linkonce has a special meaning. That might be an argument against
For instance, in varasm.c, in default_function_rodata_section, we have
/* For .gnu.linkonce.t.foo we want to use .gnu.linkonce.r.foo. */
if (DECL_ONE_ONLY (decl) && strncmp (name, ".gnu.linkonce.t.",
16) == 0)
and this code fails if you remove the .gnu.linkonce from the section
name. We'd need code to check for and handle a comdat section here.
dwarf2out.c assumes that comdat sections for debugging start with
There are likely many other places that need fixing also.
There is also the possible issue that using .text.foo conflicts with the
naming scheme used by the -ffunction-sections -fdata-sections options.
What happens if we have two sections both named .text.foo, one of which
is a comdat section, and one of which came from -ffunction-sections? We
might still need to use a distinct prefix to make this work, though it
doesn't have to be as long as .gnu.linkonce. And if we do add another
prefix, some of the special code for .gnu.linkonce will have to be
duplicated, in which case it might have been simpler to just stick with
.gnu.linkonce in the first place.
Jim Wilson, GNU Tools Support, http://www.SpecifixInc.com