This is an archive of the discontinued LLVM Phabricator instance.

[ELF] Initialize PhdrEntry::p_align to maxPageSize for PT_LOAD
ClosedPublic

Authored by MaskRay on Sep 4 2019, 11:06 PM.

Details

Summary
Writer<ELFT>::run
  assignFileOffsets
    setFileOffset
      computeFileOffset
        os->ptLoad->p_align may be smaller than config->maxPageSize
  setPhdrs
    p_align = max(p_align, config->maxPageSize)

If we move the config->maxPageSize logic to the constructor of
PhdrEntry, computeFileOffset can be simplified.

Diff Detail

Repository
rL LLVM

Event Timeline

MaskRay created this revision.Sep 4 2019, 11:06 PM
ruiu accepted this revision.Sep 4 2019, 11:55 PM

LGTM

This revision is now accepted and ready to land.Sep 4 2019, 11:55 PM
This revision was automatically updated to reflect the committed changes.