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 73251385482E for ; Fri, 10 Feb 2023 17:44:17 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 73251385482E 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 211601207EF; Fri, 10 Feb 2023 18:44:16 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=emagii.com; s=default; t=1676051056; bh=2I/6ihecE1Xxxg3iISTNLesibFfWulnA5LCUinMGGzI=; h=From:To:Subject; b=kxgp4ALff3N+mi+5jFJ6NkPcmcg1t6aIjGz2/PDDs/eEIFLgKLrSJnWLXkoPKJtAI SPSUI0DjuL1XShPYW9PunuWzrVZ9TZPSWVFcnllMQz3IBCKv6rd7s31iU/h/jUHpko frSQRsD8z5FhgfDn/QESZ3OP9ImqdnuerSfdPQM0= 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: Ulf Samuelsson Subject: [PATCH 4/4] Document the ASCIZ command Date: Fri, 10 Feb 2023 18:44:04 +0100 Message-Id: <20230210174404.3763-5-binutils@emagii.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20230210174404.3763-1-binutils@emagii.com> References: <20230210174404.3763-1-binutils@emagii.com> X-PPP-Message-ID: <167605105641.3627019.506413855262224795@localhost.localdomain> X-PPP-Vhost: emagii.com X-Spam-Status: No, score=-12.0 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