From: binutils@emagii.com
To: binutils@sourceware.org
Cc: nickc@redhat.com, Ulf Samuelsson <binutils@emagii.com>
Subject: [PATCH v4 3/6] Add ASCIZ to testsuite
Date: Mon, 13 Feb 2023 17:20:06 +0100 [thread overview]
Message-ID: <20230213162009.15515-4-binutils@emagii.com> (raw)
In-Reply-To: <20230213162009.15515-1-binutils@emagii.com>
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
next prev parent reply other threads:[~2023-02-13 16:20 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-02-13 16:20 [PATCH v4 0/6] ASCIZ Command for output section binutils
2023-02-13 16:20 ` [PATCH v4 1/6] Document the ASCIZ command binutils
2023-02-13 16:20 ` [PATCH v4 2/6] Add ASCIZ to NEWS binutils
2023-02-13 16:20 ` binutils [this message]
2023-02-13 16:20 ` [PATCH v4 4/6] ldlex.l: Add ASCIZ token binutils
2023-02-13 16:20 ` [PATCH v4 5/6] ldgram.y: Add 'ASCIZ <string>' command binutils
2023-02-13 16:24 ` [PATCH v4 0/6] ASCIZ Command for output section Ulf Samuelsson
2023-02-14 10:16 ` Nick Clifton
2023-02-14 16:07 ` Ulf Samuelsson
2023-02-14 16:20 ` Nick Clifton
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20230213162009.15515-4-binutils@emagii.com \
--to=binutils@emagii.com \
--cc=binutils@sourceware.org \
--cc=nickc@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).