diff options
| author | Rafael Espindola <rafael.espindola@gmail.com> | 2016-04-08 18:39:03 +0000 |
|---|---|---|
| committer | Rafael Espindola <rafael.espindola@gmail.com> | 2016-04-08 18:39:03 +0000 |
| commit | 8caf33c4834f37d8788361dafef1ce0fe6426666 (patch) | |
| tree | 22ef64ba0ba6c751c0dcddb5aa689ab04df3a208 /lld/ELF/LTO.cpp | |
| parent | 87b9e1b727550f5186c1fe6145f3585c191babbc (diff) | |
| download | bcm5719-llvm-8caf33c4834f37d8788361dafef1ce0fe6426666.tar.gz bcm5719-llvm-8caf33c4834f37d8788361dafef1ce0fe6426666.zip | |
Cleanup the handling of MustBeInDynSym and IsUsedInRegularObj.
Now MustBeInDynSym is only true if the symbol really must be in the
dynamic symbol table.
IsUsedInRegularObj is only true if the symbol is used in a .o or -u. Not
a .so or a .bc.
A benefit is that this is now done almost entirilly during symbol
resolution. The only exception is copy relocations because of aliases.
This includes a small fix in that protected symbols in .so don't force
executable symbols to be exported.
This also opens the way for implementing internalize for -shared.
llvm-svn: 265826
Diffstat (limited to 'lld/ELF/LTO.cpp')
| -rw-r--r-- | lld/ELF/LTO.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/lld/ELF/LTO.cpp b/lld/ELF/LTO.cpp index a9196567c4c..2fdf94a6c5f 100644 --- a/lld/ELF/LTO.cpp +++ b/lld/ELF/LTO.cpp @@ -116,7 +116,8 @@ void BitcodeCompiler::add(BitcodeFile &F) { // Shared libraries need to be handled slightly differently. // For now, let's be conservative and just never internalize // symbols when creating a shared library. - if (!Config->Shared && !Config->ExportDynamic && !B->isUsedInRegularObj()) + if (!Config->Shared && !Config->ExportDynamic && !B->isUsedInRegularObj() && + !B->MustBeInDynSym) if (!Used.count(GV)) InternalizedSyms.insert(GV->getName()); |

