summaryrefslogtreecommitdiffstats
path: root/lld/ELF/Writer.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lld/ELF/Writer.cpp')
-rw-r--r--lld/ELF/Writer.cpp5
1 files changed, 1 insertions, 4 deletions
diff --git a/lld/ELF/Writer.cpp b/lld/ELF/Writer.cpp
index 944c683eddc..cd5dff78ee7 100644
--- a/lld/ELF/Writer.cpp
+++ b/lld/ELF/Writer.cpp
@@ -851,15 +851,12 @@ void Writer<ELFT>::forEachRelSec(std::function<void(InputSectionBase &)> Fn) {
template <class ELFT> void Writer<ELFT>::setReservedSymbolSections() {
PhdrEntry *Last = nullptr;
PhdrEntry *LastRO = nullptr;
- PhdrEntry *LastRW = nullptr;
for (PhdrEntry *P : Phdrs) {
if (P->p_type != PT_LOAD)
continue;
Last = P;
- if (P->p_flags & PF_W)
- LastRW = P;
- else
+ if (!(P->p_flags & PF_W))
LastRO = P;
}
OpenPOWER on IntegriCloud