* gas/hppa/reloc/exitbug.s: New test.
authorJeff Law <law@redhat.com>
Wed, 24 Nov 1993 09:26:23 +0000 (09:26 +0000)
committerJeff Law <law@redhat.com>
Wed, 24 Nov 1993 09:26:23 +0000 (09:26 +0000)
        * gas/hppa/reloc/reloc.exp: Run it.

gas/testsuite/ChangeLog
gas/testsuite/gas/hppa/reloc/.Sanitize
gas/testsuite/gas/hppa/reloc/exitbug.s [new file with mode: 0644]
gas/testsuite/gas/hppa/reloc/reloc.exp

index b24be2fa5e02a56ed22a7387bb328f6a800164ef..ee5d0478f9689ac24fe5e4ce946c0af9da163542 100644 (file)
@@ -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.
 
index 1abb9b6392234d5612467ea4d96dc1e3a5108d8c..a25d407a518b9fa2278f67f3360e4164aa70aad6 100644 (file)
@@ -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 (file)
index 0000000..8898e35
--- /dev/null
@@ -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
index 7c75e93a8158398eacdcdfab2d31130ce037a6c5..bfbad40f4774d7e4cc031b250200b49836cde51e 100755 (executable)
@@ -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
 }