I wanna specify a 512 x 32 bit array in my assembly file and this looks as follows:
#define FUNCTION_01 test
#define LABEL_01(name) .L ## test ## _ ## name
.section ".data"
my_array:
.word 0x10101010
.word 0x20101010
.word 0x30101010
.word 0x40101010
...
.section ".text"
.align 4
.global FUNCTION_01
.type FUNCTION_01,#function
FUNCTION_01:
add %g0, 12, %l7
ld [%l7 + my_array], %l7
...
ret
restore
LABEL_01(end):
.size FUNCTION_01,LABEL_01(end)-FUNCTION
So what I try to do in function_01 is to access the 4-th element in my array. However, when I try to compile the assembly above for the SPARC architecture I get the following error:
(.text+0x75c): relocation truncated to fit: R_SPARC_13 against `.data'
collect2: ld returned 1 exit status
Not sure what to make from this error. Does it mean the array is to big or did I something else wrong in the code?