aboutsummaryrefslogtreecommitdiff
path: root/ld
diff options
context:
space:
mode:
authorRichard Sandiford <rdsandiford@googlemail.com>2002-07-09 08:47:24 +0000
committerRichard Sandiford <rdsandiford@googlemail.com>2002-07-09 08:47:24 +0000
commitad42262f8f1b8cc9d8af7a593faa7fde13ebb529 (patch)
tree75ae8f7d4cd91104a00933ddc16e378206026fcf /ld
parent0d2ddeb220080e9a157a45ee2e6ac6c19fc1fce6 (diff)
downloadgdb-ad42262f8f1b8cc9d8af7a593faa7fde13ebb529.zip
gdb-ad42262f8f1b8cc9d8af7a593faa7fde13ebb529.tar.gz
gdb-ad42262f8f1b8cc9d8af7a593faa7fde13ebb529.tar.bz2
* ld-scripts/dynamic-sections*: New test.
Diffstat (limited to 'ld')
-rw-r--r--ld/testsuite/ChangeLog4
-rw-r--r--ld/testsuite/ld-scripts/dynamic-sections-1.s2
-rw-r--r--ld/testsuite/ld-scripts/dynamic-sections-2.s3
-rw-r--r--ld/testsuite/ld-scripts/dynamic-sections.d6
-rw-r--r--ld/testsuite/ld-scripts/dynamic-sections.exp8
-rw-r--r--ld/testsuite/ld-scripts/dynamic-sections.t11
6 files changed, 34 insertions, 0 deletions
diff --git a/ld/testsuite/ChangeLog b/ld/testsuite/ChangeLog
index 15dc6f4..1151b3f 100644
--- a/ld/testsuite/ChangeLog
+++ b/ld/testsuite/ChangeLog
@@ -1,3 +1,7 @@
+2002-07-09 Richard Sandiford <rsandifo@redhat.com>
+
+ * ld-scripts/dynamic-sections*: New test.
+
2002-07-09 Hans-Peter Nilsson <hp@axis.com>
* ld-cris/libdso-3.d, ld-cris/dso-3.s, ld-cris/noglob1.s,
diff --git a/ld/testsuite/ld-scripts/dynamic-sections-1.s b/ld/testsuite/ld-scripts/dynamic-sections-1.s
new file mode 100644
index 0000000..9a72c96
--- /dev/null
+++ b/ld/testsuite/ld-scripts/dynamic-sections-1.s
@@ -0,0 +1,2 @@
+ .data
+ .4byte foo
diff --git a/ld/testsuite/ld-scripts/dynamic-sections-2.s b/ld/testsuite/ld-scripts/dynamic-sections-2.s
new file mode 100644
index 0000000..57cb02d
--- /dev/null
+++ b/ld/testsuite/ld-scripts/dynamic-sections-2.s
@@ -0,0 +1,3 @@
+ .data
+ .global foo
+foo: .4byte 0
diff --git a/ld/testsuite/ld-scripts/dynamic-sections.d b/ld/testsuite/ld-scripts/dynamic-sections.d
new file mode 100644
index 0000000..279107d
--- /dev/null
+++ b/ld/testsuite/ld-scripts/dynamic-sections.d
@@ -0,0 +1,6 @@
+# nm: -C
+# ld: -T dynamic-sections.t
+# name: dynamic sections
+# source: dynamic-sections-1.s
+# source: dynamic-sections-2.s
+#pass
diff --git a/ld/testsuite/ld-scripts/dynamic-sections.exp b/ld/testsuite/ld-scripts/dynamic-sections.exp
new file mode 100644
index 0000000..9aee0cd
--- /dev/null
+++ b/ld/testsuite/ld-scripts/dynamic-sections.exp
@@ -0,0 +1,8 @@
+# Check for bug introduced on 2002-06-10. See dynamic-sections.t for
+# more details
+
+if ![is_elf_format] {
+ return
+}
+
+run_dump_test dynamic-sections
diff --git a/ld/testsuite/ld-scripts/dynamic-sections.t b/ld/testsuite/ld-scripts/dynamic-sections.t
new file mode 100644
index 0000000..f1f24c8
--- /dev/null
+++ b/ld/testsuite/ld-scripts/dynamic-sections.t
@@ -0,0 +1,11 @@
+SECTIONS
+{
+ .data : { *(.data) }
+ .rodata : { *(.rodata) }
+
+ /* The .rel* sections are typically placed here, because of the way
+ elf32.em handles orphaned sections. A bug introduced on 2002-06-10
+ would cause . to be 0 at this point. */
+
+ _bar = ASSERT (. > 0, "Bad . value");
+}