[PATCH] D64854: [ELF] Delete redundant pageAlign at PT_GNU_RELRO boundaries after D58892

Fangrui Song via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jul 17 02:02:23 PDT 2019


MaskRay updated this revision to Diff 210271.
MaskRay retitled this revision from "[ELF] Delete redundant pageAlign of the first section after PT_GNU_RELRO after D58892" to "[ELF] Delete redundant pageAlign at PT_GNU_RELRO boundaries after D58892".
MaskRay edited the summary of this revision.
MaskRay removed subscribers: atanasyan, sfertile.
MaskRay added a comment.

Delete the whole PT_GNU_RELRO  block


Repository:
  rLLD LLVM Linker

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D64854/new/

https://reviews.llvm.org/D64854

Files:
  ELF/Writer.cpp


Index: ELF/Writer.cpp
===================================================================
--- ELF/Writer.cpp
+++ ELF/Writer.cpp
@@ -2219,30 +2219,10 @@
       };
   };
 
-  for (Partition &part : partitions) {
+  for (Partition &part : partitions)
     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);
-    }
-  }
 }
 
 // Compute an in-file position for a given section. The file offset must be the


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D64854.210271.patch
Type: text/x-patch
Size: 1001 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190717/8b8221d0/attachment.bin>


More information about the llvm-commits mailing list