Open chbessonova opened 5 years ago
@mskvortsov does R_MSP430_ABS32 equal to R_MSP430_32, R_MSP430_ABS16 to R_MSP430_16 and so on?
TI and bfd relocs have equal semantics in general but are definitely binary incompatible. It seems like the mapping is
TI EABI | GNU BFD ABI
------------------+-------------------------------------------
R_MSP430_NONE | R_MSP430_NONE
R_MSP430_ABS32 | R_MSP430_32
R_MSP430_ABS16 | R_MSP430_16, R_MSP430_16_BYTE
R_MSP430_ABS8 | R_MSP430_8
R_MSP430_PCR16 | R_MSP430_16_PCREL, R_MSP430_16_PCREL_BYTE
R_MSP430_ABS_HI16 | ?
R_MSP430_PREL31 | ?
? | R_MSP430_10_PCREL
? | R_MSP430_2X_PCREL
? | R_MSP430_RL_PCREL
? | R_MSP430_SYM_DIFF
Surprisingly enough, I don't see a match for bfd's R_MSP430_10_PCREL
in the EABI spec. That type of reloc is essential for any jmp
. It seems to me like the spec is bogus/incomplete/outdated in this part.
p. 11.5.1 and Table 12 MSP430-EABI define relocation types (18 of them)
Types supported by clang (and gcc) are not mentioned in MSP430-EABI (except first one):
This may cause incompatibility between TI/IAR and clang toolchains.
Note: gcc supports those types defined in MSP430-EABI, but according to the comments, they are used for MSP430x instructions.