From patchwork Mon Feb 13 16:20:03 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Frager, Neal via Binutils" X-Patchwork-Id: 5346 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp2435657wrn; Mon, 13 Feb 2023 08:20:33 -0800 (PST) X-Google-Smtp-Source: AK7set/ALwAk/KCGEP4+cnYyLVZE2pkUe1p/kabJ1hMFkWr0arUF/viDtjeJE4XXkCOU0fH44nvV X-Received: by 2002:a17:906:fa18:b0:878:54e3:e3e1 with SMTP id lo24-20020a170906fa1800b0087854e3e3e1mr25373444ejb.73.1676305233481; Mon, 13 Feb 2023 08:20:33 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1676305233; cv=none; d=google.com; s=arc-20160816; b=IhEOyNHCQqrYgVESl+XdzsI+yZUHrIq5sO++c6go3KET8oLjRh82GhPnxs3M7Rk8ou /ptNz4+BgTWevvIse3DqYAxjGKp9YYT/YyzmwmS3DbQtRpgBIWrnqu96xs6IVWPTj4O+ JypLz9/iOXlPPTjX8s+Zy22XDJOHFi3ZQDoFPA73cDAy469aSQAcOp8nMG6YufVvVT9q pUotm0C6K+vNLM4XrELxYfESciwwVsJPmdjNQ115dTLFy0v0+SE2s0WQ/CM7oNA/LoZ9 asoXX+hbk1Z0ze4JLaAqRS6pnD24I32D30e8dBHSeamGVhl+OX3jewrNEGtt8tMRKiZ7 w65Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:reply-to:from:list-subscribe:list-help:list-post :list-archive:list-unsubscribe:list-id:precedence:message-id:date :subject:cc:to:dmarc-filter:delivered-to:dkim-signature:dkim-filter; bh=JZk20JZ3R1owmzoACN8/qgbOLp2QLjsRDh7513Odb2M=; b=yyXLJNona2Jk87gS9Aa3sN3+yTfBY9exM76bNSfTGWitLP6cQ5uVktPchbwhPaL3XI Pw54Dqwo4nM2LyWTOAZtBK3wuorzuD+TssAFaqKu9MgTHBFZKYCiPoxuPGHOVPhCvMHj Fc14/4Mtw7eq4UfGzlVPPn+4J818wszXUW276ywnU2+wmE0VNfZwNXcShYq5htmWoOKy 3VdH/18bT6AUFS0WS6eaIC/LyGRUJTkce3pbLDWYx19vuqBxWgVy/tRPW3jXlIwecJhK TOEoElO4s2YBXWOdMDPnqQLaYlf9J9u07E24Tn8YuhubqfehRsoo7QKB5AzxntrxmxpW mP9Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sourceware.org header.s=default header.b=NeRx3qfU; spf=pass (google.com: domain of binutils-bounces+ouuuleilei=gmail.com@sourceware.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="binutils-bounces+ouuuleilei=gmail.com@sourceware.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=sourceware.org Received: from sourceware.org (server2.sourceware.org. [8.43.85.97]) by mx.google.com with ESMTPS id e17-20020a170906749100b0087760800a91si17730287ejl.424.2023.02.13.08.20.33 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 13 Feb 2023 08:20:33 -0800 (PST) Received-SPF: pass (google.com: domain of binutils-bounces+ouuuleilei=gmail.com@sourceware.org designates 8.43.85.97 as permitted sender) client-ip=8.43.85.97; Authentication-Results: mx.google.com; dkim=pass header.i=@sourceware.org header.s=default header.b=NeRx3qfU; spf=pass (google.com: domain of binutils-bounces+ouuuleilei=gmail.com@sourceware.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="binutils-bounces+ouuuleilei=gmail.com@sourceware.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 1ED5D3857838 for ; Mon, 13 Feb 2023 16:20:32 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 1ED5D3857838 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1676305232; bh=JZk20JZ3R1owmzoACN8/qgbOLp2QLjsRDh7513Odb2M=; h=To:Cc:Subject:Date:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:List-Subscribe:From:Reply-To:From; b=NeRx3qfUMuE3OiCKeBRBoRfvB9XlazkAoXIr8DKDf+vAbfBqOxsUrDvbl4mISvZVO lMDcTG5SDBbDkmfCBCk9nUcpI2KqRtYSbkWSLDYKFSxyA1obxvyWhSjpOL2SCf6tnr fvNpqfmX7smMKWrX6EVF5x0FnTDbO2Tu3GBbJZEs= X-Original-To: binutils@sourceware.org Delivered-To: binutils@sourceware.org Received: from emagii.se (www.emagii.com [185.133.207.17]) by sourceware.org (Postfix) with ESMTPS id 8FE0C3858D1E for ; Mon, 13 Feb 2023 16:20:14 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 8FE0C3858D1E Received: from valinor.ownit.se (84-55-68-216.customers.ownit.se [84.55.68.216]) by emagii.se (Postfix) with ESMTPSA id 287A812019C; Mon, 13 Feb 2023 17:20:13 +0100 (CET) Received-SPF: pass (emagii.beebytevps.io: connection is authenticated) To: binutils@sourceware.org Cc: nickc@redhat.com Subject: [PATCH v4 0/6] ASCIZ Command for output section Date: Mon, 13 Feb 2023 17:20:03 +0100 Message-Id: <20230213162009.15515-1-binutils@emagii.com> X-Mailer: git-send-email 2.17.1 X-PPP-Message-ID: <167630521342.3743393.6677766267427923563@localhost.localdomain> X-PPP-Vhost: emagii.com X-Spam-Status: No, score=-5.7 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, 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 X-BeenThere: binutils@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Binutils mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Ulf Samuelsson via Binutils From: "Frager, Neal via Binutils" Reply-To: binutils@emagii.com Errors-To: binutils-bounces+ouuuleilei=gmail.com@sourceware.org Sender: "Binutils" X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1757718499673979652?= X-GMAIL-MSGID: =?utf-8?q?1757733436842169597?= 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 v4 1/6] Document the ASCIZ command [PATCH v4 2/6] Add ASCIZ to NEWS [PATCH v4 3/6] Add ASCIZ to testsuite [PATCH v4 4/6] ldlex.l: Add ASCIZ token [PATCH v4 5/6] ldgram.y: Add 'ASCIZ ' command [PATCH v4 6/6] Parse ASCIZ command