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

ARM: Incorrect register access information for B and BL #826

Closed
Dil4rd opened this issue Dec 13, 2016 · 2 comments
Closed

ARM: Incorrect register access information for B and BL #826

Dil4rd opened this issue Dec 13, 2016 · 2 comments

Comments

@Dil4rd
Copy link

Dil4rd commented Dec 13, 2016

For ARM branch instructions there is no pc register in the list of accessed for write registers.

According to ARM asm manual branch, instructions like b and bl have syntax
B{L}{cond} label where "label is a program-relative expression".
This means that pc regiter should always be in list of accessed for read registers.
And, obviously, pc should be in list of accessed for write registers.

P.S. I don't check this for BX, BLX and BXJ instructions, but they can be also affected.

Example 1

It's obvious that for beq #0x90 the pc register will be read and written (to make smth like pc = pc + CONST) if zero flag is set.
But we have empty lists:

0x5c:   0B 00 00 0A beq #0x90
    implicit_regs_read = []
    implicit_regs_write = []
    regs_read = []
    regs_write = []
    op_count: 1
        operands[0].type: IMM = 0x90
    Code condition: 1

Actual

Read:

Written:

Expected

Read: pc

Written: pc

Example 2

For bl instructions pc register should also be in regs_write list of accessed registers.

0x190:  C5 2D 05 EB bl  #0x14b8ac
    implicit_regs_read = [u'pc']
    implicit_regs_write = [u'lr']
    regs_read = [u'pc']
    regs_write = [u'lr']
    op_count: 1
        operands[0].type: IMM = 0x14b8ac

Actual

Read: pc

Written: lr

Expected

Read: pc

Written: lr, pc

@aquynh
Copy link
Collaborator

aquynh commented Dec 13, 2016

fixed now, please confirm

@Dil4rd
Copy link
Author

Dil4rd commented Dec 13, 2016

Yes, fixed. Thanks!

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

No branches or pull requests

2 participants