aboutsummaryrefslogtreecommitdiff
path: root/gas
diff options
context:
space:
mode:
authorChris Demetriou <cgd@google.com>2002-01-02 18:59:32 +0000
committerChris Demetriou <cgd@google.com>2002-01-02 18:59:32 +0000
commita657e7c198e219e5e540a804f9e5dfb0d81ba886 (patch)
tree29a4f1dcec826a1121a21ba0c139e713d82d4bac /gas
parent20d54542b93d43f80c98f5a329c13f39e4835075 (diff)
downloadgdb-a657e7c198e219e5e540a804f9e5dfb0d81ba886.zip
gdb-a657e7c198e219e5e540a804f9e5dfb0d81ba886.tar.gz
gdb-a657e7c198e219e5e540a804f9e5dfb0d81ba886.tar.bz2
2002-01-02 Chris Demetriou <cgd@broadcom.com>
* ld-mips-elf/empic1-ln.d: New file to test basic linking of R_MIPS_GNU_REL_HI16 and R_MIPS_GNU_REL_LO16 relocations. * ld-mips-elf/empic1-lp.d: Likewise. * ld-mips-elf/empic1-mn.d: Likewise. * ld-mips-elf/empic1-mp.d: Likewise. * ld-mips-elf/empic1-sn.d: Likewise. * ld-mips-elf/empic1-sp.d: Likewise. * ld-mips-elf/empic1-ref.s: Likewise. * ld-mips-elf/empic1-space.s: Likewise. * ld-mips-elf/empic1-tgt.s: Likewise. * ld-mips-elf/empic2-fwd-0.d: New file to test R_MIPS_GNU_REL_HI16 and R_MIPS_GNU_REL_LO16 relocation edge cases. * ld-mips-elf/empic2-fwd-1.d: Likewise. * ld-mips-elf/empic2-rev-0.d: Likewise. * ld-mips-elf/empic2-rev-1.d: Likewise. * ld-mips-elf/empic2-ref.s: Likewise. * ld-mips-elf/empic2-space.s: Likewise. * ld-mips-elf/empic2-fwd-tgt.s: Likewise. * ld-mips-elf/empic2-rev-tgt.s: Likewise. * ld-mips-elf/mips-elf.exp: New file to run MIPS 32-bit ELF tests (including those above).
Diffstat (limited to 'gas')
-rw-r--r--gas/testsuite/ChangeLog11
-rw-r--r--gas/testsuite/gas/mips/empic3_e.d47
-rw-r--r--gas/testsuite/gas/mips/empic3_e.s46
-rw-r--r--gas/testsuite/gas/mips/empic3_g1.d47
-rw-r--r--gas/testsuite/gas/mips/empic3_g1.s46
-rw-r--r--gas/testsuite/gas/mips/empic3_g2.d47
-rw-r--r--gas/testsuite/gas/mips/empic3_g2.s46
-rw-r--r--gas/testsuite/gas/mips/mips.exp3
8 files changed, 293 insertions, 0 deletions
diff --git a/gas/testsuite/ChangeLog b/gas/testsuite/ChangeLog
index daa3051..7fdf423 100644
--- a/gas/testsuite/ChangeLog
+++ b/gas/testsuite/ChangeLog
@@ -1,3 +1,14 @@
+2002-01-02 Chris Demetriou <cgd@broadcom.com>
+
+ * gas/mips/empic3_e.d: New file to test -membedded-pic
+ R_MIPS_GNU_REL_HI16 and R_MIPS_GNU_REL_LO16 relocations.
+ * gas/mips/empic3_e.s: Likewise.
+ * gas/mips/empic3_g1.d: Likewise.
+ * gas/mips/empic3_g1.s: Likewise.
+ * gas/mips/empic3_g2.d: Likewise.
+ * gas/mips/empic3_g2.s: Likewise.
+ * gas/mips/mips.exp: Run the new tests.
+
2001-12-21 Anders Norlander <anorland@synergenix.se>
* gas/all/incbin.dat: New [binary] file.
diff --git a/gas/testsuite/gas/mips/empic3_e.d b/gas/testsuite/gas/mips/empic3_e.d
new file mode 100644
index 0000000..24ec944
--- /dev/null
+++ b/gas/testsuite/gas/mips/empic3_e.d
@@ -0,0 +1,47 @@
+#objdump: --prefix-addresses -dr --show-raw-insn -mmips:4000
+#name: MIPS empic3 (external)
+#as: -membedded-pic -mips3
+
+# Check PC-relative HI/LO relocs relocs for -membedded-pic when HI and
+# LO are split over a 32K boundary.
+
+.*: +file format elf.*mips.*
+
+Disassembly of section .text:
+ ...
+ ...
+0000fffc <[^>]*> 3c020001 lui v0,0x1
+[ ]*fffc: R_MIPS_GNU_REL_HI16 ext
+00010000 <[^>]*> 64428000 daddiu v0,v0,-32768
+[ ]*10000: R_MIPS_GNU_REL_LO16 ext
+ ...
+00017ffc <[^>]*> 3c020001 lui v0,0x1
+[ ]*17ffc: R_MIPS_GNU_REL_HI16 ext
+00018000 <[^>]*> 64420000 daddiu v0,v0,0
+[ ]*18000: R_MIPS_GNU_REL_LO16 ext
+ ...
+0001fffc <[^>]*> 3c020002 lui v0,0x2
+[ ]*1fffc: R_MIPS_GNU_REL_HI16 ext
+00020000 <[^>]*> 0043102d daddu v0,v0,v1
+00020004 <[^>]*> 64428004 daddiu v0,v0,-32764
+[ ]*20004: R_MIPS_GNU_REL_LO16 ext
+ ...
+00027ffc <[^>]*> 3c020002 lui v0,0x2
+[ ]*27ffc: R_MIPS_GNU_REL_HI16 ext
+00028000 <[^>]*> 0043102d daddu v0,v0,v1
+00028004 <[^>]*> 64420004 daddiu v0,v0,4
+[ ]*28004: R_MIPS_GNU_REL_LO16 ext
+ ...
+0002fff8 <[^>]*> 3c020003 lui v0,0x3
+[ ]*2fff8: R_MIPS_GNU_REL_HI16 ext
+0002fffc <[^>]*> 0043102d daddu v0,v0,v1
+00030000 <[^>]*> 64428000 daddiu v0,v0,-32768
+[ ]*30000: R_MIPS_GNU_REL_LO16 ext
+ ...
+00037ff8 <[^>]*> 3c020003 lui v0,0x3
+[ ]*37ff8: R_MIPS_GNU_REL_HI16 ext
+00037ffc <[^>]*> 0043102d daddu v0,v0,v1
+00038000 <[^>]*> 64420000 daddiu v0,v0,0
+[ ]*38000: R_MIPS_GNU_REL_LO16 ext
+ ...
+ ...
diff --git a/gas/testsuite/gas/mips/empic3_e.s b/gas/testsuite/gas/mips/empic3_e.s
new file mode 100644
index 0000000..7a8d21a
--- /dev/null
+++ b/gas/testsuite/gas/mips/empic3_e.s
@@ -0,0 +1,46 @@
+# Check PC-relative HI/LO relocs relocs for -membedded-pic when HI and
+# LO are split over a 32K boundary.
+
+ .text
+ .set noreorder
+
+ SYM_TO_TEST = ext
+
+ .globl ext
+
+ .org 0x00000
+ .globl g1
+g1:
+l1:
+
+ .org 0x08000
+ .globl fn
+ .ent fn
+fn:
+ .org (0x10000 - 4)
+ la $2, SYM_TO_TEST - fn # expands to 2 instructions
+
+ .org (0x18000 - 4)
+ la $2, SYM_TO_TEST - fn # expands to 2 instructions
+
+ .org (0x20000 - 4)
+ la $2, (SYM_TO_TEST - fn)($3) # expands to 3 instructions
+
+ .org (0x28000 - 4)
+ la $2, (SYM_TO_TEST - fn)($3) # expands to 3 instructions
+
+ .org (0x30000 - 8)
+ la $2, (SYM_TO_TEST - fn)($3) # expands to 3 instructions
+
+ .org (0x38000 - 8)
+ la $2, (SYM_TO_TEST - fn)($3) # expands to 3 instructions
+
+ .end fn
+
+ .org 0x40000
+ .globl g2
+g2:
+l2:
+
+# Force at least 8 (non-delay-slot) zero bytes, to make 'objdump' print ...
+ .space 8
diff --git a/gas/testsuite/gas/mips/empic3_g1.d b/gas/testsuite/gas/mips/empic3_g1.d
new file mode 100644
index 0000000..3e0f5ba
--- /dev/null
+++ b/gas/testsuite/gas/mips/empic3_g1.d
@@ -0,0 +1,47 @@
+#objdump: --prefix-addresses -dr --show-raw-insn -mmips:4000
+#name: MIPS empic3 (global, negative)
+#as: -membedded-pic -mips3
+
+# Check PC-relative HI/LO relocs relocs for -membedded-pic when HI and
+# LO are split over a 32K boundary.
+
+.*: +file format elf.*mips.*
+
+Disassembly of section .text:
+ ...
+ ...
+0000fffc <[^>]*> 3c020001 lui v0,0x1
+[ ]*fffc: R_MIPS_GNU_REL_HI16 .text
+00010000 <[^>]*> 64428000 daddiu v0,v0,-32768
+[ ]*10000: R_MIPS_GNU_REL_LO16 .text
+ ...
+00017ffc <[^>]*> 3c020001 lui v0,0x1
+[ ]*17ffc: R_MIPS_GNU_REL_HI16 .text
+00018000 <[^>]*> 64420000 daddiu v0,v0,0
+[ ]*18000: R_MIPS_GNU_REL_LO16 .text
+ ...
+0001fffc <[^>]*> 3c020002 lui v0,0x2
+[ ]*1fffc: R_MIPS_GNU_REL_HI16 .text
+00020000 <[^>]*> 0043102d daddu v0,v0,v1
+00020004 <[^>]*> 64428004 daddiu v0,v0,-32764
+[ ]*20004: R_MIPS_GNU_REL_LO16 .text
+ ...
+00027ffc <[^>]*> 3c020002 lui v0,0x2
+[ ]*27ffc: R_MIPS_GNU_REL_HI16 .text
+00028000 <[^>]*> 0043102d daddu v0,v0,v1
+00028004 <[^>]*> 64420004 daddiu v0,v0,4
+[ ]*28004: R_MIPS_GNU_REL_LO16 .text
+ ...
+0002fff8 <[^>]*> 3c020003 lui v0,0x3
+[ ]*2fff8: R_MIPS_GNU_REL_HI16 .text
+0002fffc <[^>]*> 0043102d daddu v0,v0,v1
+00030000 <[^>]*> 64428000 daddiu v0,v0,-32768
+[ ]*30000: R_MIPS_GNU_REL_LO16 .text
+ ...
+00037ff8 <[^>]*> 3c020003 lui v0,0x3
+[ ]*37ff8: R_MIPS_GNU_REL_HI16 .text
+00037ffc <[^>]*> 0043102d daddu v0,v0,v1
+00038000 <[^>]*> 64420000 daddiu v0,v0,0
+[ ]*38000: R_MIPS_GNU_REL_LO16 .text
+ ...
+ ...
diff --git a/gas/testsuite/gas/mips/empic3_g1.s b/gas/testsuite/gas/mips/empic3_g1.s
new file mode 100644
index 0000000..cf1df44
--- /dev/null
+++ b/gas/testsuite/gas/mips/empic3_g1.s
@@ -0,0 +1,46 @@
+# Check PC-relative HI/LO relocs relocs for -membedded-pic when HI and
+# LO are split over a 32K boundary.
+
+ .text
+ .set noreorder
+
+ SYM_TO_TEST = g1
+
+ .globl ext
+
+ .org 0x00000
+ .globl g1
+g1:
+l1:
+
+ .org 0x08000
+ .globl fn
+ .ent fn
+fn:
+ .org (0x10000 - 4)
+ la $2, SYM_TO_TEST - fn # expands to 2 instructions
+
+ .org (0x18000 - 4)
+ la $2, SYM_TO_TEST - fn # expands to 2 instructions
+
+ .org (0x20000 - 4)
+ la $2, (SYM_TO_TEST - fn)($3) # expands to 3 instructions
+
+ .org (0x28000 - 4)
+ la $2, (SYM_TO_TEST - fn)($3) # expands to 3 instructions
+
+ .org (0x30000 - 8)
+ la $2, (SYM_TO_TEST - fn)($3) # expands to 3 instructions
+
+ .org (0x38000 - 8)
+ la $2, (SYM_TO_TEST - fn)($3) # expands to 3 instructions
+
+ .end fn
+
+ .org 0x40000
+ .globl g2
+g2:
+l2:
+
+# Force at least 8 (non-delay-slot) zero bytes, to make 'objdump' print ...
+ .space 8
diff --git a/gas/testsuite/gas/mips/empic3_g2.d b/gas/testsuite/gas/mips/empic3_g2.d
new file mode 100644
index 0000000..2a6a452
--- /dev/null
+++ b/gas/testsuite/gas/mips/empic3_g2.d
@@ -0,0 +1,47 @@
+#objdump: --prefix-addresses -dr --show-raw-insn -mmips:4000
+#name: MIPS empic3 (global, positive)
+#as: -membedded-pic -mips3
+
+# Check PC-relative HI/LO relocs relocs for -membedded-pic when HI and
+# LO are split over a 32K boundary.
+
+.*: +file format elf.*mips.*
+
+Disassembly of section .text:
+ ...
+ ...
+0000fffc <[^>]*> 3c020005 lui v0,0x5
+[ ]*fffc: R_MIPS_GNU_REL_HI16 .text
+00010000 <[^>]*> 64428000 daddiu v0,v0,-32768
+[ ]*10000: R_MIPS_GNU_REL_LO16 .text
+ ...
+00017ffc <[^>]*> 3c020005 lui v0,0x5
+[ ]*17ffc: R_MIPS_GNU_REL_HI16 .text
+00018000 <[^>]*> 64420000 daddiu v0,v0,0
+[ ]*18000: R_MIPS_GNU_REL_LO16 .text
+ ...
+0001fffc <[^>]*> 3c020006 lui v0,0x6
+[ ]*1fffc: R_MIPS_GNU_REL_HI16 .text
+00020000 <[^>]*> 0043102d daddu v0,v0,v1
+00020004 <[^>]*> 64428004 daddiu v0,v0,-32764
+[ ]*20004: R_MIPS_GNU_REL_LO16 .text
+ ...
+00027ffc <[^>]*> 3c020006 lui v0,0x6
+[ ]*27ffc: R_MIPS_GNU_REL_HI16 .text
+00028000 <[^>]*> 0043102d daddu v0,v0,v1
+00028004 <[^>]*> 64420004 daddiu v0,v0,4
+[ ]*28004: R_MIPS_GNU_REL_LO16 .text
+ ...
+0002fff8 <[^>]*> 3c020007 lui v0,0x7
+[ ]*2fff8: R_MIPS_GNU_REL_HI16 .text
+0002fffc <[^>]*> 0043102d daddu v0,v0,v1
+00030000 <[^>]*> 64428000 daddiu v0,v0,-32768
+[ ]*30000: R_MIPS_GNU_REL_LO16 .text
+ ...
+00037ff8 <[^>]*> 3c020007 lui v0,0x7
+[ ]*37ff8: R_MIPS_GNU_REL_HI16 .text
+00037ffc <[^>]*> 0043102d daddu v0,v0,v1
+00038000 <[^>]*> 64420000 daddiu v0,v0,0
+[ ]*38000: R_MIPS_GNU_REL_LO16 .text
+ ...
+ ...
diff --git a/gas/testsuite/gas/mips/empic3_g2.s b/gas/testsuite/gas/mips/empic3_g2.s
new file mode 100644
index 0000000..4c070ee
--- /dev/null
+++ b/gas/testsuite/gas/mips/empic3_g2.s
@@ -0,0 +1,46 @@
+# Check PC-relative HI/LO relocs relocs for -membedded-pic when HI and
+# LO are split over a 32K boundary.
+
+ .text
+ .set noreorder
+
+ SYM_TO_TEST = g2
+
+ .globl ext
+
+ .org 0x00000
+ .globl g1
+g1:
+l1:
+
+ .org 0x08000
+ .globl fn
+ .ent fn
+fn:
+ .org (0x10000 - 4)
+ la $2, SYM_TO_TEST - fn # expands to 2 instructions
+
+ .org (0x18000 - 4)
+ la $2, SYM_TO_TEST - fn # expands to 2 instructions
+
+ .org (0x20000 - 4)
+ la $2, (SYM_TO_TEST - fn)($3) # expands to 3 instructions
+
+ .org (0x28000 - 4)
+ la $2, (SYM_TO_TEST - fn)($3) # expands to 3 instructions
+
+ .org (0x30000 - 8)
+ la $2, (SYM_TO_TEST - fn)($3) # expands to 3 instructions
+
+ .org (0x38000 - 8)
+ la $2, (SYM_TO_TEST - fn)($3) # expands to 3 instructions
+
+ .end fn
+
+ .org 0x40000
+ .globl g2
+g2:
+l2:
+
+# Force at least 8 (non-delay-slot) zero bytes, to make 'objdump' print ...
+ .space 8
diff --git a/gas/testsuite/gas/mips/mips.exp b/gas/testsuite/gas/mips/mips.exp
index 8c36216..f5cccc1 100644
--- a/gas/testsuite/gas/mips/mips.exp
+++ b/gas/testsuite/gas/mips/mips.exp
@@ -163,6 +163,9 @@ if { [istarget mips*-*-*] } then {
run_dump_test "elf-rel5"
run_dump_test "${tmips}${el}empic"
run_dump_test "empic2"
+ run_dump_test "empic3_e"
+ run_dump_test "empic3_g1"
+ run_dump_test "empic3_g2"
if { !$no_mips16 } {
run_dump_test "${tmips}mips${el}16-e"
run_dump_test "${tmips}mips${el}16-f"