Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • D dynamorio
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 1,467
    • Issues 1,467
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 44
    • Merge requests 44
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • DynamoRIO
  • dynamorio
  • Issues
  • #4737
Closed
Open
Issue created Feb 17, 2021 by Derek Bruening@derekbrueningContributor

ELF loader ignores segment alignment

The ELF loader in drlibc ignores the ElfNN_Phdr.p_align flag entirely: instead it uses the page size only for alignment of the start and end of each segment. This doesn't matter for most ELF files, since they align their p_vaddr fields. But it does appear when loading AArch64 ELF files on x86 where the ELF expects 64K pages and aligns its segments to 64K. (This also raises the problem of how to handle cross-arch page sizes like that when we load cross-arch ELF files for drcachesim trace analysis and other purposes: right now using the host page size is working b/c we only run AArch64 on x86 where x86's page size is smaller.)

Getting into the details: it is a little murky as to which loaders honor p_align, and what p_align really means. I found a case where an ELF file's segments had 2MB p_align, but the kernel there completely ignored the p_align (slightly custom Linux kernel). DR not matching the kernel in this respect causes major problems when our early injection parses the libdynamorio.so headers for relocation.

Assignee
Assign to
Time tracking