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
  • #5295
Closed
Open
Issue created Jan 27, 2022 by Derek Bruening@derekbrueningContributor

AArch64 opnd_create_abs_addr() succeeds but opnd_is_memory_reference() returns false

For #4134 (closed) and #3995 I'm porting drbbdup to arm and its tests call opnd_create_abs_addr() to create the runtime_case_opnd. DR lets it create an absolute addr opnd of type ABS_ADDR_kind on AArch64; but then opnd_is_memory_reference returns false on AArch64 because the check for opnd_is_abs_addr() is limited to IF_X86_64. Basically, DR isn't sure it wants to support absolute address operands for AArch64, since the addressing modes there do not have that sort of thing. Maybe users are expected to use opnd_create_rel_addr() instead (AArch64 does have #define OPND_CREATE_ABSMEM(addr, size) opnd_create_rel_addr(addr, size)): but the docs for opnd_create_abs_addr() say it will auto-convert into a rel addr.

The rest of the code for abs addr handling in opnd_shared.c is just gated by X64, so opnd_is_memory_reference looks like an anomaly. So maybe the solution is to fix opnd_is_memory_reference to return true, and ensure the AArch64 and ARM encoders handle ABS_ADDR_kind and treat it just like rel-addr (the alternative of converting to rel-addr at creation time might confuse users who would query their own just-created abs-addr opnd and it would return false for opnd_is_abs_addr()).

I went to check whether the AArch64 encoder might already handle abs-addr: but it looks like it doesn't even handle rel-addr! See https://github.com/DynamoRIO/dynamorio/issues/4847#issuecomment-1023433975

Assignee
Assign to
Time tracking