[llvm-dev] [libLTO] accessing llvm.global_ctors

Wael Yehia via llvm-dev llvm-dev at lists.llvm.org
Sun Jul 25 16:39:14 PDT 2021


 


>>Hi,
>>Our linker uses the libLTO interface. Given an lto_module_t, we are trying to
>>check if it contains the @llvm.global_ctors or the @llvm.global_dtors global
>>variables. We need to know this information in order to decide whether to
>>include a bitcode archive member in the LTO step or not.
>
>This is strange. Constructors should be orthogonal to archive member extraction.
>If an archive member is unused, it is not extracted and its constructors
>are suppressed.

Certain linker flag forces it to include all archive members that have a constructor or destructor. I agree it's strange.


More information about the llvm-dev mailing list