public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
From: binutils@emagii.com
To: binutils@sourceware.org
Cc: nickc@redhat.com, Ulf Samuelsson <ulf@emagii.com>
Subject: [PATCH v3 1/6] Document the ASCIZ command
Date: Mon, 13 Feb 2023 17:11:19 +0100	[thread overview]
Message-ID: <20230213161124.15340-2-binutils@emagii.com> (raw)
In-Reply-To: <20230213161124.15340-1-binutils@emagii.com>

From: Ulf Samuelsson <ulf@emagii.com>

Signed-off-by: Ulf Samuelsson <ulf@emagii.com>
---
 ld/ld.texi | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/ld/ld.texi b/ld/ld.texi
index 36005dc2b0d..0a3d4adfaa0 100644
--- a/ld/ld.texi
+++ b/ld/ld.texi
@@ -5308,6 +5308,7 @@ C identifiers because they contain a @samp{.} character.
 @cindex data
 @cindex section data
 @cindex output section data
+@kindex ASCIZ @var{string}
 @kindex BYTE(@var{expression})
 @kindex SHORT(@var{expression})
 @kindex LONG(@var{expression})
@@ -5338,6 +5339,16 @@ target are 32 bits, an expression is computed as 32 bits.  In this case
 @code{QUAD} stores a 32 bit value zero extended to 64 bits, and
 @code{SQUAD} stores a 32 bit value sign extended to 64 bits.
 
+You can include a zero-terminated string in an output section by using
+@code{ASCIZ} as an output section command. The keyword is followed by a string
+which is stored at the current value of the location counter adding a zero byte
+at the end.
+
+For example, this string of 16 characters will create a 17 byte area
+@smallexample
+ASCIZ     "This is 16 bytes"
+@end smallexample
+
 If the object file format of the output file has an explicit endianness,
 which is the normal case, the value will be stored in that endianness.
 When the object file format does not have an explicit endianness, as is
-- 
2.17.1


  reply	other threads:[~2023-02-13 16:11 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-02-13 16:11 [PATCH v3 0/6] ASCIZ Command for output section binutils
2023-02-13 16:11 ` binutils [this message]
2023-02-13 16:11 ` [PATCH v3 2/6] Add ASCIZ to NEWS binutils
2023-02-13 16:11 ` [PATCH v3 3/6] Add ASCIZ to testsuite binutils
2023-02-13 16:11 ` [PATCH v3 4/6] ldlex.l: Add ASCIZ token binutils
2023-02-13 16:11 ` [PATCH v3 5/6] ldgram.y: Add 'ASCIZ <string>' command binutils
2023-02-13 16:11 ` [PATCH v3 6/6] Parse ASCIZ command binutils

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=20230213161124.15340-2-binutils@emagii.com \
    --to=binutils@emagii.com \
    --cc=binutils@sourceware.org \
    --cc=nickc@redhat.com \
    --cc=ulf@emagii.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).