r218287 - Don't use comdats for initializers on platforms that don't support it

Reid Kleckner rnk at google.com
Tue Sep 23 11:52:24 PDT 2014


I reverted this. It needs more investigation. With optimizations enabled,
I'm seeing a comdat group that looks like:

COMDAT group section [    2] `.group' [_ZN...kNameE] contains 4 sections:
   [Index]    Name
   [   43]   .text.startup
   [   76]   .bss._ZN...kNameE
   [   83]   .bss._ZGV..kNameE
   [   44]   .rela.text.startup

Note that there is no .ctors section in the group. Maybe -globalopt fired?

On Mon, Sep 22, 2014 at 9:39 PM, Anton Korobeynikov <anton at korobeynikov.info
> wrote:

> Yeah, the only difference between .ctors and .init_array is the order
> which the initializers are emitted in the section in.
>
> On Tue, Sep 23, 2014 at 4:58 AM, Rafael Avila de Espindola
> <rafael.espindola at gmail.com> wrote:
> >
> >
> > Sent from my iPhone
> >
> > On Sep 22, 2014, at 20:55, Reid Kleckner <rnk at google.com> wrote:
> >
> > On Mon, Sep 22, 2014 at 5:32 PM, Rafael Avila de Espindola
> > <rafael.espindola at gmail.com> wrote:
> >>
> >>
> >> > URL: http://llvm.org/viewvc/llvm-project?rev=218287&view=rev
> >> > Log:
> >> > Don't use comdats for initializers on platforms that don't support it
> >> >
> >> > In particular, pre-.init_array ELF uses the .ctors section mechanism.
> >> > MinGW COFF also uses .ctors, now that I think about it.
> >>
> >> Why doesn't it work with .ctors? It is just a list of pointers like
> >> .init_array.
> >
> >
> > I didn't think it was implemented. Are you saying it's possible and
> should
> > be easy, or that it should already work? We're having issues with my
> > favorite gold error, "relocation refers to discarded section".
> >
> >
> > I though I had implemented comdat in both .ctors and .init_array in the
> same
> > commit in LLVM.
> >
> > Would you mind reporting a bug with a testcase that used to fail? I will
> > take a look as soon as I get back.
> >
> > Thanks,
> > Rafael
> >
> > _______________________________________________
> > cfe-commits mailing list
> > cfe-commits at cs.uiuc.edu
> > http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits
> >
>
>
>
> --
> With best regards, Anton Korobeynikov
> Faculty of Mathematics and Mechanics, Saint Petersburg State University
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20140923/7c22b769/attachment.html>


More information about the cfe-commits mailing list