[llvm] r209015 - Add comdat key field to llvm.global_ctors and llvm.global_dtors

David Majnemer david.majnemer at gmail.com
Wed Jun 4 18:29:24 PDT 2014


On Wednesday, June 4, 2014, Rafael EspĂ­ndola <rafael.espindola at gmail.com>
wrote:

> > Not sure I follow. Given
> >
>
> Never mind, looking a bit closer at what ELF linkers do it seems they
> have just enough flexibility to handle this. There is a bit of
> documentation in
> http://www.sco.com/developers/gabi/latest/ch4.sheader.html. The gist
> seems to be:
>
> * for local symbols all references must be from withing the comdat.
> Not an issue since if the variable is local we don't put it in a
> comdat.
> * for global symbols the symbol is effectively made undefined if it
> pointed to a discarded section and linking continues. In particular,
> if the symbol is found in another comdat there is no error.
>
> This explains why the situation with variables is different from the
> situation with constructors:
>
> * With variables, if the new comdat with both var and guard is
> discarded, the other file is sure to have a comdat with the var and
> another with the guard.
> * With constructors, if the new comdat with C1 and C2 is discarded,
> the other file might have only C1 or C2.
>
> as for my earlier example in assembly, it was just missing a few
> .global directives :-)
>
> Now we "just" need to implement comdats in the IR!


Just three more test cases to fix. :)


>
> Cheers,
> Rafael
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu <javascript:;>
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20140604/f317b999/attachment.html>


More information about the llvm-commits mailing list