diff options
author | Fangrui Song <maskray@google.com> | 2019-07-17 09:23:04 +0000 |
---|---|---|
committer | Fangrui Song <maskray@google.com> | 2019-07-17 09:23:04 +0000 |
commit | 3c312d33d3c589c75dd3e18a28b99a23f789b799 (patch) | |
tree | 6ea539a5996cad25079dd96f7e7d686542efbf62 | |
parent | a2d223a75197784c0d7f4f525e8ab3365bbe682f (diff) |
[ELF] Delete redundant pageAlign at PT_GNU_RELRO boundaries after D58892
Summary:
After D58892 split the RW PT_LOAD on the PT_GNU_RELRO boundary, the new
layout is:
PT_LOAD(PT_GNU_RELRO(.data.rel.ro .bss.rel.ro)) PT_LOAD(.data. .bss)
The two pageAlign() calls at PT_GNU_RELRO boundaries are redundant due
to the existence of PT_LOAD.
Reviewers: grimar, peter.smith, ruiu, espindola
Reviewed By: ruiu
Subscribers: sfertile, atanasyan, emaste, arichardson, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D64854
git-svn-id: https://llvm.org/svn/llvm-project/lld/trunk@366307 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | ELF/Writer.cpp | 19 |
1 files changed, 0 insertions, 19 deletions
diff --git a/ELF/Writer.cpp b/ELF/Writer.cpp index 3cf7b0560..b8c889164 100644 --- a/ELF/Writer.cpp +++ b/ELF/Writer.cpp @@ -2223,25 +2223,6 @@ template <class ELFT> void Writer<ELFT>::fixSectionAlignments() { for (const PhdrEntry *p : part.phdrs) if (p->p_type == PT_LOAD && p->firstSec) pageAlign(p->firstSec); - - for (const PhdrEntry *p : part.phdrs) { - if (p->p_type != PT_GNU_RELRO) - continue; - - if (p->firstSec) - pageAlign(p->firstSec); - - // Find the first section after PT_GNU_RELRO. If it is in a PT_LOAD we - // have to align it to a page. - auto end = outputSections.end(); - auto i = llvm::find(outputSections, p->lastSec); - if (i == end || (i + 1) == end) - continue; - - OutputSection *cmd = (*(i + 1)); - if (needsPtLoad(cmd)) - pageAlign(cmd); - } } } |