1@ Tests for LDRS group relocations. 2 3 .text 4 5 .macro ldrtest2 load sym offset 6 7 \load r0, [r0, #:pc_g1:(\sym \offset)] 8 \load r0, [r0, #:pc_g2:(\sym \offset)] 9 \load r0, [r0, #:sb_g0:(\sym \offset)] 10 \load r0, [r0, #:sb_g1:(\sym \offset)] 11 \load r0, [r0, #:sb_g2:(\sym \offset)] 12 13 .endm 14 15 .macro ldrtest load store sym offset 16 17 ldrtest2 \load \sym \offset 18 19 \store r0, [r0, #:pc_g1:(\sym \offset)] 20 \store r0, [r0, #:pc_g2:(\sym \offset)] 21 \store r0, [r0, #:sb_g0:(\sym \offset)] 22 \store r0, [r0, #:sb_g1:(\sym \offset)] 23 \store r0, [r0, #:sb_g2:(\sym \offset)] 24 25 .endm 26 27@ LDRD/STRD/LDRH/STRH/LDRSH/LDRSB only have 8 bits available for the 28@ magnitude of the addend. So these should all (just) work. 29 30 ldrtest ldrd strd f "+ 255" 31 ldrtest ldrh strh f "+ 255" 32 ldrtest2 ldrsh f "+ 255" 33 ldrtest2 ldrsb f "+ 255" 34 35 ldrtest ldrd strd f "- 255" 36 ldrtest ldrh strh f "- 255" 37 ldrtest2 ldrsh f "- 255" 38 ldrtest2 ldrsb f "- 255" 39 40@ The same as the above, but for a local symbol. 41 42 ldrtest ldrd strd localsym "+ 255" 43 ldrtest ldrh strh localsym "+ 255" 44 ldrtest2 ldrsh localsym "+ 255" 45 ldrtest2 ldrsb localsym "+ 255" 46 47 ldrtest ldrd strd localsym "- 255" 48 ldrtest ldrh strh localsym "- 255" 49 ldrtest2 ldrsh localsym "- 255" 50 ldrtest2 ldrsb localsym "- 255" 51 52localsym: 53 mov r0, #0 54 55