summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGeoffrey Keating <geoffk@geoffk.org>1999-10-07 02:57:33 +0000
committerGeoffrey Keating <geoffk@geoffk.org>1999-10-07 02:57:33 +0000
commit07147777d3c2d251e3395f52f5236393c15a3d2e (patch)
tree721ce0f852545041bc76069b3a3f599854e85c68
parentcfd0966cb537ea42e35861bbfed3f54acc1351b8 (diff)
downloadbinutils-gdb-07147777d3c2d251e3395f52f5236393c15a3d2e.tar.gz
* gas/mips/elf-rel.s: New file.
* gas/mips/elf-rel.d: New file. * gas/mips/elf-rel2.d: New file. * gas/mips/e32-rel2.d: New file. * gas/mips/elf-rel2.s: New file. * gas/mips/mips.exp: Add elf-rel, elf-rel2. * gas/mips/elf_e_flags1.d: Tweak a little so it passes even if the CPU is set to something by default.
-rw-r--r--gas/testsuite/ChangeLog12
-rw-r--r--gas/testsuite/gas/mips/e32-rel2.d30
-rw-r--r--gas/testsuite/gas/mips/elf-rel.d42
-rw-r--r--gas/testsuite/gas/mips/elf-rel.s33
-rw-r--r--gas/testsuite/gas/mips/elf-rel2.d26
-rw-r--r--gas/testsuite/gas/mips/elf-rel2.s29
-rw-r--r--gas/testsuite/gas/mips/elf_e_flags1.d2
-rw-r--r--gas/testsuite/gas/mips/mips.exp9
8 files changed, 182 insertions, 1 deletions
diff --git a/gas/testsuite/ChangeLog b/gas/testsuite/ChangeLog
index b47a215dc3f..1bc2433db65 100644
--- a/gas/testsuite/ChangeLog
+++ b/gas/testsuite/ChangeLog
@@ -1,3 +1,15 @@
+Thu Oct 7 12:52:25 1999 Geoffrey Keating <geoffk@cygnus.com>
+
+ * gas/mips/elf-rel.s: New file.
+ * gas/mips/elf-rel.d: New file.
+ * gas/mips/elf-rel2.d: New file.
+ * gas/mips/e32-rel2.d: New file.
+ * gas/mips/elf-rel2.s: New file.
+ * gas/mips/mips.exp: Add elf-rel, elf-rel2.
+
+ * gas/mips/elf_e_flags1.d: Tweak a little so it passes
+ even if the CPU is set to something by default.
+
Mon Oct 4 18:25:49 1999 Doug Evans <devans@canuck.cygnus.com>
* gas/m32r/error.exp: New testcase driver.
diff --git a/gas/testsuite/gas/mips/e32-rel2.d b/gas/testsuite/gas/mips/e32-rel2.d
new file mode 100644
index 00000000000..cc494164cf6
--- /dev/null
+++ b/gas/testsuite/gas/mips/e32-rel2.d
@@ -0,0 +1,30 @@
+#objdump: -sr -j .text
+#name: MIPS ELF reloc 2 (32-bit)
+#source: elf-rel2.s
+
+# Test the GPREL and LITERAL generation.
+# FIXME: really this should check that the contents of .sdata, .lit4,
+# and .lit8 are correct too.
+
+.*: file format elf.*mips
+
+RELOCATION RECORDS FOR \[\.text\]:
+OFFSET TYPE VALUE
+0+0000000 R_MIPS_LITERAL \.lit8\+0x0+0004000
+0+0000004 R_MIPS_LITERAL \.lit8\+0x0+0004000
+0+0000008 R_MIPS_LITERAL \.lit8\+0x0+0004000
+0+000000c R_MIPS_LITERAL \.lit8\+0x0+0004000
+0+0000010 R_MIPS_LITERAL \.lit8\+0x0+0004000
+0+0000014 R_MIPS_LITERAL \.lit8\+0x0+0004000
+0+0000018 R_MIPS_LITERAL \.lit4\+0x0+0004000
+0+000001c R_MIPS_LITERAL \.lit4\+0x0+0004000
+0+0000020 R_MIPS_LITERAL \.lit4\+0x0+0004000
+0+0000024 R_MIPS_GPREL16 \.sdata\+0x0+0004000
+0+0000028 R_MIPS_GPREL16 \.sdata\+0x0+0004000
+0+000002c R_MIPS_GPREL16 \.sdata\+0x0+0004000
+
+
+Contents of section \.text:
+ 0000 c783c000 c782c004 c783c008 c782c00c .*
+ 0010 c783c010 c782c014 c782c000 c782c004 .*
+ 0020 c782c008 8f82c000 8f82c004 8f82c008 .*
diff --git a/gas/testsuite/gas/mips/elf-rel.d b/gas/testsuite/gas/mips/elf-rel.d
new file mode 100644
index 00000000000..c80bdd3c865
--- /dev/null
+++ b/gas/testsuite/gas/mips/elf-rel.d
@@ -0,0 +1,42 @@
+#objdump: -sr -j .text
+#name: MIPS ELF reloc
+
+# Test the HI16/LO16 generation.
+
+.*: file format elf.*mips
+
+RELOCATION RECORDS FOR \[\.text\]:
+OFFSET TYPE VALUE
+0+0000000 R_MIPS_HI16 \.text
+0+0000018 R_MIPS_LO16 \.text
+0+000000c R_MIPS_HI16 \.text
+0+000001c R_MIPS_LO16 \.text
+0+0000008 R_MIPS_HI16 \.text
+0+0000020 R_MIPS_LO16 \.text
+0+0000004 R_MIPS_HI16 \.text
+0+0000024 R_MIPS_LO16 \.text
+0+0000014 R_MIPS_HI16 \.text
+0+0000028 R_MIPS_LO16 \.text
+0+0000010 R_MIPS_HI16 \.text
+0+000002c R_MIPS_LO16 \.text
+0+0000030 R_MIPS_HI16 \.text
+0+0000048 R_MIPS_LO16 \.text
+0+0000034 R_MIPS_HI16 \.text
+0+000004c R_MIPS_LO16 \.text
+0+0000038 R_MIPS_HI16 \.text
+0+0000050 R_MIPS_LO16 \.text
+0+000003c R_MIPS_HI16 \.text
+0+0000054 R_MIPS_LO16 \.text
+0+0000044 R_MIPS_HI16 \.text
+0+0000058 R_MIPS_LO16 \.text
+0+0000040 R_MIPS_HI16 \.text
+0+000005c R_MIPS_LO16 \.text
+
+
+Contents of section \.text:
+ 0000 3c010000 3c010000 3c010001 3c010001 .*
+ 0010 3c010000 3c010001 20210018 2021001c .*
+ 0020 20210018 2021001c 20218018 2021fffc .*
+ 0030 3c010001 3c010001 3c010002 3c010002 .*
+ 0040 3c010001 3c010001 2021bffe 2021c002 .*
+ 0050 2021bffe 2021c002 20213ffe 2021bffa .*
diff --git a/gas/testsuite/gas/mips/elf-rel.s b/gas/testsuite/gas/mips/elf-rel.s
new file mode 100644
index 00000000000..40853428e4f
--- /dev/null
+++ b/gas/testsuite/gas/mips/elf-rel.s
@@ -0,0 +1,33 @@
+ .text
+ .align 15
+l0:
+l2 = l0+49150
+
+ .set noat
+ .set noreorder
+ lui $at,%hi(l1)
+ lui $at,%hi(l1+4)
+ lui $at,%hi(l1+0x10000)
+ lui $at,%hi(l1+0x10004)
+ lui $at,%hi(l0-4)
+ lui $at,%hi(l1+0x8000)
+l1:
+ addi $at,$at,%lo(l1)
+ addi $at,$at,%lo(l1+0x10004)
+ addi $at,$at,%lo(l1+0x10000)
+ addi $at,$at,%lo(l1+4)
+ addi $at,$at,%lo(l1+0x8000)
+ addi $at,$at,%lo(l0-4)
+
+ lui $at,%hi(l2)
+ lui $at,%hi(l2+4)
+ lui $at,%hi(l2+0x10000)
+ lui $at,%hi(l2+0x10004)
+ lui $at,%hi(l2-4)
+ lui $at,%hi(l2+0x8000)
+ addi $at,$at,%lo(l2)
+ addi $at,$at,%lo(l2+4)
+ addi $at,$at,%lo(l2+0x10000)
+ addi $at,$at,%lo(l2+0x10004)
+ addi $at,$at,%lo(l2+0x8000)
+ addi $at,$at,%lo(l2-4)
diff --git a/gas/testsuite/gas/mips/elf-rel2.d b/gas/testsuite/gas/mips/elf-rel2.d
new file mode 100644
index 00000000000..a20facfff86
--- /dev/null
+++ b/gas/testsuite/gas/mips/elf-rel2.d
@@ -0,0 +1,26 @@
+#objdump: -sr -j .text
+#name: MIPS ELF reloc 2
+
+# Test the GPREL and LITERAL generation.
+# FIXME: really this should check that the contents of .sdata, .lit4,
+# and .lit8 are correct too.
+
+.*: file format elf.*mips
+
+RELOCATION RECORDS FOR \[\.text\]:
+OFFSET TYPE VALUE
+0+0000000 R_MIPS_LITERAL \.lit8\+0x0+0004000
+0+0000004 R_MIPS_LITERAL \.lit8\+0x0+0004000
+0+0000008 R_MIPS_LITERAL \.lit8\+0x0+0004000
+0+000000c R_MIPS_LITERAL \.lit4\+0x0+0004000
+0+0000010 R_MIPS_LITERAL \.lit4\+0x0+0004000
+0+0000014 R_MIPS_LITERAL \.lit4\+0x0+0004000
+0+0000018 R_MIPS_GPREL16 \.sdata\+0x0+0004000
+0+000001c R_MIPS_GPREL16 \.sdata\+0x0+0004000
+0+0000020 R_MIPS_GPREL16 \.sdata\+0x0+0004000
+
+
+Contents of section \.text:
+ 0000 d782c000 d782c008 d782c010 c782c000 .*
+ 0010 c782c004 c782c008 8f82c000 8f82c004 .*
+ 0020 8f82c008 .*
diff --git a/gas/testsuite/gas/mips/elf-rel2.s b/gas/testsuite/gas/mips/elf-rel2.s
new file mode 100644
index 00000000000..27812ca833e
--- /dev/null
+++ b/gas/testsuite/gas/mips/elf-rel2.s
@@ -0,0 +1,29 @@
+ .sdata
+ .align 2
+ .type w1,@object
+ .size w1,4
+w1: .word 1
+ .type w2,@object
+ .size w2,4
+w2: .word 2
+ .type w3,@object
+ .size w3,4
+w3: .word 3
+
+ .text
+ .align 2
+l0:
+ .set noreorder
+
+ li.d $f2,1.10000000000000000000e0
+ li.d $f2,2.10000000000000000000e0
+ li.d $f2,3.10000000000000000000e0
+ li.s $f2,1.10000000000000000000e0
+ li.s $f2,2.10000000000000000000e0
+ li.s $f2,3.10000000000000000000e0
+
+ .set nomacro
+
+ lw $2,w1
+ lw $2,w2
+ lw $2,w3
diff --git a/gas/testsuite/gas/mips/elf_e_flags1.d b/gas/testsuite/gas/mips/elf_e_flags1.d
index 0dde67d590f..a0aa2f1bbf6 100644
--- a/gas/testsuite/gas/mips/elf_e_flags1.d
+++ b/gas/testsuite/gas/mips/elf_e_flags1.d
@@ -3,7 +3,7 @@
# objdump: -fd
.*:.*file format.*mips.*
-architecture: mips:[34]000, flags 0x00000011:
+architecture: mips:[34][0-9]00, flags 0x00000011:
HAS_RELOC, HAS_SYMS
start address 0x0000000000000000
diff --git a/gas/testsuite/gas/mips/mips.exp b/gas/testsuite/gas/mips/mips.exp
index 1b5269d9636..f1a0d57d339 100644
--- a/gas/testsuite/gas/mips/mips.exp
+++ b/gas/testsuite/gas/mips/mips.exp
@@ -99,4 +99,13 @@ if [istarget mips*-*-*] then {
run_dump_test "elf_e_flags2"
run_dump_test "elf_e_flags3"
run_dump_test "elf_e_flags4"
+
+ if $svr4pic {
+ run_dump_test "elf-rel"
+ if [istarget mips64*-*-*] {
+ run_dump_test "elf-rel2"
+ } {
+ run_dump_test "e32-rel2"
+ }
+ }
}