[PATCH v3 3/6] Add ASCIZ to testsuite
binutils@emagii.com
binutils@emagii.com
Mon Feb 13 16:11:21 GMT 2023
From: Ulf Samuelsson <binutils@emagii.com>
Signed-off-by: Ulf Samuelsson <binutils@emagii.com>
---
ld/testsuite/ld-scripts/asciz.d | 14 ++++++++++++++
ld/testsuite/ld-scripts/asciz.s | 6 ++++++
ld/testsuite/ld-scripts/asciz.t | 23 +++++++++++++++++++++++
3 files changed, 43 insertions(+)
create mode 100644 ld/testsuite/ld-scripts/asciz.d
create mode 100644 ld/testsuite/ld-scripts/asciz.s
create mode 100644 ld/testsuite/ld-scripts/asciz.t
diff --git a/ld/testsuite/ld-scripts/asciz.d b/ld/testsuite/ld-scripts/asciz.d
new file mode 100644
index 00000000000..83cb61d6fb6
--- /dev/null
+++ b/ld/testsuite/ld-scripts/asciz.d
@@ -0,0 +1,14 @@
+#source: asciz.s
+#ld: -T asciz.t
+#objdump: -s -j .text
+#notarget: [is_aout_format]
+#xfail: tic4x-*-* tic54x-*-*
+
+.*: file format .*
+
+Contents of section .text:
+ 10c0 434f4445 54686973 20697320 61207374 CODEThis is a st
+ 10d0 72696e67 00000000 00000000 00000000 ring............
+ 10e0 54686973 20697320 616e6f74 68657220 This is another
+ 10f0 73747269 6e6700 string.
+#pass
diff --git a/ld/testsuite/ld-scripts/asciz.s b/ld/testsuite/ld-scripts/asciz.s
new file mode 100644
index 00000000000..542dcd1a410
--- /dev/null
+++ b/ld/testsuite/ld-scripts/asciz.s
@@ -0,0 +1,6 @@
+ .section .text
+ .long 0x45444F43
+ .section .data
+ .long 0x9abcdef0
+ .section .bss
+ .long 0
diff --git a/ld/testsuite/ld-scripts/asciz.t b/ld/testsuite/ld-scripts/asciz.t
new file mode 100644
index 00000000000..986e00a1169
--- /dev/null
+++ b/ld/testsuite/ld-scripts/asciz.t
@@ -0,0 +1,23 @@
+MEMORY {
+ rom : ORIGIN = 0x00000, LENGTH = 0x10000
+ ram : ORIGIN = 0x10000, LENGTH = 0x10000
+}
+
+_start = 0x000000;
+SECTIONS
+{
+ . = 0x1000 + SIZEOF_HEADERS;
+ .text ALIGN (0x20) :
+ {
+ *(.text)
+ ASCIZ "This is a string"
+ . = ALIGN(0x20);
+ align_label = .;
+ ASCIZ "This is another string"
+ unalign_label = .;
+ }
+ .data : AT (0x10000) { *(.data) } >ram /* NO default AT>rom */
+ . = ALIGN(0x20);
+ .bss : { *(.bss) } >ram /* NO default AT>rom */
+ /DISCARD/ : { *(*) }
+}
--
2.17.1
More information about the Binutils
mailing list