Delete what looks like dead code.

The start of a segment should not have a gap that needs trap
instructions.

llvm-svn: 310696
This commit is contained in:
Rafael Espindola 2017-08-11 06:07:02 +00:00
parent 19913b22c0
commit 0158e2a50a
1 changed files with 2 additions and 4 deletions

View File

@ -1870,10 +1870,8 @@ template <class ELFT> void Writer<ELFT>::writeTrapInstr() {
if (P->p_type != PT_LOAD || !(P->p_flags & PF_X))
continue;
// We only fill the first and the last page of the segment because the
// middle part will be overwritten by output sections.
fillTrapInstr(Buf + alignDown(P->p_offset, Target->PageSize),
Buf + alignTo(P->p_offset, Target->PageSize));
// We only fill the last page of the segment because the rest will be
// overwritten by output sections.
fillTrapInstr(Buf + alignDown(P->p_offset + P->p_filesz, Target->PageSize),
Buf + alignTo(P->p_offset + P->p_filesz, Target->PageSize));
}