aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeff Law <law@redhat.com>1993-11-24 20:45:32 +0000
committerJeff Law <law@redhat.com>1993-11-24 20:45:32 +0000
commit8d898eda89079fb3b320fe91eec646edc557caa5 (patch)
tree4304c6a50d8520613b92aba78d6a123c2c20911b
parent58e78037a3f0377692c0acbcc7943845c7a760e5 (diff)
downloadgdb-8d898eda89079fb3b320fe91eec646edc557caa5.zip
gdb-8d898eda89079fb3b320fe91eec646edc557caa5.tar.gz
gdb-8d898eda89079fb3b320fe91eec646edc557caa5.tar.bz2
* gas/hppa/reloc/fixupbug.s: New test.
* gas/hppa/reloc/reloc.exp: Run it.
-rw-r--r--gas/testsuite/ChangeLog3
-rw-r--r--gas/testsuite/gas/hppa/reloc/.Sanitize1
-rw-r--r--gas/testsuite/gas/hppa/reloc/fixupbug.s19
-rwxr-xr-xgas/testsuite/gas/hppa/reloc/reloc.exp38
4 files changed, 61 insertions, 0 deletions
diff --git a/gas/testsuite/ChangeLog b/gas/testsuite/ChangeLog
index ee5d047..b160628 100644
--- a/gas/testsuite/ChangeLog
+++ b/gas/testsuite/ChangeLog
@@ -1,5 +1,8 @@
Wed Nov 24 01:25:03 1993 Jeffrey A. Law (law@snake.cs.utah.edu)
+ * gas/hppa/reloc/fixupbug.s: New test.
+ * gas/hppa/reloc/reloc.exp: Run it.
+
* gas/hppa/reloc/exitbug.s: New test.
* gas/hppa/reloc/reloc.exp: Run it.
diff --git a/gas/testsuite/gas/hppa/reloc/.Sanitize b/gas/testsuite/gas/hppa/reloc/.Sanitize
index a25d407..b4d9bb0 100644
--- a/gas/testsuite/gas/hppa/reloc/.Sanitize
+++ b/gas/testsuite/gas/hppa/reloc/.Sanitize
@@ -29,6 +29,7 @@ Things-to-keep:
blebug.s
blebug2.s
exitbug.s
+fixupbug.s
labelopbug.s
plabelbug.s
reloc.exp
diff --git a/gas/testsuite/gas/hppa/reloc/fixupbug.s b/gas/testsuite/gas/hppa/reloc/fixupbug.s
new file mode 100644
index 0000000..8a58d02
--- /dev/null
+++ b/gas/testsuite/gas/hppa/reloc/fixupbug.s
@@ -0,0 +1,19 @@
+ .SPACE $PRIVATE$
+ .SUBSPA $DATA$,QUAD=1,ALIGN=8,ACCESS=31
+ .SUBSPA $BSS$,QUAD=1,ALIGN=8,ACCESS=31,ZERO,SORT=82
+ .SPACE $TEXT$
+ .SUBSPA $LIT$,QUAD=0,ALIGN=8,ACCESS=44
+ .SUBSPA $CODE$,QUAD=0,ALIGN=8,ACCESS=44,CODE_ONLY
+ .SUBSPA $MILLICODE$,QUAD=0,ALIGN=8,ACCESS=44,SORT=8
+
+ .SPACE $TEXT$
+ .SUBSPA $CODE$
+
+ b,n $$foo
+ nop
+ nop
+
+ .SPACE $TEXT$
+ .SUBSPA $MILLICODE$
+$$foo:
+ nop
diff --git a/gas/testsuite/gas/hppa/reloc/reloc.exp b/gas/testsuite/gas/hppa/reloc/reloc.exp
index bfbad40..c42ac0e 100755
--- a/gas/testsuite/gas/hppa/reloc/reloc.exp
+++ b/gas/testsuite/gas/hppa/reloc/reloc.exp
@@ -240,6 +240,40 @@ proc do_exit_relocation_test {} {
}
}
+proc do_cross_space_fixup_test {} {
+ set testname "fixupbug.s: Test cross space jump/call fixup bug (part 2)"
+ set x 0
+
+ # ELF (osf) doesn't really handle extra sections too well...
+ if [istarget hppa*-*-osf*] then {
+ return;
+ }
+
+ if [gas_test_old "fixupbug.s" "" "Test cross sapce jump/call fixup bug (part 1)"] {
+ objdump_start_no_subdir "a.out" "-r"
+
+ # Make sure GAS generated a fixup/relocation for the cross-space
+ # branch/call
+ setup_xfail hppa*-*-*
+ while 1 {
+ expect {
+ -re "^00000000\[^\n\]*PCREL_CALL\[^\n\]*\n"
+ { set x [expr $x+1] }
+ -re "\[^\n\]*\n" { }
+ timeout { error "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.
+ objdump_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 {
# Make sure we put the right relocation entry on a BLE instruction.
do_ble_relocation_test
@@ -267,4 +301,8 @@ if [istarget hppa*-*-*] then {
# GAS2 incorrectly generated R_EXIT relocations when .exit directives
# were not in the source code.
do_exit_relocation_test
+
+ # GAS2 incorrectly thought it could apply a fixup for a pc-relative
+ # branch/call which crossed different subspaces.
+ do_cross_space_fixup_test
}