This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Re: [PATCH] New port @GOTOFF, @GOT,@PLT relocation token for target m32r
Approved and applied.
One thing though - please would you consider adding a new test to the
m32r section of the GAS testsuite to make sure that this new support
works, and continues to work with future releases.
Cheers
Nick
Thanks Nick!
I made a test case for @GOTOFF, @GOT, @PLT.
Please apply it too.
Regards,
Kazuhiro Inaoka
gas/testsuite/ChangeLog
2004-06-28 Kazuhiro Inaoka <inaoka dot kazuhiro at renesas dot com>
* gas/m32r/pic.exp: Add New Test case for @GOTOFF, @GOT, @PLT.
* gas/m32r/pic2.s: New file: Test case for @GOTOFF, @GOT, @PLT.
* gas/m32r/pic2.d: New file: Expected results.
Index: pic.exp
===================================================================
RCS file: /cvs/src/src/gas/testsuite/gas/m32r/pic.exp,v
retrieving revision 1.1
diff -c -r1.1 pic.exp
*** pic.exp 19 Dec 2003 11:44:01 -0000 1.1
--- pic.exp 28 Jun 2004 08:25:39 -0000
***************
*** 2,5 ****
--- 2,6 ----
if [istarget m32r*-*-*] {
run_dump_test "pic"
+ run_dump_test "pic2"
}
.section .text
# R_M32R_GOTPC24
pic_gotpc:
bl.s .+4
ld24 r12,#_GLOBAL_OFFSET_TABLE_
add r12,lr
# R_M32R_GOTPC_HI_ULO
# R_M32R_GOTPC_HI_SLO
# R_M32R_GOTPC_LO
pic_gotpc_slo:
bl.s .+4
seth r12,#shigh(_GLOBAL_OFFSET_TABLE_)
add3 r12,r12,#low(_GLOBAL_OFFSET_TABLE_+4)
add r12,lr
pic_gotpc_ulo:
bl.s .+4
seth r12,#high(_GLOBAL_OFFSET_TABLE_)
or3 r12,r12,#low(_GLOBAL_OFFSET_TABLE_+4)
add r12,lr
# R_M32R_GOT24
pic_got:
.global sym
ld24 r0,#sym@GOTOFF
# R_M32R_GOT16_HI_ULO
# R_M32R_GOT16_HI_SLO
# R_M32R_GOT16_LO
pic_got16:
.global sym2
seth r12,#shigh(sym2@GOT)
add3 r12,r12,#low(sym2@GOT)
seth r12,#high(sym2@GOTOFF)
or3 r12,r12,#low(sym2@GOT)
# R_M32R_26_PLTREL
pic_plt:
.global func
bl func@PLT
# R_M32R_GOTOFF
gotoff:
ld24 r0,#gotoff@GOTOFF
# R_M32R_GOTOFF_HI_ULO
# R_M32R_GOTOFF_HI_SLO
# R_M32R_GOTOFF_LO
seth r0,#shigh(gotoff@GOTOFF)
add3 r0,r0,#low(gotoff@GOTOFF)
seth r0,#high(gotoff@GOTOFF)
or3 r0,r0,#low(gotoff@GOTOFF)
.end
#objdump: -dr
#name: pic2
.*: +file format .*
Disassembly of section .text:
0+0000 <pic_gotpc>:
0: 7e 01 f0 00 bl 4 <pic_gotpc\+0x4> \|\| nop
4: ec 00 00 00 ld24 r12,0 <pic_gotpc>
4: R_M32R_GOTPC24 _GLOBAL_OFFSET_TABLE_
8: 0c ae f0 00 add r12,lr \|\| nop
0+000c <pic_gotpc_slo>:
c: 7e 01 f0 00 bl 10 <pic_gotpc_slo\+0x4> \|\| nop
10: dc c0 00 00 seth r12,[#]0x0
10: R_M32R_GOTPC_HI_SLO _GLOBAL_OFFSET_TABLE_
14: 8c ac 00 00 add3 r12,r12,[#]0
14: R_M32R_GOTPC_LO _GLOBAL_OFFSET_TABLE_\+0x4
18: 0c ae f0 00 add r12,lr \|\| nop
0+001c <pic_gotpc_ulo>:
1c: 7e 01 f0 00 bl 20 <pic_gotpc_ulo\+0x4> \|\| nop
20: dc c0 00 00 seth r12,[#]0x0
20: R_M32R_GOTPC_HI_ULO _GLOBAL_OFFSET_TABLE_
24: 8c ec 00 00 or3 r12,r12,[#]0x0
24: R_M32R_GOTPC_LO _GLOBAL_OFFSET_TABLE_\+0x4
28: 0c ae f0 00 add r12,lr \|\| nop
0+002c <pic_got>:
2c: e0 00 00 00 ld24 r0,0 <pic_gotpc>
2c: R_M32R_GOTOFF sym
0+0030 <pic_got16>:
30: dc c0 00 00 seth r12,[#]0x0
30: R_M32R_GOT16_HI_SLO sym2
34: 8c ac 00 00 add3 r12,r12,[#]0
34: R_M32R_GOT16_LO sym2
38: dc c0 00 00 seth r12,[#]0x0
38: R_M32R_GOTOFF_HI_ULO sym2
3c: 8c ec 00 00 or3 r12,r12,[#]0x0
3c: R_M32R_GOT16_LO sym2
0+0040 <pic_plt>:
40: fe 00 00 00 bl 40 <pic_plt>
40: R_M32R_26_PLTREL func
0+0044 <gotoff>:
44: e0 00 00 00 ld24 r0,0 <pic_gotpc>
44: R_M32R_GOTOFF .text\+0x44
48: d0 c0 00 00 seth r0,[#]0x0
48: R_M32R_GOTOFF_HI_SLO .text\+0x44
4c: 80 a0 00 00 add3 r0,r0,[#]0
4c: R_M32R_GOTOFF_LO .text\+0x44
50: d0 c0 00 00 seth r0,[#]0x0
50: R_M32R_GOTOFF_HI_ULO .text\+0x44
54: 80 e0 00 00 or3 r0,r0,[#]0x0
54: R_M32R_GOTOFF_LO .text\+0x44