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

Rafael EspĂ­ndola rafael.espindola at gmail.com
Wed Jun 4 17:27:37 PDT 2014


>> How would this work in ELF? In ELF all the pointer are in a single
>> section, .init_array, so they cannot be in multiple comdats.
>
>
> I think it's OK to have multiple sections with the same name.  Won't the
> linker simply concatenate the multiple .init_array's during the link?

Yes, I think this will work. It is a brilliant hack!

>> This is equivalent to using a *C5* comdat symbol to hold the *C1* and
>> *C2* constructors.
>>
>> Should we report  a bug on the itanium abi?
>
>
> Yes.  Also, this completely breaks the intended design of the comdat key in
> global ctors, because now it needs to support an arbitrary symbol and not a
> specific GV.  Maybe we can find a way to replace this with an explicit
> section which will have the comdat, but I'll have to think of that later.

Sure, it can definitely wait for us having comdat support in the IR :-)

Cheers,
Rafael



More information about the llvm-commits mailing list