summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRui Ueyama <ruiu@google.com>2018-10-24 22:15:32 +0000
committerRui Ueyama <ruiu@google.com>2018-10-24 22:15:32 +0000
commit444363e931d427719ddaa91819a9b133b8ac70e8 (patch)
treebaba9c384f9ab07ab0f443b602ccc571b6cf33dc
parent9c6c201b588634ca9388c28ed325d8f07c3adf2c (diff)
downloadbcm5719-llvm-444363e931d427719ddaa91819a9b133b8ac70e8.tar.gz
bcm5719-llvm-444363e931d427719ddaa91819a9b133b8ac70e8.zip
Do not call computeIsPreemptible() if its result is discarded. NFC.
llvm-svn: 345208
-rw-r--r--lld/ELF/Writer.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/lld/ELF/Writer.cpp b/lld/ELF/Writer.cpp
index 8d45f9f598f..cd3f0806c3d 100644
--- a/lld/ELF/Writer.cpp
+++ b/lld/ELF/Writer.cpp
@@ -1559,6 +1559,7 @@ static void removeUnusedSyntheticSections() {
// with the same name defined in other ELF executable or DSO.
static bool computeIsPreemptible(const Symbol &B) {
assert(!B.isLocal());
+
// Only symbols that appear in dynsym can be preempted.
if (!B.includeInDynsym())
return false;
@@ -1624,7 +1625,8 @@ template <class ELFT> void Writer<ELFT>::finalizeSections() {
finalizeSynthetic(In.EhFrame);
for (Symbol *S : Symtab->getSymbols())
- S->IsPreemptible |= computeIsPreemptible(*S);
+ if (!S->IsPreemptible)
+ S->IsPreemptible = computeIsPreemptible(*S);
// Scan relocations. This must be done after every symbol is declared so that
// we can correctly decide if a dynamic relocation is needed.
OpenPOWER on IntegriCloud