This is the mail archive of the gcc@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]
Other format: [Raw text]

Re: Group identifier of a comdat group


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


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