aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ld/testsuite/ChangeLog5
-rw-r--r--ld/testsuite/ld-cris/dso-pltdis1.d61
-rw-r--r--ld/testsuite/ld-cris/dso-pltdis2.d54
-rw-r--r--ld/testsuite/ld-cris/dsofn4g.s3
-rw-r--r--ld/testsuite/ld-cris/dsofng.s4
5 files changed, 127 insertions, 0 deletions
diff --git a/ld/testsuite/ChangeLog b/ld/testsuite/ChangeLog
index 22dd3b5..4f463b5 100644
--- a/ld/testsuite/ChangeLog
+++ b/ld/testsuite/ChangeLog
@@ -1,3 +1,8 @@
+2012-06-18 Hans-Peter Nilsson <hp@axis.com>
+
+ * ld-cris/dso-pltdis1.d, ld-cris/dso-pltdis2.d, dsofng.s
+ dsofn4g.s: New tests.
+
2012-06-17 Hans-Peter Nilsson <hp@axis.com>
* ld-cris/tls-e-tpiecomm1.d, ld-cris/tls-e-tpiecomm1.s: New test.
diff --git a/ld/testsuite/ld-cris/dso-pltdis1.d b/ld/testsuite/ld-cris/dso-pltdis1.d
new file mode 100644
index 0000000..4bc3c70
--- /dev/null
+++ b/ld/testsuite/ld-cris/dso-pltdis1.d
@@ -0,0 +1,61 @@
+#source: dsov32-1.s
+#source: dsov32-2.s
+#source: dsofn4g.s
+#as: --pic --no-underscore --march=v32 --em=criself
+#ld: --shared -m crislinux
+#objdump: -d -R
+
+# Check dissassembly of the .plt section, specifically the synthetic
+# symbols, in a DSO in which a .got.plt entry has been merged into a
+# regular .got entry. There was a bug in which some (i.e. subsequent
+# with regards to reloc order) synthetic X@plt entries were wrong if
+# there were merged .got entries present; dsofn4@plt below. The
+# alternatives in the matching regexps are placeholders for a future
+# improvement: synthetic symbols for .plt entries with merged .got
+# entries (lost as a consequence of the relocs no longer accounted for
+# in .rela.plt and the default synthetic-symbol implementation just
+# iterating over .rela.plt).
+
+.*: file format elf32-cris
+
+Disassembly of section \.plt:
+
+0+1b4 <(dsofn4@plt-0x1a|dsofn@plt-0x34)>:
+ 1b4: 84e2 subq 4,\$sp
+ 1b6: 0401 addoq 4,\$r0,\$acr
+ 1b8: 7e7a move \$mof,\[\$sp\]
+ 1ba: 3f7a move \[\$acr\],\$mof
+ 1bc: 04f2 addq 4,\$acr
+ 1be: 6ffa move\.d \[\$acr\],\$acr
+ 1c0: bf09 jump \$acr
+ 1c2: b005 nop
+ \.\.\.
+#...
+ 1ce: 6f0d ..00 0000 addo\.d .*
+ 1d4: 6ffa move\.d \[\$acr\],\$acr
+ 1d6: bf09 jump \$acr
+ 1d8: b005 nop
+ 1da: 3f7e .... .... move .*,\$mof
+ 1e0: bf0e .... .... ba .*
+ 1e6: b005 nop
+
+0+1e8 <dsofn@plt>:
+ 1e8: 6f0d ..00 0000 addo\.d .*
+ 1ee: 6ffa move\.d \[\$acr\],\$acr
+ 1f0: bf09 jump \$acr
+ 1f2: b005 nop
+ 1f4: 3f7e .... .... move .*,\$mof
+ 1fa: bf0e baff ffff ba 1b4 <(dsofn4@plt-0x1a|dsofn@plt-0x34)>
+ 200: b005 nop
+
+Disassembly of section \.text:
+#...
+0+202 <dsofn3>:
+ 202: bfbe e6ff ffff bsr 1e8 <dsofn@plt>
+ 208: b005 nop
+
+0+20a <dsofn4>:
+ 20a: 7f0d ae20 0000 lapc 22b8 <_GLOBAL_OFFSET_TABLE_>,\$r0
+ 210: 5f0d 1400 addo\.w 0x14,\$r0,\$acr
+ 214: bfbe baff ffff bsr 1ce <(dsofn4@plt|dsofn@plt-0x1a)>
+#pass
diff --git a/ld/testsuite/ld-cris/dso-pltdis2.d b/ld/testsuite/ld-cris/dso-pltdis2.d
new file mode 100644
index 0000000..5348a8a
--- /dev/null
+++ b/ld/testsuite/ld-cris/dso-pltdis2.d
@@ -0,0 +1,54 @@
+#source: dsov32-1.s
+#source: dsov32-2.s
+#source: dsofng.s
+#as: --pic --no-underscore --march=v32 --em=criself
+#ld: --shared -m crislinux
+#objdump: -d
+
+# Complement to dso-pltdis1.d; merging the other .got.plt entry.
+# Depending on reloc order, one of the tests would fail.
+
+.*: file format elf32-cris
+
+Disassembly of section \.plt:
+
+0+1b4 <(dsofn4@plt-0x1a|dsofn@plt-0x34)>:
+
+ 1b4: 84e2 subq 4,\$sp
+ 1b6: 0401 addoq 4,\$r0,\$acr
+ 1b8: 7e7a move \$mof,\[\$sp\]
+ 1ba: 3f7a move \[\$acr\],\$mof
+ 1bc: 04f2 addq 4,\$acr
+ 1be: 6ffa move\.d \[\$acr\],\$acr
+ 1c0: bf09 jump \$acr
+ 1c2: b005 nop
+ \.\.\.
+
+000001ce <dsofn4@plt>:
+ 1ce: 6f0d ..00 0000 addo\.d .*
+ 1d4: 6ffa move\.d \[\$acr\],\$acr
+ 1d6: bf09 jump \$acr
+ 1d8: b005 nop
+ 1da: 3f7e .... .... move .*,\$mof
+ 1e0: bf0e .... .... ba .*
+ 1e6: b005 nop
+#...
+ 1e8: 6f0d ..00 0000 addo\.d .*
+ 1ee: 6ffa move\.d \[\$acr\],\$acr
+ 1f0: bf09 jump \$acr
+ 1f2: b005 nop
+ 1f4: 3f7e .... .... move .*,\$mof
+ 1fa: bf0e .... .... ba .*
+ 200: b005 nop
+
+Disassembly of section \.text:
+#...
+0+202 <dsofn3>:
+ 202: bfbe e6ff ffff bsr 1e8 <(dsofn@plt|dsofn4@plt\+0x1a)>
+ 208: b005 nop
+
+0+20a <dsofn4>:
+ 20a: 7f0d ae20 0000 lapc 22b8 <_GLOBAL_OFFSET_TABLE_>,\$r0
+ 210: 5f0d ..00 addo\.w 0x..,\$r0,\$acr
+ 214: bfbe baff ffff bsr 1ce <dsofn4@plt>
+#pass
diff --git a/ld/testsuite/ld-cris/dsofn4g.s b/ld/testsuite/ld-cris/dsofn4g.s
new file mode 100644
index 0000000..8c13fe9
--- /dev/null
+++ b/ld/testsuite/ld-cris/dsofn4g.s
@@ -0,0 +1,3 @@
+ .text
+x:
+ move.d dsofn4:GOT,$r10
diff --git a/ld/testsuite/ld-cris/dsofng.s b/ld/testsuite/ld-cris/dsofng.s
new file mode 100644
index 0000000..afb1ed6
--- /dev/null
+++ b/ld/testsuite/ld-cris/dsofng.s
@@ -0,0 +1,4 @@
+ .text
+x:
+ move.d dsofn:GOT,$r10
+