This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Group identifier of a comdat group
- From: Alan Modra <amodra at bigpond dot net dot au>
- To: Jessica Han <jessica at cup dot hp dot com>
- Cc: binutils at sources dot redhat dot com, gcc at gcc dot gnu dot org, reva at cup dot hp dot com
- Date: Mon, 3 Jun 2002 13:49:46 +0930
- Subject: Re: Group identifier of a comdat group
- References: <008e01c208c5$b971fcf0$8b63f40f@JH761542>
On Fri, May 31, 2002 at 10:08:01AM -0700, Jessica Han wrote:
> I am trying to implement the COMDAT sections support for GCC on IA64, and
> I am having a problem finding the group identifier of a COMDAT group.
Let's step back a little from the details of the implementation for a
moment. Are you using the existing binutils support for ELF groups,
that is, gcc will emit something like:
.section .text.foo,"axG",@progbits,foo_group
.
.
.section .rodata.foo,"aG",@progbits,foo_group
to set up a group, foo_group, with two members, .text.foo and
.data.foo?
I didn't implement GRP_COMDAT at the time I did the rest of the group
support mainly because it wasn't relevant to the immediate problem I
was trying to solve at the time. Also, there were too many options
for specifying a link-once type group. :)
Should we follow the GNU ELF convention for link-once sections?
ie. use something like
.section .text.foo,"axG",@progbits,.gnu.linkonce.foo_group
to specify that the group as a whole is link-once? Must the member
sections all be named .gnu.linkonce.*? (I don't think they need to
be, but if they all are, then should we just automatically add the
GRP_COMDAT flag?)
A second alternative is to follow the COFF scheme, using
.linkonce foo_group
I think that's cleaner than the magic .gnu.linkonce.* section names.
As a side issue, I think it's a pity that existing ELF link once
sections need special names; I'd rather see a SHF_LINKONCE flag in
sh_flags.
Then there are other options like an extra section letter, say
.section .text.foo,"axGC",...
or an extra field, say
.section .text.foo,"axG",@progbits,foo_group,comdat
Once we get these issues sorted out, it shouldn't be too hard to
implement in the linker.
--
Alan Modra
IBM OzLabs - Linux Technology Centre