public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
From: binutils@emagii.com
To: binutils@sourceware.org
Cc: nickc@redhat.com
Subject: [PATCH v3 0/6] ASCIZ Command for output section
Date: Mon, 13 Feb 2023 17:11:18 +0100	[thread overview]
Message-ID: <20230213161124.15340-1-binutils@emagii.com> (raw)

Introduce an ASCIZ command for an output section
When generating a header for an embedded system
there is often a need to add text information.

There are arguments for generating the header in the linker
instead of compiling the header as part of the program.
The lack of support for strings makes this process a bit unwieldy.

The ASCIZ command allows you to specify a zero-terminated string as a parameter.

Example:

    ASCIZ "This is a string"

The string contains 16 characters, but a NUL character is added to the end,
so the areas reserved is 16+1 = 17 characters.

The string may contain '\n', '\r', '\t' and octals, but not hex characters.

Ideally, there should be a command which reserves a fixed size area.

I:E:

    ASCII 20, "This is a string"

but I have failed to get make this work in 'ld',
so this patch series is limited to ASCIZ.

[PATCH v3 1/6] Document the ASCIZ command
[PATCH v3 2/6] Add ASCIZ to NEWS
[PATCH v3 3/6] Add ASCIZ to testsuite
[PATCH v3 4/6] ldlex.l: Add ASCIZ token
[PATCH v3 5/6] ldgram.y: Add 'ASCIZ <string>' command
[PATCH v3 6/6] Parse ASCIZ command


             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 binutils [this message]
2023-02-13 16:11 ` [PATCH v3 1/6] Document the ASCIZ command binutils
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-1-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).