File tree Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -173,7 +173,7 @@ uint64_t MachOLayoutBuilder::layoutSegments() {
173173 if (!Sec->hasValidOffset ()) {
174174 Sec->Offset = 0 ;
175175 } else {
176- if (RequiresFirstSectionOutsideFirstPage) {
176+ if (RequiresFirstSectionOutsideFirstPage && SectOffset < PageSize ) {
177177 SectOffset = alignToPowerOf2 (SectOffset, PageSize);
178178 RequiresFirstSectionOutsideFirstPage = false ;
179179 }
@@ -293,7 +293,8 @@ Error MachOLayoutBuilder::layoutTail(uint64_t Offset) {
293293 uint64_t StartOfIndirectSymbols =
294294 updateOffset (sizeof (uint32_t ) * O.IndirectSymTable .Symbols .size ());
295295 uint64_t StartOfSymbolStrings = updateOffset (StrTableBuilder.getSize ());
296- uint64_t StartOfDylibCodeSignDRs = updateOffset (O.DylibCodeSignDRs .Data .size ());
296+ uint64_t StartOfDylibCodeSignDRs =
297+ updateOffset (O.DylibCodeSignDRs .Data .size ());
297298
298299 uint64_t StartOfCodeSignature = Offset;
299300 uint32_t CodeSignatureSize = 0 ;
You can’t perform that action at this time.
0 commit comments