Skip to content

Result mask for R_ARM_CALL/R_ARM_JUMP24 #305

@rui314

Description

@rui314

ARM32 ELF psABI defines that the result mask for R_ARM_CALL and R_ARM_JUMP24 relocations is 0x03FFFFFE (search for 0x03FFFFFE in https://github.com/ARM-software/abi-aa/blob/main/aaelf32/aaelf32.rst). But isn't that a typo for 0x03FFFFFC?

R_ARM_CALL and R_ARM_JUMP24 are used for B, BL and BLX instructions whose immediate size is 24. You can see the instruction format at https://developer.arm.com/documentation/ddi0597/2024-12/A32-Instructions-by-Encoding/Branch--branch-with-link--and-block-data-transfer?lang=en.

0x03FFFFFE masks all but the middle 25 bits and yields a 2-byte aligned address. I may be missing something, but it looks like it's simply a typo for 0x03FFFFFC, which yields a 24 bit value with 4-byte alignment.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions