aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeff Law <law@redhat.com>1993-11-24 09:26:23 +0000
committerJeff Law <law@redhat.com>1993-11-24 09:26:23 +0000
commit64f591aea9995463dbd2514db20cdf1464c8be87 (patch)
tree1c669614e4ecdbd0cde88d21b9e381a9157f0a21
parent31a385d17a7caf9dc6227035b390e593da4f0c99 (diff)
downloadgdb-64f591aea9995463dbd2514db20cdf1464c8be87.zip
gdb-64f591aea9995463dbd2514db20cdf1464c8be87.tar.gz
gdb-64f591aea9995463dbd2514db20cdf1464c8be87.tar.bz2
* gas/hppa/reloc/exitbug.s: New test.
* gas/hppa/reloc/reloc.exp: Run it.
-rw-r--r--gas/testsuite/ChangeLog9
-rw-r--r--gas/testsuite/gas/hppa/reloc/.Sanitize1
-rw-r--r--gas/testsuite/gas/hppa/reloc/exitbug.s19
-rwxr-xr-xgas/testsuite/gas/hppa/reloc/reloc.exp52
4 files changed, 74 insertions, 7 deletions
diff --git a/gas/testsuite/ChangeLog b/gas/testsuite/ChangeLog
index b24be2f..ee5d047 100644
--- a/gas/testsuite/ChangeLog
+++ b/gas/testsuite/ChangeLog
@@ -1,5 +1,14 @@
+Wed Nov 24 01:25:03 1993 Jeffrey A. Law (law@snake.cs.utah.edu)
+
+ * gas/hppa/reloc/exitbug.s: New test.
+ * gas/hppa/reloc/reloc.exp: Run it.
+
Sun Nov 21 22:11:10 1993 Jeffrey A. Law (law@snake.cs.utah.edu)
+ * gas/hppa/reloc/reloc.exp: Minor fixes so that SOM & ELF can
+ share the same test code.
+ * gas/hppa/reloc/relocreduce.s: Likewise.
+
* gas/hppa/basic/fmem.s: Add quadword FP store instructions.
* gas/hppa/basic/basic.exp: Test quadword FP store instructions.
diff --git a/gas/testsuite/gas/hppa/reloc/.Sanitize b/gas/testsuite/gas/hppa/reloc/.Sanitize
index 1abb9b6..a25d407 100644
--- a/gas/testsuite/gas/hppa/reloc/.Sanitize
+++ b/gas/testsuite/gas/hppa/reloc/.Sanitize
@@ -28,6 +28,7 @@ Things-to-keep:
blebug.s
blebug2.s
+exitbug.s
labelopbug.s
plabelbug.s
reloc.exp
diff --git a/gas/testsuite/gas/hppa/reloc/exitbug.s b/gas/testsuite/gas/hppa/reloc/exitbug.s
new file mode 100644
index 0000000..8898e35
--- /dev/null
+++ b/gas/testsuite/gas/hppa/reloc/exitbug.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
+ .IMPORT $global$,DATA
+ .IMPORT $$dyncall,MILLICODE
+; gcc_compiled.:
+ .SPACE $TEXT$
+ .SUBSPA $CODE$
+
+ .align 4
+ .EXPORT foo,CODE
+ .EXPORT foo,ENTRY,PRIV_LEV=3
+foo:
+ .PROC
+ .CALLINFO FRAME=0
+ .PROCEND
diff --git a/gas/testsuite/gas/hppa/reloc/reloc.exp b/gas/testsuite/gas/hppa/reloc/reloc.exp
index 7c75e93..bfbad40 100755
--- a/gas/testsuite/gas/hppa/reloc/reloc.exp
+++ b/gas/testsuite/gas/hppa/reloc/reloc.exp
@@ -31,7 +31,7 @@ proc do_ble_relocation_test {} {
# a PC-relative relocation for a BLE instruction.
while 1 {
expect {
- -re "^00000004\[^\n\]*ABS_CALL_R17\[^\n\]*\n" { set x 1 }
+ -re "^00000004\[^\n\]*ABS_CALL\[^\n\]*\n" { set x 1 }
-re "\[^\n\]*\n" { }
timeout { error "timeout\n"; break }
eof { break }
@@ -59,10 +59,10 @@ proc do_relocation_reduction_tests {} {
# Doing so makes generating parameter relocation stubs impossible.
while 1 {
expect {
- -re "^00000000\[^\n\]*PLABEL\[^\n\]*foo\[^\n\]*\n"
+ -re "^00000004\[^\n\]*PLABEL\[^\n\]*foo\[^\n\]*\n"
+ { set x [expr $x+1] }
+ -re "^00000014\[^\n\]*PCREL_CALL\[^\n\]*foo\[^\n\]*\n"
{ set x [expr $x+1] }
- -re "^0000001c\[^\n\]*PCREL_CALL\[^\n\]*foo\[^\n\]*\n"
- { set x [4xpr $x+1] }
-re "\[^\n\]*\n" { }
timeout { error "timeout\n"; break }
eof { break }
@@ -113,8 +113,10 @@ proc do_plabel_relocation_test {} {
# Check that we make PLABEL relocation entries when they're needed.
while 1 {
expect {
- -re "^00000000\[^\n\]*PLABEL\[^\n\]*\n" { set x [expr $x+1] }
- -re "^00000004\[^\n\]*PLABEL\[^\n\]*\n" { set x [expr $x+1] }
+ -re "^\[04\]0000000\[^\n\]*PLABEL\[^\n\]*\n"
+ { set x [expr $x+1] }
+ -re "^\[04\]0000004\[^\n\]*PLABEL\[^\n\]*\n"
+ { set x [expr $x+1] }
-re "\[^\n\]*\n" { }
timeout { error "timeout\n"; break }
eof { break }
@@ -205,6 +207,39 @@ proc do_local_label_as_operand_test {} {
}
}
+proc do_exit_relocation_test {} {
+ set testname "exitbug.s: Test for bogus R_EXIT relocation (part 2)"
+ set x 0
+
+ # Elf (osf) does not use ENTRY/EXIT relocations.
+ # I guess we could look at the unwind subspaces it builds...
+ if [istarget hppa*-*-osf*] then {
+ return;
+ }
+
+ if [gas_test_old "exitbug.s" "" "Test for bogus R_EXIT relocation (part 1)"] {
+ objdump_start_no_subdir "a.out" "-r"
+
+ # Note that a match here is really a FAILURE!
+ while 1 {
+ expect {
+ -re "^00000000\[^\n\]*R_EXIT\[^\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==0] 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
@@ -214,7 +249,6 @@ if [istarget hppa*-*-*] then {
do_relocation_reduction_tests
# Check that mode selectors on a ble instruction actually work.
- setup_xfail hppa*-*-*
do_ble_mode_selector_test
# 1.36 simply didn't generate all the plabels it should have. Make
@@ -229,4 +263,8 @@ if [istarget hppa*-*-*] then {
# easier on the optimizing linker. Until then just make sure the
# difference is computed correctly.
do_local_label_as_operand_test
+
+ # GAS2 incorrectly generated R_EXIT relocations when .exit directives
+ # were not in the source code.
+ do_exit_relocation_test
}