DynamoRIO / DynamoRIO/dynamorio

ARM: `opnd_create_base_disp` and `opnd_create_base_disp_aarch64` produce different results

Open
#5,510 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
C
Stars
3.2k
Forks
629
Avg merge
2d 15h
Merged PRs (30d)
31

Description

The difference is `pre_index` value which is `true` from `opnd_create_base_disp` and `false` from `opnd_create_base_disp_aarch64`.

As a result DynamoRIO fails to encode the following code snippet:
```
opnd_t dst = opnd_create_reg(DR_REG_XZR);
opnd_t ptr = opnd_create_reg(DR_REG_X9);
opnd_t mem = opnd_create_base_disp(DR_REG_X9, DR_REG_NULL, 0, 0, OPSZ_PTR);
instr_t *i = instr_create_2dst_3src(dc, OP_ldr, dst, ptr, mem, ptr, OPND_CREATE_INT(-8));
instr_encode_to_copy(drcontext, i, buf, 0);
```

An error is like ` %xzr %x9'`

It's ok if I use `opnd_create_base_disp_aarch64` for both pre-indexing and post-indexing modes.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.