From patchwork Mon Feb 13 16:11:18 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: 5345 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp2430927wrn; Mon, 13 Feb 2023 08:11:42 -0800 (PST) X-Google-Smtp-Source: AK7set8MZ/cBbdwnQd+P/UiBHW1JTaA0hd+ktPJgSZ4cZfD0wFD7Lck+PWT6CEMnJZrE0QBpAafn X-Received: by 2002:a17:906:254:b0:8aa:502c:44d4 with SMTP id 20-20020a170906025400b008aa502c44d4mr25031777ejl.2.1676304702365; Mon, 13 Feb 2023 08:11:42 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1676304702; cv=none; d=google.com; s=arc-20160816; b=niYv650neT9dYwVxEmX2cq8mtdt6AjP9BJXbF+pV2HCArqlG/+f6SD47SN9Adh7jyO yYlBwsn2f/QlvdrGUvgjc+DSdAVK5cXN7LnSBMvwYRykd/GZmibYqQ9KyKB0vMWWJ1T5 o34OuGJ4+rupLSs/zu2vzAM7j6d7Qe8CbrKMDLBmQ0msp1qVKfC6TFW5DbsZ5GtbQR0u 26B8XbEJc+pBNYPp5025pswhKWjRy8wGIpwcsLxK8ER89GTUBIWIPpnh7vfQp773VphH Gl5/YUNbUAlH1WM0x5E0A0LfIwPOjgntWAUQlWepDGzN9hnSnpRf+DYhONxNpEsRfEAx 2Ujg== 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=fWefIdUVGospqi2Kgc5Js6YJuExQKzSVWa8J24fgpVc=; b=lOlsPRgC2aDlFfjJpq+7kacnj+3QHLI3d7oZG9OgCktzUSKot8EyMMTpz/tsYmRlFl yIRQTdhRvKHS+Rm8w5UwY9z/PKJ3sx3yq8328cYmxd9HeSMF4uIGinMTgu/FpbKU3PFK fYFfcaem0r8J7j3ysb2eKkOKR1rppdU1Or4cNaCPx6EtcLMLRE9Y1JqzjbK8UyN4MxQL RJ6yuhFn7zPavdwNtdanBdV3lJVlguCXPQPoCu5T5z/FVmbEb1xAF7RqR4MIU/OrsAWz uHd35PPXrW7wzpDH1YQrZ9vm3/Th65SkLAl+XHcL2hT+aH04o5TkVRmcVgHxkb6FMVT4 A0uw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sourceware.org header.s=default header.b=qnQrvjgR; 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 s17-20020a170906221100b0088fa53e30a3si21389433ejs.1002.2023.02.13.08.11.42 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 13 Feb 2023 08:11:42 -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=qnQrvjgR; 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 E73CF3858004 for ; Mon, 13 Feb 2023 16:11:38 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org E73CF3858004 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1676304698; bh=fWefIdUVGospqi2Kgc5Js6YJuExQKzSVWa8J24fgpVc=; h=To:Cc:Subject:Date:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:List-Subscribe:From:Reply-To:From; b=qnQrvjgR08wkJaxgiIIAYlqxtbA6mD+ksNIAMnBq7v5oPjMrTfiFQCQbrvIy88TFo +Q+9kKaWSJ0nZjohYV8HfF3HQmHv8Akkn5ipZpKOC+rXxcZKW9Lpyijn8AkPg+I0Pn xuh4NM+HSpxSIp17DmUHXOoP316w4SFUShc+zIso= 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 92A2C385842C for ; Mon, 13 Feb 2023 16:11:29 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 92A2C385842C Received: from valinor.ownit.se (84-55-68-216.customers.ownit.se [84.55.68.216]) by emagii.se (Postfix) with ESMTPSA id 43C2A12019C; Mon, 13 Feb 2023 17:11:28 +0100 (CET) Received-SPF: pass (emagii.beebytevps.io: connection is authenticated) 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 Message-Id: <20230213161124.15340-1-binutils@emagii.com> X-Mailer: git-send-email 2.17.1 X-PPP-Message-ID: <167630468856.3742930.5579581620083702197@localhost.localdomain> X-PPP-Vhost: emagii.com X-Spam-Status: No, score=-5.2 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?1757732879209577307?= 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 ' command [PATCH v3 6/6] Parse ASCIZ command