From patchwork Mon Feb 13 16:11:19 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ulf Samuelsson X-Patchwork-Id: 56363 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp2430957wrn; Mon, 13 Feb 2023 08:11:45 -0800 (PST) X-Google-Smtp-Source: AK7set9q3CwgLwATAgMR8IGWeRCLMcSGCbC6SGAktk42KxqEArA+mHmOPcpvUJxVgLmz9yrDQ5Fh X-Received: by 2002:a17:906:488e:b0:88f:9f5e:f40 with SMTP id v14-20020a170906488e00b0088f9f5e0f40mr21815585ejq.68.1676304704916; Mon, 13 Feb 2023 08:11:44 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1676304704; cv=none; d=google.com; s=arc-20160816; b=fcK22iI02Vnuh3QlXdZl7fJxTQQW6g9SEFH9G3e00of5IShhs8nGMK50u+LBESU2Dl YqtVecI7kl1V43bQBtnBYNkZVFQvU5BFb22uuXmFzKWmXXBRWcl1Dwq/uVSknoZMCy5z JjjfgCD2m+sAGWrzjgnKEp9jrMVFvETxCbau29ETnHYe5gPhxU+ukZbGIDwo8c3XAVHU SH/D/1hIaIivJEgvSxZXvgmWxpZcGwaSVNShne/HPbqxWfvPISlDbcUCMqyvtRAmps3K EPYs4UvYBd56dH7hhUNpQW0v7V1wavNfyyFqY84tx5LNyPjYc7HREAcDz6b+0f/0zUIX V18g== 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:references :in-reply-to:message-id:date:subject:cc:to:dmarc-filter:delivered-to :dkim-signature:dkim-filter; bh=2I/6ihecE1Xxxg3iISTNLesibFfWulnA5LCUinMGGzI=; b=nd4sU14LKYNM9tEg3izeJIpd1vhAyaC/ZmCgIeAUqxuLTkApPaOPVaWrDtXSrPP1Vi bVgUqGIijZF1IuaGp31JaJhrEt4+PhhPpGAcRYeZzS9uDQIn78NBJpFaYIRu4AEWKBl+ Lzig8eDsOxf15U6O7r9ZQKVo/ndZqWrKqK66AMFh3PC9Ht8HT8YY/SPDwvGoBsLHVPA2 GeCXMOVkADikXsnn12PpiIrOgujPXTijpxOY1eugi0GNrdQUQVqBeOB6fVlqaqj6vngc Lyr1LEI1DBokri4REExOqasfYjnz4f1bEexnzmRMr62/kxGu/n57n3Y7Wc2zWn1+Ji4Y V+uQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sourceware.org header.s=default header.b=VRBsw7y4; spf=pass (google.com: domain of binutils-bounces+ouuuleilei=gmail.com@sourceware.org designates 2620:52:3:1:0:246e:9693:128c 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. [2620:52:3:1:0:246e:9693:128c]) by mx.google.com with ESMTPS id az24-20020a170907905800b008785fab5c6bsi11735448ejc.1007.2023.02.13.08.11.44 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 13 Feb 2023 08:11:44 -0800 (PST) Received-SPF: pass (google.com: domain of binutils-bounces+ouuuleilei=gmail.com@sourceware.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) client-ip=2620:52:3:1:0:246e:9693:128c; Authentication-Results: mx.google.com; dkim=pass header.i=@sourceware.org header.s=default header.b=VRBsw7y4; spf=pass (google.com: domain of binutils-bounces+ouuuleilei=gmail.com@sourceware.org designates 2620:52:3:1:0:246e:9693:128c 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 8BFC4385842B for ; Mon, 13 Feb 2023 16:11:41 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 8BFC4385842B DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1676304701; bh=2I/6ihecE1Xxxg3iISTNLesibFfWulnA5LCUinMGGzI=; h=To:Cc:Subject:Date:In-Reply-To:References:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From:Reply-To:From; b=VRBsw7y4DSyY5RoxkDfl5lmc5Aaw1bqRBdT+Q2y9h03NS2SXzdwM1pZSC9P9Fkseb 17IdsO7sNvsFy0oSHY/dI4kgorb1MbT8GTCN9w5LHJb8WDKeXgef60UfNjTryWYMXi vrB2ejjmP9uF3D8EqrSwTDhqv5G9vp6hBsMrxqlE= 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 06AFA3858436 for ; Mon, 13 Feb 2023 16:11:30 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 06AFA3858436 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) Received-SPF: pass (emagii.beebytevps.io: connection is authenticated) 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 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: Ulf Samuelsson 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?1757732882241216377?= X-GMAIL-MSGID: =?utf-8?q?1757732882241216377?= 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 From patchwork Mon Feb 13 16:11:20 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ulf Samuelsson X-Patchwork-Id: 56366 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp2432202wrn; Mon, 13 Feb 2023 08:14:04 -0800 (PST) X-Google-Smtp-Source: AK7set+3fd9RvxsKtfldgmykPrRrOnC50NEE2qDE/ZHoeao3mS5bB0xSsA17fCAjLdk6qjH0rU6y X-Received: by 2002:a17:906:9f0c:b0:8af:7b80:82ba with SMTP id fy12-20020a1709069f0c00b008af7b8082bamr9808254ejc.20.1676304843863; Mon, 13 Feb 2023 08:14:03 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1676304843; cv=none; d=google.com; s=arc-20160816; b=nbivUEsgyqbsZ2oHkt8seGt3jMJuv9z2D6Hxy/2rxQXKQ5L1aobQD+Lp9GCWO64BIc wbXX1whffbItwpyvPzfdxy5po2CUvHUGtp0JGymKGQA6qdlOCfBhD8PpVFZFodqagu5X mu5tj6QVnROHenze2gOW7CyZJ08N8bEDXlpmnCEsf2KWTKs9JAp75zC/w4g7GLGv5QJy 4khQrl9ZrUXerM/M8c6W7xEaii7pQoHVNpKuJDXXXDBUu0nr5MbtqWnfozgzSFyKzDJd vAS8C6kPxHEDgn9jvHeOP9szsIw4BTvLxlbYIGycfGCiHE4A3LSQ6SUnDAKsXwuj4DXP Gxbg== 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:references :in-reply-to:message-id:date:subject:cc:to:dmarc-filter:delivered-to :dkim-signature:dkim-filter; bh=3kz7/DyFTbjv5ccMCfs1c/cIOS2boqEQO2nXXIbGYu4=; b=AOwOU2rQh+KzR8ZxS+aIQIEP2CGcyD28WlSaxsEDoCqVL+kJQjFXhnC9ARiQgxE3ZB v0279tLMJ5bBZ0zXoSM8H1ArqwuPxJJcxaL9cScjyhk9bfgbJz7LEQMeNV4oveqUzLgn 4OkmH78srwDy9hqEjoqGkzk5aYzfeOznAW8GNuBVzVfaKYeRubrT5BkPcwfhPIS7rO4b TyrjUNOUIW5vgDJJRzRtC+3meBdzPLtP8ILr4hHAQE4UizqeebAshKYrovYJGyTQNZq8 Ja7lD1nhKkszbtKcAaEmRkPM4EyM2toBssMk2vGYA1PweI4WQSWrCCiBCmefjzaFxd/y PO3g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sourceware.org header.s=default header.b=AbjsunO5; spf=pass (google.com: domain of binutils-bounces+ouuuleilei=gmail.com@sourceware.org designates 2620:52:3:1:0:246e:9693:128c 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. [2620:52:3:1:0:246e:9693:128c]) by mx.google.com with ESMTPS id mt30-20020a170907619e00b00886fe604954si13265506ejc.448.2023.02.13.08.14.03 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 13 Feb 2023 08:14:03 -0800 (PST) Received-SPF: pass (google.com: domain of binutils-bounces+ouuuleilei=gmail.com@sourceware.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) client-ip=2620:52:3:1:0:246e:9693:128c; Authentication-Results: mx.google.com; dkim=pass header.i=@sourceware.org header.s=default header.b=AbjsunO5; spf=pass (google.com: domain of binutils-bounces+ouuuleilei=gmail.com@sourceware.org designates 2620:52:3:1:0:246e:9693:128c 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 A22AC385B511 for ; Mon, 13 Feb 2023 16:12:41 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org A22AC385B511 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1676304761; bh=3kz7/DyFTbjv5ccMCfs1c/cIOS2boqEQO2nXXIbGYu4=; h=To:Cc:Subject:Date:In-Reply-To:References:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From:Reply-To:From; b=AbjsunO5V7kbFyJ5xJ48VnATDIjz+0q+U+EBt+Hyp9LSWTPcbKbQ3RW8waycGac/R UENjrhsraCFC+hWVA2lpBiYxbVAJZHtrTVdMImc/tFeq1NO0pRCyGNat/PeLMF28F0 TsvuCn6UGGfNhKLv+8RKXYqFc41PKvTP3b65NrZ0= 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 63A943858426 for ; Mon, 13 Feb 2023 16:11:30 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 63A943858426 Received: from valinor.ownit.se (84-55-68-216.customers.ownit.se [84.55.68.216]) by emagii.se (Postfix) with ESMTPSA id 1A09A120245; Mon, 13 Feb 2023 17:11:29 +0100 (CET) Received-SPF: pass (emagii.beebytevps.io: connection is authenticated) To: binutils@sourceware.org Cc: nickc@redhat.com, Ulf Samuelsson Subject: [PATCH v3 2/6] Add ASCIZ to NEWS Date: Mon, 13 Feb 2023 17:11:20 +0100 Message-Id: <20230213161124.15340-3-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: <167630468937.3742955.3928066012174264281@localhost.localdomain> X-PPP-Vhost: emagii.com X-Spam-Status: No, score=-11.5 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 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: Ulf Samuelsson 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?1757733028182137793?= X-GMAIL-MSGID: =?utf-8?q?1757733028182137793?= From: Ulf Samuelsson Signed-off-by: Ulf Samuelsson --- ld/NEWS | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/ld/NEWS b/ld/NEWS index 9982ad0168d..f5a1f1a1304 100644 --- a/ld/NEWS +++ b/ld/NEWS @@ -1,5 +1,11 @@ -*- text -*- +* The linker has a new command for output sections. + ASCIZ "string" + This will insert the string at the current location adding a zero at the end. + The string may contain '\n', '\r', '\t' and octal numbers. + Hex numbers are not supported + Changes in 2.40: * The linker has a new command line option to suppress the generation of any From patchwork Mon Feb 13 16:11:21 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ulf Samuelsson X-Patchwork-Id: 56365 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp2431285wrn; Mon, 13 Feb 2023 08:12:17 -0800 (PST) X-Google-Smtp-Source: AK7set/WFaX5Nt/kuovRrAXNlPspLwNbWfoACPLx4VN257ZMPoxhV3QBkOeVWoPGJ5aOco0TCOg3 X-Received: by 2002:a17:906:ce28:b0:878:7349:5ce6 with SMTP id sd8-20020a170906ce2800b0087873495ce6mr25908921ejb.71.1676304737796; Mon, 13 Feb 2023 08:12:17 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1676304737; cv=none; d=google.com; s=arc-20160816; b=ebw989k+97mQKCBzFSkUGP5FU6bjB0Zr7SsMpVKS2sYyBL7jKdJTKyuJ7dNLafU/IV kwdAEVpgcKu7L79J3q8ghnT+g8hi+Ckvw0RCt8Loi/CFEgdcr3/OKySvzf4DPM+T7wRj gkXk1lAEHB41eCYCYfSVYk39InCKrCgUFnrdSUt/KEpkqMbpGrER5rtLvqsddSeJ5N4X WKu5STV+1/GmKM/BEcHFz6EwN6uemy1zE2xQSgLm6g5KtPhSHTsj03NDE/5fLFfqA2uy TqMBQt6GSy76FvdwK8Pl65nMIEYbqhlXXS/ScYdhJ4rE1OFy24dlyX1O6YVLw8GRhRzA r3cA== 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:references :in-reply-to:message-id:date:subject:cc:to:dmarc-filter:delivered-to :dkim-signature:dkim-filter; bh=49WzoF4XxymYr2xoAUzgZwMsDWxo76TABs88QDuu1NM=; b=Vb/LcL9WS31moYHwU25iB0hPfsMIMdHvFtcykb72okHWtBaenEZDWgenG3NlR5w5J7 y4RsIvBVCwFZ3bCLB3d7GacYvoLuvNj1ytK9qkNJdpxWBR3hlors0OZKdOXmCKVmOuKE 7a+xeRzLhRHGhFIY5wfVOyQagAUxpSpsk/CA5Qe+b+6nWrnR+k8zKj8nfyfeAb6gSqxY Mvi7Vtm6XW+koaw0LuVT2O9LRUGOM2wZcAR4rGPndIwzRie1OOTD/rmSxQZoCPl/s+jg NbHo/YpcdTSD9LE7SVX0mmyUfP7p/t+DImsfxV8T2KDvsaByGMSWXwjFkhdosoIZQPvs a/Zg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sourceware.org header.s=default header.b=S1YDTRJ4; spf=pass (google.com: domain of binutils-bounces+ouuuleilei=gmail.com@sourceware.org designates 2620:52:3:1:0:246e:9693:128c 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. [2620:52:3:1:0:246e:9693:128c]) by mx.google.com with ESMTPS id gj20-20020a170907741400b0089c317142eesi12485814ejc.944.2023.02.13.08.12.17 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 13 Feb 2023 08:12:17 -0800 (PST) Received-SPF: pass (google.com: domain of binutils-bounces+ouuuleilei=gmail.com@sourceware.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) client-ip=2620:52:3:1:0:246e:9693:128c; Authentication-Results: mx.google.com; dkim=pass header.i=@sourceware.org header.s=default header.b=S1YDTRJ4; spf=pass (google.com: domain of binutils-bounces+ouuuleilei=gmail.com@sourceware.org designates 2620:52:3:1:0:246e:9693:128c 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 A028C383FB9C for ; Mon, 13 Feb 2023 16:11:56 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org A028C383FB9C DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1676304716; bh=49WzoF4XxymYr2xoAUzgZwMsDWxo76TABs88QDuu1NM=; h=To:Cc:Subject:Date:In-Reply-To:References:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From:Reply-To:From; b=S1YDTRJ4nJDEsCowqNWvReYe7kwJQ0IAk6MmBXK/IN+u2peXn4pJTilLxbgnQ+Oj+ wUW4LN4p2j+IQkt0AARVytZOriV/bFVUVLJdyPngYBiaH4uYJ2mu/Dy6rgnMDRYl7p 0WZZkooKqQwZ1iKtJ0w4zY/ssZJy8h7Nr4fn/ViQ= 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 D45623858434 for ; Mon, 13 Feb 2023 16:11:30 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org D45623858434 Received: from valinor.ownit.se (84-55-68-216.customers.ownit.se [84.55.68.216]) by emagii.se (Postfix) with ESMTPSA id 742A7120258; Mon, 13 Feb 2023 17:11:29 +0100 (CET) Received-SPF: pass (emagii.beebytevps.io: connection is authenticated) To: binutils@sourceware.org Cc: nickc@redhat.com, Ulf Samuelsson Subject: [PATCH v3 3/6] Add ASCIZ to testsuite Date: Mon, 13 Feb 2023 17:11:21 +0100 Message-Id: <20230213161124.15340-4-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: <167630468976.3742971.12491576171392333115@localhost.localdomain> X-PPP-Vhost: emagii.com X-Spam-Status: No, score=-11.6 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 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: Ulf Samuelsson 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?1757732916494677395?= X-GMAIL-MSGID: =?utf-8?q?1757732916494677395?= From: Ulf Samuelsson Signed-off-by: Ulf Samuelsson --- ld/testsuite/ld-scripts/asciz.d | 14 ++++++++++++++ ld/testsuite/ld-scripts/asciz.s | 6 ++++++ ld/testsuite/ld-scripts/asciz.t | 23 +++++++++++++++++++++++ 3 files changed, 43 insertions(+) create mode 100644 ld/testsuite/ld-scripts/asciz.d create mode 100644 ld/testsuite/ld-scripts/asciz.s create mode 100644 ld/testsuite/ld-scripts/asciz.t diff --git a/ld/testsuite/ld-scripts/asciz.d b/ld/testsuite/ld-scripts/asciz.d new file mode 100644 index 00000000000..83cb61d6fb6 --- /dev/null +++ b/ld/testsuite/ld-scripts/asciz.d @@ -0,0 +1,14 @@ +#source: asciz.s +#ld: -T asciz.t +#objdump: -s -j .text +#notarget: [is_aout_format] +#xfail: tic4x-*-* tic54x-*-* + +.*: file format .* + +Contents of section .text: + 10c0 434f4445 54686973 20697320 61207374 CODEThis is a st + 10d0 72696e67 00000000 00000000 00000000 ring............ + 10e0 54686973 20697320 616e6f74 68657220 This is another + 10f0 73747269 6e6700 string. +#pass diff --git a/ld/testsuite/ld-scripts/asciz.s b/ld/testsuite/ld-scripts/asciz.s new file mode 100644 index 00000000000..542dcd1a410 --- /dev/null +++ b/ld/testsuite/ld-scripts/asciz.s @@ -0,0 +1,6 @@ + .section .text + .long 0x45444F43 + .section .data + .long 0x9abcdef0 + .section .bss + .long 0 diff --git a/ld/testsuite/ld-scripts/asciz.t b/ld/testsuite/ld-scripts/asciz.t new file mode 100644 index 00000000000..986e00a1169 --- /dev/null +++ b/ld/testsuite/ld-scripts/asciz.t @@ -0,0 +1,23 @@ +MEMORY { + rom : ORIGIN = 0x00000, LENGTH = 0x10000 + ram : ORIGIN = 0x10000, LENGTH = 0x10000 +} + +_start = 0x000000; +SECTIONS +{ + . = 0x1000 + SIZEOF_HEADERS; + .text ALIGN (0x20) : + { + *(.text) + ASCIZ "This is a string" + . = ALIGN(0x20); + align_label = .; + ASCIZ "This is another string" + unalign_label = .; + } + .data : AT (0x10000) { *(.data) } >ram /* NO default AT>rom */ + . = ALIGN(0x20); + .bss : { *(.bss) } >ram /* NO default AT>rom */ + /DISCARD/ : { *(*) } +} From patchwork Mon Feb 13 16:11:22 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ulf Samuelsson X-Patchwork-Id: 56364 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp2431089wrn; Mon, 13 Feb 2023 08:11:57 -0800 (PST) X-Google-Smtp-Source: AK7set+GXoGabzLeoi0wPRt+MUz8yluEZRucypdFmMdGfTZw0ZST9zbKR48eD71bjOqyC5vs9AF2 X-Received: by 2002:a50:c014:0:b0:4ac:ca74:b65d with SMTP id r20-20020a50c014000000b004acca74b65dmr1627128edb.28.1676304716892; Mon, 13 Feb 2023 08:11:56 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1676304716; cv=none; d=google.com; s=arc-20160816; b=LDlbWgttcoazm80E45R1hzms+DXkfIyNWZq667PQbtPQVOGJYJW3VCd2KrkWPTN3kb lcAya3mIqyd+7r4Dp4Qv+4GIVOU+9gb4Y8LDKjy2goUNYgwD0JXreVPfPiRdtrH4C97G +JZUr1jvEi7z/MYHKQ4qgS1QZJIMeh7l+HO/m/SfZ7gfdNyVxvsjhOgsyf14GZgA1iSS qhnEEw/FmygWEp7WyGs+gd9dY1YkMNA5DbX2gwLt7f2EtxIZYuJSfmJtB/mpsd8l4lPW i4gqY6I22c+r1XLSwxZ0qPbTc0uOXUSs30ahoo2kV8mUtvy2q8FwS1yy7IMdwGnMiGI7 1org== 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:references :in-reply-to:message-id:date:subject:cc:to:dmarc-filter:delivered-to :dkim-signature:dkim-filter; bh=lg2uknn9+rfTXQu+BHUHmgYlf6+X7LjOSHA4wxZIdyo=; b=OKAulmkzKNoAYpnn8HdXJbyit33RdHui0o7S6yDujT5jlJIjXo58MfrqHfxZpGFKT2 AxAx3OevuObL8Apa45tUT3N1Yx/uCwFFGD16MVVPtllqRSP5bR7CGEsgohzyArkrcnbw x835+fClVo+9OWhq+09yk6dRg+km3Yf5hlDUNaUb8AAzQ1jRsVfGCGb8qwRegFl1CRMI xset26Dje7YYw6dgxqhULkw/GOVwV2EsnSTOXIEHcOTz/CEba3DgFXI5y+7DUQY15sk3 l8uABwNCgopP9uKg3v7ptOkTH4l98pwqovx+U3ivZ3tYvc+3sO2Zixy8KVtkeF1ZamHy DLcQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sourceware.org header.s=default header.b=w595pvFV; spf=pass (google.com: domain of binutils-bounces+ouuuleilei=gmail.com@sourceware.org designates 2620:52:3:1:0:246e:9693:128c 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. [2620:52:3:1:0:246e:9693:128c]) by mx.google.com with ESMTPS id x9-20020aa7dac9000000b004acb8c12309si7904079eds.575.2023.02.13.08.11.56 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 13 Feb 2023 08:11:56 -0800 (PST) Received-SPF: pass (google.com: domain of binutils-bounces+ouuuleilei=gmail.com@sourceware.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) client-ip=2620:52:3:1:0:246e:9693:128c; Authentication-Results: mx.google.com; dkim=pass header.i=@sourceware.org header.s=default header.b=w595pvFV; spf=pass (google.com: domain of binutils-bounces+ouuuleilei=gmail.com@sourceware.org designates 2620:52:3:1:0:246e:9693:128c 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 D6BD7385B520 for ; Mon, 13 Feb 2023 16:11:46 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org D6BD7385B520 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1676304706; bh=lg2uknn9+rfTXQu+BHUHmgYlf6+X7LjOSHA4wxZIdyo=; h=To:Cc:Subject:Date:In-Reply-To:References:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From:Reply-To:From; b=w595pvFV15tSgWP4a4aRtDbDpa9Gi00KHJPnoePi7O1IieVmE0l0AF6EE0WQ4kseB cJyRMtMPrJW+ytuQZvSkMvFwtZtg9+5P7BTAX64QxWMm24bkpUPJ/kRbBkZfI7m3Jk 6mn49LEQ1Ja61sGFa6cRtp3nKCM77+prFWNPtn44= 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 5069C3858D33 for ; Mon, 13 Feb 2023 16:11:31 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 5069C3858D33 Received: from valinor.ownit.se (84-55-68-216.customers.ownit.se [84.55.68.216]) by emagii.se (Postfix) with ESMTPSA id E051D120259; Mon, 13 Feb 2023 17:11:29 +0100 (CET) Received-SPF: pass (emagii.beebytevps.io: connection is authenticated) To: binutils@sourceware.org Cc: nickc@redhat.com, Ulf Samuelsson Subject: [PATCH v3 4/6] ldlex.l: Add ASCIZ token Date: Mon, 13 Feb 2023 17:11:22 +0100 Message-Id: <20230213161124.15340-5-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: <167630469025.3742987.5788160975517661920@localhost.localdomain> X-PPP-Vhost: emagii.com X-Spam-Status: No, score=-12.1 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, UPPERCASE_50_75 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: Ulf Samuelsson 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?1757732895241636905?= X-GMAIL-MSGID: =?utf-8?q?1757732895241636905?= From: Ulf Samuelsson Signed-off-by: Ulf Samuelsson --- ld/ldlex.l | 1 + 1 file changed, 1 insertion(+) diff --git a/ld/ldlex.l b/ld/ldlex.l index cf596530b20..32336cf0be2 100644 --- a/ld/ldlex.l +++ b/ld/ldlex.l @@ -309,6 +309,7 @@ V_IDENTIFIER [*?.$_a-zA-Z\[\]\-\!\^\\]([*?.$_a-zA-Z0-9\[\]\-\!\^\\]|::)* "LONG" { RTOKEN(LONG); } "SHORT" { RTOKEN(SHORT); } "BYTE" { RTOKEN(BYTE); } +"ASCIZ" { RTOKEN(ASCIZ); }