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 A5CCF3850401 for ; Fri, 10 Feb 2023 17:55:26 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org A5CCF3850401 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 [10.175.196.145] (84-55-68-216.customers.ownit.se [84.55.68.216]) by emagii.se (Postfix) with ESMTPSA id 731A01207DE for ; Fri, 10 Feb 2023 18:55:25 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=emagii.com; s=default; t=1676051725; bh=KTidV3rRryvGeG51X7HepATGuLiBXybp5SY/pyOu3K4=; h=Subject:To:From; b=kMRfW2WeNhd0fhgVZDOuYyOFh/fhFBdQf0p4TA6kTWb0/cG8MlyoDTnF3yaoF+9VS 6mFLCyFYdfFMzdjXfyJvcMXYqBISAhpnSsIRrgo30csbTBWdv3xdgybNN9+b7DIajK 00xt07sAawlJysSZLIPeY/t+BQvDRDKCwz5ASvcY= Authentication-Results: emagii.beebytevps.io; spf=pass (sender IP is 84.55.68.216) smtp.mailfrom=binutils@emagii.com smtp.helo=[10.175.196.145] Received-SPF: pass (emagii.beebytevps.io: connection is authenticated) Message-ID: Date: Fri, 10 Feb 2023 18:55:25 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.7.1 Subject: Re: Content-Language: sv-FI To: binutils@sourceware.org References: <20230210174404.3763-1-binutils@emagii.com> From: Ulf Samuelsson In-Reply-To: <20230210174404.3763-1-binutils@emagii.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-PPP-Message-ID: <167605172568.3627302.15954593859167624238@localhost.localdomain> X-PPP-Vhost: emagii.com X-Spam-Status: No, score=-6.0 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,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: Don't know why I did not get a subject line in my "git send-email". Sorry about that. A comment on the implementation. The string is implemented internally as a number of "BYTE " statements. This seemed to be the simplest way of doing it. Most use of this feature will typically only have a couple of such statements and since this is my first addition to the code, I do not have a good overview of the internals. Best Regards, Ulf Samuelsson Den 2023-02-10 kl. 18:44, skrev Ulf Samuelsson via Binutils: > From binutils@emagii.com # This line is ignored. > From: binutils@emagii.com > Reply-To: > Subject: ASCIZ Command for output section > In-Reply-To: > > 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. > > 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. > > Best Regards > Ulf Samuelsson > > [PATCH 1/4] ldlex.l: Add ASCIZ token > [PATCH 2/4] ldgram.y: Add 'ASCIZ ' command > [PATCH 3/4] Parse ASCIZ command > [PATCH 4/4] Document the ASCIZ command >