mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-06-27 06:17:47 +08:00
* gas/hppa/reloc/picreloc.c: New test.
* gas/hppa/reloc/reloc.exp (do_pic_relocation_test): Run it.
This commit is contained in:
@ -33,6 +33,7 @@ exitbug.s
|
|||||||
fixupbug.s
|
fixupbug.s
|
||||||
funcrelocbug.s
|
funcrelocbug.s
|
||||||
labelopbug.s
|
labelopbug.s
|
||||||
|
picreloc.s
|
||||||
plabelbug.s
|
plabelbug.s
|
||||||
reduce.s
|
reduce.s
|
||||||
reduce2.s
|
reduce2.s
|
||||||
|
13
gas/testsuite/gas/hppa/reloc/picreloc.s
Normal file
13
gas/testsuite/gas/hppa/reloc/picreloc.s
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
|
||||||
|
.SPACE $TEXT$,SORT=8
|
||||||
|
.SUBSPA $CODE$,QUAD=0,ALIGN=4,ACCESS=0x2c,CODE_ONLY,SORT=24
|
||||||
|
.SPACE $PRIVATE$,SORT=16
|
||||||
|
.SUBSPA $DATA$,QUAD=1,ALIGN=8,ACCESS=0x1f,SORT=16
|
||||||
|
bogo
|
||||||
|
.ALIGN 8
|
||||||
|
.WORD bogo+4 ; = 0x4
|
||||||
|
.STRING "\x00\x00\x00{\x00\x00\x01\xC8\x00\x00\x03\x15"
|
||||||
|
.SPACE $PRIVATE$
|
||||||
|
.SUBSPA $DATA$
|
||||||
|
.EXPORT bogo
|
||||||
|
.END
|
@ -215,9 +215,9 @@ proc do_plabel_relocation_test {} {
|
|||||||
# Check that we make PLABEL relocation entries when they're needed.
|
# Check that we make PLABEL relocation entries when they're needed.
|
||||||
while 1 {
|
while 1 {
|
||||||
expect {
|
expect {
|
||||||
-re "^\[0c\]0000000\[^\n\]*PLABEL\[^\n\]*\n"
|
-re "^00000000\[^\n\]*PLABEL\[^\n\]*\n"
|
||||||
{ set x [expr $x+1] }
|
{ set x [expr $x+1] }
|
||||||
-re "^\[0c\]0000004\[^\n\]*PLABEL\[^\n\]*\n"
|
-re "^00000004\[^\n\]*PLABEL\[^\n\]*\n"
|
||||||
{ set x [expr $x+1] }
|
{ set x [expr $x+1] }
|
||||||
-re "\[^\n\]*\n" { }
|
-re "\[^\n\]*\n" { }
|
||||||
timeout { perror "timeout\n"; break }
|
timeout { perror "timeout\n"; break }
|
||||||
@ -541,7 +541,7 @@ proc do_r_no_reloc {} {
|
|||||||
# Make sure GAS generated a correct relocation for the reference.
|
# Make sure GAS generated a correct relocation for the reference.
|
||||||
while 1 {
|
while 1 {
|
||||||
expect {
|
expect {
|
||||||
-re "^\[0c\]00c0004\[^\n\]*PLABEL\[^\n]*g\[^\n\]*\n"
|
-re "^000c0004\[^\n\]*PLABEL\[^\n]*g\[^\n\]*\n"
|
||||||
{ set x [expr $x+1] }
|
{ set x [expr $x+1] }
|
||||||
-re "\[^\n\]*\n" { }
|
-re "\[^\n\]*\n" { }
|
||||||
timeout { perror "timeout\n"; break }
|
timeout { perror "timeout\n"; break }
|
||||||
@ -559,6 +559,33 @@ proc do_r_no_reloc {} {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
proc do_pic_relocation_test {} {
|
||||||
|
set testname "picreloc.s: Test for proper PIC relocation (part 2)"
|
||||||
|
set x 0
|
||||||
|
|
||||||
|
# ELF (osf) doesn't really handle extra sections too well...
|
||||||
|
if [istarget hppa*-*-*elf*] then {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
gas_start "picreloc.s" "-al"
|
||||||
|
|
||||||
|
while 1 {
|
||||||
|
expect {
|
||||||
|
-re "^ +\[0-9\]+ 0000 00000004\[^\n\]*\n" { set x [expr $x+1] }
|
||||||
|
-re "\[^\n\]*\n" { }
|
||||||
|
timeout { perror "timeout\n"; break }
|
||||||
|
eof { break }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
# This was intended to do any cleanup necessary. It kinda looks like it
|
||||||
|
# isn't needed, but just in case, please keep it in for now.
|
||||||
|
gas_finish
|
||||||
|
|
||||||
|
# Did we find what we were looking for? If not, flunk it.
|
||||||
|
if [expr $x==1] then { pass $testname } else { fail $testname }
|
||||||
|
}
|
||||||
if [istarget hppa*-*-*] then {
|
if [istarget hppa*-*-*] then {
|
||||||
# Make sure we put the right relocation entry on a BLE instruction.
|
# Make sure we put the right relocation entry on a BLE instruction.
|
||||||
do_ble_relocation_test
|
do_ble_relocation_test
|
||||||
@ -607,4 +634,8 @@ if [istarget hppa*-*-*] then {
|
|||||||
# Test for an off-by-one bug in the handling of 4-byte R_NO_RELOCATION
|
# Test for an off-by-one bug in the handling of 4-byte R_NO_RELOCATION
|
||||||
# fixups.
|
# fixups.
|
||||||
do_r_no_reloc
|
do_r_no_reloc
|
||||||
|
|
||||||
|
# Test a relocation problem which shows up when building shared
|
||||||
|
# libraries in SOM
|
||||||
|
do_pic_relocation_test
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user