Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Thumb add to PC is incorrectly mangled #1919

Closed
derekbruening opened this issue Apr 3, 2016 · 0 comments
Closed

Thumb add to PC is incorrectly mangled #1919

derekbruening opened this issue Apr 3, 2016 · 0 comments

Comments

@derekbruening
Copy link
Contributor

Split from #1912

Running app_process32:

<cannot encode add>
<Source operand #2 has wrong type/size>
<Application /system/bin/app_process32 (16024) DynamoRIO usage error : instr_encode error: no encoding found (see log)>
<Usage error: instr_encode error: no encoding found (see log) (/work/dr/git/src/core/arch/arm/encode.c, line 2887)
interp: start_pc = 0x735c5592
check_thread_vm_area: pc = 0x735c5592
prepend_entry_to_fraglist: putting fragment @0x735c5592 (shared) on vmarea 0x7323f000-0x749512bc
  0x735c5592  f853 c024  ldr    (%r3,%r4,lsl 2)[4byte] -> %r12
  0x735c5596  44e7       add    %pc %r12 -> %pc
mbr exit target = 0x4e956220
end_pc = 0x735c5598

exit_branch_type=0x12 bb->exit_target=0x4e956220
bb ilist before mangling:
TAG  0x735c5592
 +0    L3              f853 c024  ldr    (%r3,%r4,lsl 2)[4byte] -> %r12
 +4    L3              44e7       add    %pc %r12 -> %pc
 +6    L4 @0x4e98520c  f7d7 bae4  b      $0x4e956220 <shared_bb_ibl_indjmp>
END 0x735c5592

bb ilist after mangling:
TAG  0x735c5592
 +0    L3              f853 c024  ldr    (%r3,%r4,lsl 2)[4byte] -> %r12
 +4    m4 @0x4e985968  f84a 0c00  str    %r0 -> (%r10)[4byte]
 +8    m4 @0x4ea76930  f245 509a  movw   $0x0000559a -> %r0
 +12   m4 @0x4ea6fdc4  f2c7 305c  movt   $0x0000735c -> %r0
 +16   m4 @0x4e985f40  f8ca 2008  str    %r2 -> +0x08(%r10)[4byte]
 +20   m4 @0x4ea7671c             <label>
ERROR: Could not find encoding for: add    %r0 %r12 -> %r2
Reason: Source operand #2 has wrong type/size
SYSLOG_ERROR: Application /system/bin/app_process32 (16177).  Internal Error: DynamoRIO debug check failure: /work/dr/git/src/core/arc
h/disassemble_shared.c:1441 nxt_pc != NULL

It's missing the shift immeds for the encoding that takes 3 registers.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant