diff options
author | Wael Yehia <wyehia@ca.ibm.com> | 2021-07-27 09:26:38 -0400 |
---|---|---|
committer | Wael Yehia <wyehia@ca.ibm.com> | 2021-07-28 12:41:56 +0000 |
commit | 9559bd19908bf6421f2abed1578219dacdc49169 (patch) | |
tree | b89e9cdc99ccd0b00ea18dba3e3bb76511b462a2 /clang/lib/Frontend/CompilerInvocation.cpp | |
parent | c07dd2b885c3096694ac607794b62f7d60032c22 (diff) | |
download | llvm-9559bd19908bf6421f2abed1578219dacdc49169.zip llvm-9559bd19908bf6421f2abed1578219dacdc49169.tar.gz llvm-9559bd19908bf6421f2abed1578219dacdc49169.tar.bz2 |
[LTO][Legacy] Add new API to check presence of ctor/dtor functions.
On AIX, the linker needs to check whether a given lto_module_t contains
any constructor/destructor functions, in order to implement the behavior
of the -bcdtors:all flag. See
https://www.ibm.com/docs/en/aix/7.2?topic=l-ld-command for the flag's
documentation.
In llvm IR, constructor (destructor) functions are added to a special
global array @llvm.global_ctors (@llvm.global_dtors).
However, because these two symbols are artificial, they are not visited
during the symbol traversal (using the
lto_module_get_[num_symbols|symbol_name|symbol_attribute] API).
This patch adds a new function to the libLTO interface that checks the
presence of one or both of these two symbols.
Reviewed By: steven_wu
Differential Revision: https://reviews.llvm.org/D106887
Diffstat (limited to 'clang/lib/Frontend/CompilerInvocation.cpp')
0 files changed, 0 insertions, 0 deletions