From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from emagii.se (www.emagii.com [185.133.207.17]) by sourceware.org (Postfix) with ESMTPS id 06AFA3858436 for ; Mon, 13 Feb 2023 16:11:30 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 06AFA3858436 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=emagii.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=emagii.com Received: from valinor.ownit.se (84-55-68-216.customers.ownit.se [84.55.68.216]) by emagii.se (Postfix) with ESMTPSA id AE29F120205; Mon, 13 Feb 2023 17:11:28 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=emagii.com; s=default; t=1676304689; bh=2I/6ihecE1Xxxg3iISTNLesibFfWulnA5LCUinMGGzI=; h=From:To:Subject; b=4WPPu+fN/xwb/GRg0HLa+7xScbOLI6uF0LuNYoBYr5IO9BLRfvSH+c4DUqJhjrb+n DK7j4tZIpgeH5j9XGtLdY9nSDiLAjr8MbrEHevAX5M9kdXBZnXEp8OFRDbek/AGfKN cZfPQJbMdZY5oS7TeA9OqtEIPaMj7y+copJNb/Eg= Authentication-Results: emagii.beebytevps.io; spf=pass (sender IP is 84.55.68.216) smtp.mailfrom=binutils@emagii.com smtp.helo=valinor.ownit.se Received-SPF: pass (emagii.beebytevps.io: connection is authenticated) From: binutils@emagii.com To: binutils@sourceware.org Cc: nickc@redhat.com, Ulf Samuelsson Subject: [PATCH v3 1/6] Document the ASCIZ command Date: Mon, 13 Feb 2023 17:11:19 +0100 Message-Id: <20230213161124.15340-2-binutils@emagii.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20230213161124.15340-1-binutils@emagii.com> References: <20230213161124.15340-1-binutils@emagii.com> X-PPP-Message-ID: <167630468895.3742939.6437333571628308616@localhost.localdomain> X-PPP-Vhost: emagii.com X-Spam-Status: No, score=-11.3 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,GIT_PATCH_0,SPF_HELO_FAIL,SPF_PASS,TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: From: Ulf Samuelsson Signed-off-by: Ulf Samuelsson --- 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