diff options
author | Fangrui Song <i@maskray.me> | 2022-12-22 12:32:59 -0800 |
---|---|---|
committer | Fangrui Song <i@maskray.me> | 2022-12-22 12:32:59 -0800 |
commit | 69243cdb926b1057c54522df305ffc195b2863ec (patch) | |
tree | ee02576f1b5456ed6999fe10db315a78b2ebfc0e /clang/lib/CodeGen/CodeGenModule.cpp | |
parent | 23bc8f730d99960c93946286f03d97d2fc54e8fe (diff) | |
download | llvm-69243cdb926b1057c54522df305ffc195b2863ec.zip llvm-69243cdb926b1057c54522df305ffc195b2863ec.tar.gz llvm-69243cdb926b1057c54522df305ffc195b2863ec.tar.bz2 |
Remove incorrectly implemented -mibt-seal
The option from D116070 does not work as intended and will not be needed when
hidden visibility is used. A function needs ENDBR if it may be reached
indirectly. If we make ThinLTO combine the address-taken property (close to
`!GV.use_empty() && !GV.hasAtLeastLocalUnnamedAddr()`), then the condition can
be expressed with:
`AddressTaken || (!F.hasLocalLinkage() && (VisibleToRegularObj || !F.hasHiddenVisibility()))`
The current `F.hasAddressTaken()` condition does not take into acount of
address-significance in another bitcode file or ELF relocatable file.
For the Linux kernel, it uses relocatable linking. lld/ELF uses a
conservative approach by setting all `VisibleToRegularObj` to true.
Using the non-relocatable semantics may under-estimate
`VisibleToRegularObj`. As @pcc mentioned on
https://github.com/ClangBuiltLinux/linux/issues/1737#issuecomment-1343414686
, we probably need a symbol list to supply additional
`VisibleToRegularObj` symbols (not part of the relocatable LTO link).
Reviewed By: samitolvanen
Differential Revision: https://reviews.llvm.org/D140363
Diffstat (limited to 'clang/lib/CodeGen/CodeGenModule.cpp')
-rw-r--r-- | clang/lib/CodeGen/CodeGenModule.cpp | 3 |
1 files changed, 0 insertions, 3 deletions
diff --git a/clang/lib/CodeGen/CodeGenModule.cpp b/clang/lib/CodeGen/CodeGenModule.cpp index fcb60e3..1d93c76 100644 --- a/clang/lib/CodeGen/CodeGenModule.cpp +++ b/clang/lib/CodeGen/CodeGenModule.cpp @@ -775,9 +775,6 @@ void CodeGenModule::Release() { 1); } - if (CodeGenOpts.IBTSeal) - getModule().addModuleFlag(llvm::Module::Min, "ibt-seal", 1); - if (CodeGenOpts.FunctionReturnThunks) getModule().addModuleFlag(llvm::Module::Override, "function_return_thunk_extern", 1); |