@@ -463,9 +463,6 @@ void ElfFile<ElfFileParamNames>::shiftFile(unsigned int extraPages, size_t start
463
463
464
464
int splitIndex = -1 ;
465
465
size_t splitShift = 0 ;
466
- /* Save off the flags from the segment that we are splitting so we can apply the same value
467
- to both of the resulting segments. */
468
- decltype (phdrs.at (0 ).p_flags ) splitFlags = 0 ;
469
466
470
467
/* Update the offsets in the program headers. */
471
468
for (int i = 0 ; i < rdi (hdr ()->e_phnum ); ++i) {
@@ -476,7 +473,6 @@ void ElfFile<ElfFileParamNames>::shiftFile(unsigned int extraPages, size_t start
476
473
477
474
splitIndex = i;
478
475
splitShift = startOffset - p_start;
479
- splitFlags = rdi (phdrs.at (i).p_flags );
480
476
481
477
/* This is the load segment we're currently extending within, so we split it. */
482
478
wri (phdrs.at (i).p_offset , startOffset);
@@ -517,7 +513,7 @@ void ElfFile<ElfFileParamNames>::shiftFile(unsigned int extraPages, size_t start
517
513
wri (phdr.p_paddr , phdrs.at (splitIndex).p_paddr - splitShift - shift);
518
514
wri (phdr.p_vaddr , phdrs.at (splitIndex).p_vaddr - splitShift - shift);
519
515
wri (phdr.p_filesz , wri (phdr.p_memsz , splitShift + extraBytes));
520
- wri (phdr.p_flags , splitFlags );
516
+ wri (phdr.p_flags , PF_R | PF_W );
521
517
wri (phdr.p_align , getPageSize ());
522
518
}
523
519
0 commit comments