From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by sourceware.org (Postfix) with ESMTPS id 5D8AF3858D33 for ; Thu, 16 Feb 2023 16:31:56 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 5D8AF3858D33 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1676565116; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=qBtj1aoVoqQb33M9CH+MI4YHp6kDGkQKVrK+CY72/go=; b=clISdbeDve0oVQMnfcEwZACYV4fiGPRSgUcxz6Bgeqa3hv0OVWT6cR5pBPUWff7cUfPB4K gNlVy8yEfHngeWsrry51biSDPRHvZlOOoMBSacC/27vh9sYHfMP7BdwTohubvAN5idEXsY 3/Pv80zRe1F4X5COghS2lYP7pz5CHcY= Received: from mail-qt1-f200.google.com (mail-qt1-f200.google.com [209.85.160.200]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-556-WdyLLMi9Oq-SkLMNiuCADw-1; Thu, 16 Feb 2023 11:31:54 -0500 X-MC-Unique: WdyLLMi9Oq-SkLMNiuCADw-1 Received: by mail-qt1-f200.google.com with SMTP id cd3-20020a05622a418300b003b9bd2a2284so1497353qtb.4 for ; Thu, 16 Feb 2023 08:31:54 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:in-reply-to:from:references:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=qBtj1aoVoqQb33M9CH+MI4YHp6kDGkQKVrK+CY72/go=; b=wiDOxLJKeWJKfjB548rmBH2z6kbreLhQpwMZUo7jcU1iWs6y72lafBT7rULMH7nN6w s5j6T2V26/o02rjqfAb+XxFAN/ww3L4H/29IMPL6K+PH7eM7Z7CuCOghBWtwyi4eIha/ p/Y4U3DiMojRolqNV32mGqDRIHvr2T5Pb90fl1t6JoIq7GCLyKI+0PG4K5yB+wmJqF3e 21UMKOQ6SmBMTzHTFTmj1w72CtGGu33OUOvo9+hiYU0AWmDqutCn/758vlmGWuZfYLxM D0S+6lP3EcnDx/jPa+AbDVIVZOfqS8+ikCp293cZY4zWBvSUPiR4MsWby8w7tGm9ODUR 0UeQ== X-Gm-Message-State: AO0yUKWHebOCB0ENdQTALGTyOtS//VAca9snNxBe+k5xL5e2Z7922ab+ rxw9f2rdOq5ezuIU5Zo33O/x/m7E3VP0Abh4/lwECv6rw7Ur3k39I+dIR4uP7hGdTvyNSYqvEql BBGhlHLqMUvG08xf8kFXlxOA= X-Received: by 2002:a05:622a:408f:b0:3b9:bc8c:c1fb with SMTP id cg15-20020a05622a408f00b003b9bc8cc1fbmr4509507qtb.6.1676565113715; Thu, 16 Feb 2023 08:31:53 -0800 (PST) X-Google-Smtp-Source: AK7set/UsUpiwf/ViHyFTExgGY8gwxrSImFWzAC1x2ND5eorLp/SZO9PTUjn3sH93+xSFFLiN8KtsQ== X-Received: by 2002:a05:622a:408f:b0:3b9:bc8c:c1fb with SMTP id cg15-20020a05622a408f00b003b9bc8cc1fbmr4509481qtb.6.1676565113478; Thu, 16 Feb 2023 08:31:53 -0800 (PST) Received: from [192.168.1.18] ([79.123.83.169]) by smtp.gmail.com with ESMTPSA id b14-20020ac801ce000000b003b880ef08acsm1477747qtg.35.2023.02.16.08.31.52 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 16 Feb 2023 08:31:52 -0800 (PST) Message-ID: <24fb6e9d-1452-b36a-9a2e-afabb46e2f76@redhat.com> Date: Thu, 16 Feb 2023 16:31:51 +0000 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.7.1 Subject: Re: [RFC v0 0/6] ASCII Command for output section To: Ulf Samuelsson , binutils@sourceware.org References: <20230215114052.28292-1-binutils@emagii.com> <83926d68-c2da-e99b-848f-525a9dc28f47@emagii.com> From: Nick Clifton In-Reply-To: <83926d68-c2da-e99b-848f-525a9dc28f47@emagii.com> X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Language: en-GB Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.7 required=5.0 tests=BAYES_00,BODY_8BITS,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_NONE,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: Hi Ulf, >>   What do you think of this alternative version of your patch ? OK, I have now applied a tweaked version of the patch. > A little closer look reveals that there is some oddities in the white space. > Also, when the string in the ASCII command is longer than the specified > length, only we need to insert a '\0' character at the end. > > For this: > >     len = size; > > must be changed to > >     len = size - 1; Done. > The size is specified by a "mustbe_exp" > >     | ASCII '(' mustbe_exp ')' NAME > >         { >           /* 'value' is a memory leak, do we care?  */ >           etree_type *value = $3; >           lang_add_string (value->value.value, $5); >         } > > I cannot judge the consequences of having a full expression, instead of an INT. > > Will the "value->value.value" work, if we do > >      ASCII (3 * 15) "Long string" It works. The area assigned will be 45 bytes. I tested it, and included a version of this expression in the new linker test. > We do a malloc in the "etree_type *value = $3;" statement. > This is thrown away without a "free". > > Is that a problem anywhere? > I guess most OSes would reclaim everything once the 'ld' terminates. > There will not be that many ASCII statements in a linker command file. Right. As far as I am concerned a leak this small is not important. Cheers Nick