Add initial support for Thumb for ARMv7a
Audit RequiredrL272881

Description

Add initial support for Thumb for ARMv7a

Add support for the R_ARM_THM relocations used in the objects present
in arm-linux-gnueabihf-gcc. These are:
R_ARM_THM_CALL
R_ARM_THM_JUMP11
R_ARM_THM_JUMP19
R_ARM_THM_JUMP24
R_ARM_THM_MOVT_ABS
R_ARM_THM_MOVW_ABS_NC

Interworking between ARM and Thumb is partially supported with BLX.
The R_ARM_CALL relocation for ARM instructions and R_ARM_THM_CALL
relocation for Thumb instructions will write out a BL or BLX depending
on the state of the Target.

Assumptions:
- Availability of BLX and extended range of Thumb 4-byte Branch
  instructions.
- In relocateOne if (Val & 0x1) == 1 target is Thumb, 0 is ARM.
  This will hold for objects that comply with the ABI for the
  ARM architecture.

This is sufficient for hello world to work with a recent
arm-linux-gnueabihf distribution.

Limitations:
No interworking for R_ARM_JUMP24, R_ARM_THM_JUMP24, R_ARM_THM_JUMP19
and the deprecated R_ARM_PLT32 and R_ARM_PC24 instructions as these
cannot be written out as a BLX and need a state change thunk.

No range extension thunks. The R_ARM_JUMP24 and R_ARM_THM_CALL have a
range of 16Mb

Details

Auditors
Bigcheese
Committed
psmithJun 16 2016, 2:53 AM
Parents
rL272880: [llvm-objdump] Support detection of feature bits from the object and…
Branches
Unknown
Tags
Unknown