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/T relative branches invalid immediate value #1784

Closed
0x416c69 opened this issue Sep 18, 2021 · 0 comments · Fixed by #1949
Closed

ARM/T relative branches invalid immediate value #1784

0x416c69 opened this issue Sep 18, 2021 · 0 comments · Fixed by #1949

Comments

@0x416c69
Copy link

0x416c69 commented Sep 18, 2021

I just wanna know what is this decision based on:
https://github.com/aquynh/capstone/blob/45bec1a691e455b864f7e4d394711a467e5493dc/arch/ARM/ARMInstPrinter.c#L853-L874

ARM docs clearly say (100076_0200_00_en page 132):

label
is a PC-relative expression.

And ARM ARM (DDI0406C A2.3):

PC, the program counter
• When executing an ARM instruction, PC reads as the address of the current instruction
plus 8.
• When executing a Thumb instruction, PC reads as the address of the current instruction
plus 4.

And it's like this in UAL too.

Even if this is the case with capstone and some assemblers, why only relative branches? What about other PC-relative instructions such as LDR?

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

Successfully merging a pull request may close this issue.

1 participant