mirror of
https://sourceware.org/git/binutils-gdb.git
synced 2024-12-18 14:53:32 +08:00
fa1c017017
The R_ARC_SDA32 is wrongly described as a ME relocation, fix it. Offset the __SDATA_BEGIN__ to take advantage of the signed 9-bit field of the load/store instructions. include/ 2016-07-08 Claudiu Zissulescu <claziss@synopsys.com> * elf/arc-reloc.def (ARC_SDA32): Don't use ME transformation. ld/ 2016-07-08 Claudiu Zissulescu <claziss@synopsys.com> * emulparams/arcelf.sh (SDATA_START_SYMBOLS): Add offset. * testsuite/ld-arc/sda-relocs.dd: New file. * testsuite/ld-arc/sda-relocs.ld: Likewise. * testsuite/ld-arc/sda-relocs.rd: Likewise. * testsuite/ld-arc/sda-relocs.s: Likewise. * testsuite/ld-arc/arc.exp: Add SDA tests.
33 lines
650 B
ArmAsm
33 lines
650 B
ArmAsm
.section .text
|
|
.align 4
|
|
;;; all the ops should have the same offset.
|
|
ld_s r0,[gp,@a@sda]
|
|
;; BFD_RELOC_ARC_SDA16_LD2
|
|
ldh_s r0,[gp,@a@sda]
|
|
;; BFD_RELOC_ARC_SDA16_LD1
|
|
ldb_s r0,[gp,@a@sda]
|
|
;; BFD_RELOC_ARC_SDA16_LD
|
|
ld.as r0,[gp,@a@sda]
|
|
st.as r0,[gp,@a@sda]
|
|
;; BFD_RELOC_ARC_SDA_LDST2
|
|
ld r0,[gp,@a@sda]
|
|
ldb r0,[gp,@a@sda]
|
|
ldh r0,[gp,@a@sda]
|
|
;; ldd r0,[gp,@a@sda]
|
|
;; BFD_RELOC_ARC_SDA_LDST
|
|
sth.as r0,[gp,@a@sda]
|
|
;; BFD_RELOC_ARC_SDA_LDST1
|
|
ld_s r1,[gp,@a@sda]
|
|
st_s r0,[gp,@a@sda]
|
|
;; BFD_ARC_SDA16_ST2
|
|
add r2, gp, @a@sda
|
|
;; BFD_ARC_SDA32_ME
|
|
|
|
.global a
|
|
.section .sbss,"aw",@nobits
|
|
.align 4
|
|
.type a, @object
|
|
.size a, 4
|
|
a:
|
|
.zero 4
|