From patchwork Mon Feb 13 16:20:04 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ulf Samuelsson X-Patchwork-Id: 56372 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp2436875wrn; Mon, 13 Feb 2023 08:22:55 -0800 (PST) X-Google-Smtp-Source: AK7set/3wzb0ydUvHLHgAZcJxrjb3hX5yv8nz82YmaZWyIKVNsDw3zprT9jOS+kSkQGUdMv8chmc X-Received: by 2002:a50:99cd:0:b0:4ac:cf2a:b18 with SMTP id n13-20020a5099cd000000b004accf2a0b18mr2607497edb.25.1676305375783; Mon, 13 Feb 2023 08:22:55 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1676305375; cv=none; d=google.com; s=arc-20160816; b=CBgVCtx0TduY3Awn/lsnvpaVhITMGLjEUyeX33LCGDE32TukBcb1SQ3GiBmcF0dP4l qyQKRkWZeU+tDTDR+wSukGYdiKmUUDgvcRGjEJRECRtYH5M0pe9TnAnP7b7cxYo2p3mX Zg4PwJO/KVp9gTgs8Psp0mUt+C1sOSwDy4o5wWU5teGDVz4Bxj92XG8izUxLbhvGRJCT W0R6M5TwfBGL/osa6z0Oiq/AksroEiZD5oBXeSw7+TMGXrIXFhW4ErskQFfO4m9DhR3h kD7rpRRMPW0Ty8c9rAycrV6CTmDJg22DEFeWAR9dqUfFplXqKpvg0W/s/J/AN3EhZGba L1Gw== 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=lcd/QIeEl6orqS+VjBVh+YyC8WR30CvxsECIv5lrBD73L8hM/X+/5UuhBL2TvVMQp7 xi6/rOo4+jNtUK5hb2fUS8QeXPe1Dujj8K3h9Ly8Hlu8xdeakpTUIg08cIYws7S94cox oWz30WDSQ6ohgWZ+9vyPOrYOuHAnqCo7brZKnkpIVLA5qhJuQBqoMLytZXwIAF67NXx5 y2yrpFcmbtzj+5UVBBTuFAhGq8DPG+gKuMrZR9miTTR1ohbeHCPb6NgjSVY5Mk7xxch3 rbUUEZK26xoHbZa2yGZQAzcCbYdiv1J6qTUrXrHYOKihZZtwQLabggLq60JTCfP6P+vj d1kQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sourceware.org header.s=default header.b=DvGhneGj; 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 (ip-8-43-85-97.sourceware.org. [8.43.85.97]) by mx.google.com with ESMTPS id s26-20020a056402015a00b004ab1682924bsi13796940edu.425.2023.02.13.08.22.55 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 13 Feb 2023 08:22:55 -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=DvGhneGj; 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 7B7083864812 for ; Mon, 13 Feb 2023 16:21:34 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 7B7083864812 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1676305294; 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=DvGhneGjY1L5Obx5YTBVv04BRpIarQl6He9BiyV+7/jcv7dsOChOIzlFJ8e3rr4yL qPKjNFPuVfjQgNQBtm/Vu7wh6n4tCCTlH5XMb8yUi7PBkrEhoHJCXuxDACW6gqrgK6 9wqmFh1GnYBRaIX0gC+e7RIYYTo+4dycwAe+Pwtw= 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 E11CE3858D33 for ; Mon, 13 Feb 2023 16:20:14 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org E11CE3858D33 Received: from valinor.ownit.se (84-55-68-216.customers.ownit.se [84.55.68.216]) by emagii.se (Postfix) with ESMTPSA id 8BBD4120205; 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, Ulf Samuelsson Subject: [PATCH v4 1/6] Document the ASCIZ command Date: Mon, 13 Feb 2023 17:20:04 +0100 Message-Id: <20230213162009.15515-2-binutils@emagii.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20230213162009.15515-1-binutils@emagii.com> References: <20230213162009.15515-1-binutils@emagii.com> X-PPP-Message-ID: <167630521380.3743402.3687318110136812543@localhost.localdomain> X-PPP-Vhost: emagii.com X-Spam-Status: No, score=-11.9 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?1757733586120176458?= X-GMAIL-MSGID: =?utf-8?q?1757733586120176458?= 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:20:05 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ulf Samuelsson X-Patchwork-Id: 56369 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp2435668wrn; Mon, 13 Feb 2023 08:20:35 -0800 (PST) X-Google-Smtp-Source: AK7set/cwP7KIGc5Cwei0Dn17m/2dPV15D0neSWdKps/90ffJ3LAUlHScXfEJzDVuIUaj6SQk9i+ X-Received: by 2002:a17:907:98b4:b0:8af:2b24:81a8 with SMTP id ju20-20020a17090798b400b008af2b2481a8mr16102023ejc.14.1676305234953; Mon, 13 Feb 2023 08:20:34 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1676305234; cv=none; d=google.com; s=arc-20160816; b=ccpzOQjESQCl77CK8ohEH/uP4oNRuY+hWZ7x/u32xlq0eevEd4LA3UDUc5rfUY3evb 0F1ECf6/68BlPYdFvPSob+n/O7H3ph6ZmywkVS9ORZ6Iv8CjlD0J2lTQzJnxkhzGP8mo QOdP5/5oMfaajXu1Ll8sIWTqybr4K7RPn7U9XoWDWkVulWUBmGB9qH2VBH06qMCw8mi5 hexTokeW83YBUHV5yL1tB6k1+19/C6+kv73MvJvx1AW5GXuq7AuMFHri1WYOseE5F688 ZNZiOXfLQ3LtuQpZnUuLq8dbLk5+gSquQtTw5Bo0l+zqEzpCikyXTFBATAC+UEZ8FI1x e4YA== 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=gXrb4Jq6ctRTe5fJ+CWPq+ndxmyKzFOOvb8EUKpiKmB/tZ88D2gCwWouuEJHbUUBHL j28nvJywMLtbUaXtlykwp/OlN7Io5BK5EHXoEHsY1Km5IMv06FaAkZaU8ovjBFqNID0M Sw0IhZm+vmABAkJ/4h1aNk8ypCAMxczSPphjtskoNjwJGmXzJdUcLED25HJpE2lwrMAd e6OJzga9Hyg+4oNdrFhEuDIpDG5NKiwU1tzGk59gftYMt/9NMkwAkelDZc/Df6C6cHXl ku64h76nmDfNKli+hhETfWkDX1jKi0OwfYEAwcNZ0B1F3Yj1dc+6KPVCcdhkJKrj8zoK 3l0Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sourceware.org header.s=default header.b=P0sHJ8uG; 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 if18-20020a170906df5200b0088a4448a43dsi12840696ejc.263.2023.02.13.08.20.34 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 13 Feb 2023 08:20:34 -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=P0sHJ8uG; 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 C712E3858436 for ; Mon, 13 Feb 2023 16:20:32 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org C712E3858436 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1676305232; 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=P0sHJ8uGxJsiy4pSbQriRYhFXRg/ya4P8aWCk8aedRaFG4pUQEs2l7XfL/UkBdgaE EUICIboxav0plp9uZxLbwP0lcXPYwXFmkX17OJrWvxqv/EI6qusUbVdInslcumA/Tw ChKw9UNPqR6785eqaC+ppxZfaNaozjVQq1FPVrEk= 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 4824D3858D35 for ; Mon, 13 Feb 2023 16:20:15 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 4824D3858D35 Received: from valinor.ownit.se (84-55-68-216.customers.ownit.se [84.55.68.216]) by emagii.se (Postfix) with ESMTPSA id E6F8C120245; 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, Ulf Samuelsson Subject: [PATCH v4 2/6] Add ASCIZ to NEWS Date: Mon, 13 Feb 2023 17:20:05 +0100 Message-Id: <20230213162009.15515-3-binutils@emagii.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20230213162009.15515-1-binutils@emagii.com> References: <20230213162009.15515-1-binutils@emagii.com> X-PPP-Message-ID: <167630521422.3743418.14274701915789472585@localhost.localdomain> X-PPP-Vhost: emagii.com X-Spam-Status: No, score=-11.8 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?1757733437646543955?= X-GMAIL-MSGID: =?utf-8?q?1757733437646543955?= 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:20:06 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ulf Samuelsson X-Patchwork-Id: 56370 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp2435703wrn; Mon, 13 Feb 2023 08:20:38 -0800 (PST) X-Google-Smtp-Source: AK7set+FrH6aROuyNCsia8y7zYiUyCjT4aszBoA8hMWswXcT/dxb3KE6an+8HYoLKC8eNpF8G75n X-Received: by 2002:a50:a6d3:0:b0:4ac:bf55:e943 with SMTP id f19-20020a50a6d3000000b004acbf55e943mr5368627edc.34.1676305238204; Mon, 13 Feb 2023 08:20:38 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1676305238; cv=none; d=google.com; s=arc-20160816; b=fmMD8FVMkNHT+ABjlkC1qRyAujCUdPjixiZWLLqCvaZ5GaAbrQtvtN917n03osxQdr wnWjOtPVqjOPq/tsXK51ovtI5rq4WcyVVSAYgeNt2F61CIceSUgQQSulAP+xPG+xq/xA T+WyhhFB75r07Mc5ko9MMpJ3OTOe9uTD0Gk5f5+pkrQnF2C2xN+btBOJ9+/sxJfjgUrM WvmopGdgdzCd+1Hw3lgXsNHq0/1Xn2xwTdeIDawKiEOmHAKQTfvCT61nYUoFvhlNblnD GnF/HmfahkDCUh07sEdIiwznHZNGFkrtrEoHWwsjO2C8/vfbZhwJtmLZXMX6sW7APWvA 0yUQ== 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=KuA6jnsduijQFkKZbLdF8I38g4gUxowuxrv1tnRIsGDuBkBylT06u/0L9o9ohZM350 cG/VNIdf+zzd/j+VJ62vdjk1gAq7PS3vMOOaVFdlnOSBE0OZxmNO3cDWS5Fp1lmjcjig i8EoXxDbYFiCOZnGpU8WdwaoPnXgDoK8/OAyX9LFpWuzyWFU8LDQX5ULjTZbrvzXk1q/ AMzj4ysbr/3M+tK6wItz9OMX6XGiHHNHzxv6iz93/eGR3y8qayVQHc2IMGmHV+kqrVEk nYC399jruS9M63BNZIYdtzbmJMvv+VO1YixYql0E7RhPPZctLsOCMvwF1nYB5I7V+zeW JV5g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sourceware.org header.s=default header.b=x6tGeJiL; 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 l1-20020a056402124100b004acc30ee8fbsi5490626edw.429.2023.02.13.08.20.38 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 13 Feb 2023 08:20:38 -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=x6tGeJiL; 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 3090638582B7 for ; Mon, 13 Feb 2023 16:20:35 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 3090638582B7 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1676305235; 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=x6tGeJiL1EjDW7aXZkazOn/+XdWMLWxR/RmOhbYq1KEzpTA20nbQfKFKsf/jlgmJv hhXvBV2M5bufXYEvc+yhjc2k2jTQUbV72Nqsxe5dMHe9pljIJugT6HKqnFwlrD9/6h 0kaNyPMV6lmGTkzLgzs/423CREGRk53p9+oVhrxs= 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 ABF843858D37 for ; Mon, 13 Feb 2023 16:20:15 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org ABF843858D37 Received: from valinor.ownit.se (84-55-68-216.customers.ownit.se [84.55.68.216]) by emagii.se (Postfix) with ESMTPSA id 4F2DD120258; Mon, 13 Feb 2023 17:20:14 +0100 (CET) Received-SPF: pass (emagii.beebytevps.io: connection is authenticated) To: binutils@sourceware.org Cc: nickc@redhat.com, Ulf Samuelsson Subject: [PATCH v4 3/6] Add ASCIZ to testsuite Date: Mon, 13 Feb 2023 17:20:06 +0100 Message-Id: <20230213162009.15515-4-binutils@emagii.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20230213162009.15515-1-binutils@emagii.com> References: <20230213162009.15515-1-binutils@emagii.com> X-PPP-Message-ID: <167630521459.3743433.2920039642916800259@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 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?1757733441744302986?= X-GMAIL-MSGID: =?utf-8?q?1757733441744302986?= 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:20:07 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ulf Samuelsson X-Patchwork-Id: 56371 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp2435759wrn; Mon, 13 Feb 2023 08:20:45 -0800 (PST) X-Google-Smtp-Source: AK7set+sErurOUQ4UTnPpHyG6Yt03nVoCZRT6p7alg9ZvQIE3bW0zFtYrdcTcA45X1wb7n6PulwI X-Received: by 2002:a50:cd50:0:b0:4ab:4be9:5dcf with SMTP id d16-20020a50cd50000000b004ab4be95dcfmr12159999edj.4.1676305244866; Mon, 13 Feb 2023 08:20:44 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1676305244; cv=none; d=google.com; s=arc-20160816; b=qePrFMwrY2+GGYH0Qx7wyLa2DG8ryHaUWZResmnLkBIiKeFy4NWLFVUKrzmBMK1h0S 6f0D8vNZegGUm7IQxW9sM3nDfFH/md/zxDikf4pluveOCrdfrlmLqdgWSQibiHbXDkU4 cOaTGeS3xJv009Rt3ikpSZFOWXD0GqJOxe3Qp5A6ANSkXppAz/k+i/2BSiPHtcYToK2X tYF2ef0PliwPsD/Jf81ireR+6eJO1rVvRApsLOMSqdo08iXgjzuRUlQrYJNMiV0Dbny4 z6N7qci5C60trICMZ+fTQg1Yl935ngPiInhkVwnFbfIPAxlXzqKDIQ4qxc5pAUM6/TbZ 1mjw== 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=cgXWFEqMVr4rlmx8ZYvhEIEIRg7Mji8LrbXCYsy+D5eataGIXyR69TdXeCZxT+qlZU aR65GSesJL4DA0T73+thfN0QAbaRhTknw2zXfqZnCCQ9oUnDEVu0vHYbRY3+o915NQZe Q7SnOqYlIKZ8V67iacqtYF5Hcae4TEX5cOWDuPVJYWT9Iwn0JsXm9ff4ZWWDJulEn4dr uxNc4f0aylsT8ZCpgQRlzL/dDmPNrzmxLwmUIweNcg1KnvnShzRbVv5UydkF3Gx53plN ctyRpCVIRmU4end3sz4GQUwz+yGn74XObTVtr5FoxG6vN7u24dyViMkCQja4hrAphGRC NJ4g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sourceware.org header.s=default header.b=aPBN5MG0; 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 n1-20020aa7c441000000b004acb23c25d8si9436182edr.640.2023.02.13.08.20.44 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 13 Feb 2023 08:20:44 -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=aPBN5MG0; 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 543EF385B52C for ; Mon, 13 Feb 2023 16:20:38 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 543EF385B52C DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1676305238; 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=aPBN5MG0lLCqBZc2RxN7iBSAoDI2E6no5FrJtPSp2eO7s2sg/h3wbiMi3ZIrIuMVx oxp9PzmPF4RI0TAlXcrkArma3g/3+9yNVjhM9p7DpWWyK9R80foCam2R1IfkWMCM1J WP4VzmdbAHzX2QwL2ykiMcVOfwwMbRGn0VSHA7oY= 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 2436B3858CDB for ; Mon, 13 Feb 2023 16:20:16 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 2436B3858CDB Received: from valinor.ownit.se (84-55-68-216.customers.ownit.se [84.55.68.216]) by emagii.se (Postfix) with ESMTPSA id B355C120259; Mon, 13 Feb 2023 17:20:14 +0100 (CET) Received-SPF: pass (emagii.beebytevps.io: connection is authenticated) To: binutils@sourceware.org Cc: nickc@redhat.com, Ulf Samuelsson Subject: [PATCH v4 4/6] ldlex.l: Add ASCIZ token Date: Mon, 13 Feb 2023 17:20:07 +0100 Message-Id: <20230213162009.15515-5-binutils@emagii.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20230213162009.15515-1-binutils@emagii.com> References: <20230213162009.15515-1-binutils@emagii.com> X-PPP-Message-ID: <167630521501.3743450.16889981568918629993@localhost.localdomain> X-PPP-Vhost: emagii.com X-Spam-Status: No, score=-12.4 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?1757733448626958242?= X-GMAIL-MSGID: =?utf-8?q?1757733448626958242?= 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); }