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.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/lld/ELF/ICF.cpp b/lld/ELF/ICF.cpp
index 9ede87733d2..f13a5049e01 100644
--- a/lld/ELF/ICF.cpp
+++ b/lld/ELF/ICF.cpp
@@ -173,8 +173,9 @@ static bool isEligible(InputSection *S) {
return false;
// Don't merge read only data sections unless
- // --ignore-data-address-equality was passed.
- if (!(S->Flags & SHF_EXECINSTR) && !Config->IgnoreDataAddressEquality)
+ // --ignore-data-address-equality or --icf=safe was passed.
+ if (!(S->Flags & SHF_EXECINSTR) &&
+ !(Config->IgnoreDataAddressEquality || Config->ICF == ICFLevel::Safe))
return false;
// Don't merge synthetic sections as their Data member is not valid and empty.
OpenPOWER on IntegriCloud