Skip to content

ARM/T relative branches invalid immediate value #1784

@0x416c69

Description

@0x416c69

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions