summaryrefslogtreecommitdiffstats
path: root/lld/ELF/ICF.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lld/ELF/ICF.cpp')
-rw-r--r--lld/ELF/ICF.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/lld/ELF/ICF.cpp b/lld/ELF/ICF.cpp
index f98a859991a..d4e490c08d4 100644
--- a/lld/ELF/ICF.cpp
+++ b/lld/ELF/ICF.cpp
@@ -162,7 +162,8 @@ template <class ELFT> static uint32_t getHash(InputSection *S) {
// Returns true if section S is subject of ICF.
static bool isEligible(InputSection *S) {
- if (!S->Live || !(S->Flags & SHF_ALLOC) || (S->Flags & SHF_WRITE))
+ if (!S->Live || S->KeepUnique || !(S->Flags & SHF_ALLOC) ||
+ (S->Flags & SHF_WRITE))
return false;
// Don't merge read only data sections unless
OpenPOWER on IntegriCloud