aboutsummaryrefslogtreecommitdiff
path: root/ld/testsuite
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2021-10-28 09:03:00 +1030
committerAlan Modra <amodra@gmail.com>2021-10-28 10:51:03 +1030
commit1cba418d26929e0fa0f9c43b2323093b1c7fa9de (patch)
tree1bbdbfa1b7032e356b45f0e4fd9d634fd59a627b /ld/testsuite
parent9fc9dbc28b4bd2363fb645f0b0260be8ba43fadf (diff)
downloadgdb-1cba418d26929e0fa0f9c43b2323093b1c7fa9de.zip
gdb-1cba418d26929e0fa0f9c43b2323093b1c7fa9de.tar.gz
gdb-1cba418d26929e0fa0f9c43b2323093b1c7fa9de.tar.bz2
ASSERT in empty output section with address
* ldlang.c (lang_do_assignments_1): Correct "dot" inside ignored sections. * testsuite/ld-scripts/empty-address-4.d, * testsuite/ld-scripts/empty-address-4.s, * testsuite/ld-scripts/empty-address-4.t: New test. * testsuite/ld-scripts/empty-address.exp: Run it.
Diffstat (limited to 'ld/testsuite')
-rw-r--r--ld/testsuite/ld-scripts/empty-address-4.d6
-rw-r--r--ld/testsuite/ld-scripts/empty-address-4.s4
-rw-r--r--ld/testsuite/ld-scripts/empty-address-4.t11
-rw-r--r--ld/testsuite/ld-scripts/empty-address.exp1
4 files changed, 22 insertions, 0 deletions
diff --git a/ld/testsuite/ld-scripts/empty-address-4.d b/ld/testsuite/ld-scripts/empty-address-4.d
new file mode 100644
index 0000000..26b058b
--- /dev/null
+++ b/ld/testsuite/ld-scripts/empty-address-4.d
@@ -0,0 +1,6 @@
+#ld: -T empty-address-4.t
+#nm: -n
+
+#...
+0+0 [AT] _start
+#pass
diff --git a/ld/testsuite/ld-scripts/empty-address-4.s b/ld/testsuite/ld-scripts/empty-address-4.s
new file mode 100644
index 0000000..602a02f
--- /dev/null
+++ b/ld/testsuite/ld-scripts/empty-address-4.s
@@ -0,0 +1,4 @@
+ .text
+ .global _start
+_start:
+ .dc.a 0, 0
diff --git a/ld/testsuite/ld-scripts/empty-address-4.t b/ld/testsuite/ld-scripts/empty-address-4.t
new file mode 100644
index 0000000..f25bbfe
--- /dev/null
+++ b/ld/testsuite/ld-scripts/empty-address-4.t
@@ -0,0 +1,11 @@
+SECTIONS
+{
+ .text 0: { *(.text .pr) }
+ .data 0x200:
+ {
+ *(.data)
+ ASSERT (. < 0x400, oops);
+ }
+ .bss : { *(.bss) }
+ /DISCARD/ : { *(.*) }
+}
diff --git a/ld/testsuite/ld-scripts/empty-address.exp b/ld/testsuite/ld-scripts/empty-address.exp
index 1f62372..060c72d 100644
--- a/ld/testsuite/ld-scripts/empty-address.exp
+++ b/ld/testsuite/ld-scripts/empty-address.exp
@@ -32,5 +32,6 @@ run_dump_test empty-address-2b
run_dump_test empty-address-3a
run_dump_test empty-address-3b
run_dump_test empty-address-3c
+run_dump_test empty-address-4
set LDFLAGS $old_LDFLAGS