From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pj1-f53.google.com (mail-pj1-f53.google.com [209.85.216.53]) by sourceware.org (Postfix) with ESMTPS id 2292F3858D20 for ; Thu, 17 Feb 2022 02:12:22 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 2292F3858D20 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=maskray.me Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-pj1-f53.google.com with SMTP id a11-20020a17090a740b00b001b8b506c42fso8152680pjg.0 for ; Wed, 16 Feb 2022 18:12:22 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=iUf2+xlqJvpVJNf/FP+sjdC+35Qrfffh8lI0+tFuqO4=; b=lk9VKiots05g5XTdGqxCvUQaDZvs+8MwKaPhdJdroqw80b+yckIEyI+CRD/5G549qL kqIkZAYAHNMMlGKIOzkGUslvbcGRr+eI8bUQUNFLo9Uujrl+e6CVzcZnj+POix+ougtU lS/B0ftNBBMj7vbhGOfx/xnnVicXUDAwjhjUIlupNSzgVtcf5OeBlPV5q26aW2FGDtxa SkEWaBncexhnY/qpx0720sSFt3tmMsqQg+KvgQ0UaKYZbbJrGCuwpVn45nGJyvx2h+CX MZfL46E2gt+akSQiKwHayBdfmaXp9LMAIM4domqITI+b0JRP3vxLjYPAFJyU+g1aCb9N 6fKQ== X-Gm-Message-State: AOAM5331OElq3tlipoeJFArjSveoT4W1VMvRfjAGEx6/jn885xq8AKzQ 8Gt45WK63X2Pl9LmAR8Bpw8= X-Google-Smtp-Source: ABdhPJzfja19pxEl83BOxporOb+YwksH4wJJjoCZTRvhgTXxQZ/isS7HBF0eL7CQvyN/M28ahPtUtw== X-Received: by 2002:a17:90a:7441:b0:1b9:cd84:7eed with SMTP id o1-20020a17090a744100b001b9cd847eedmr4994436pjk.106.1645063940857; Wed, 16 Feb 2022 18:12:20 -0800 (PST) Received: from localhost ([2601:647:6300:b760:2d72:28de:d75f:2d48]) by smtp.gmail.com with ESMTPSA id ot10sm336428pjb.3.2022.02.16.18.12.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 16 Feb 2022 18:12:20 -0800 (PST) Date: Wed, 16 Feb 2022 18:12:19 -0800 From: Fangrui Song To: Nick Clifton Cc: Luca Boccassi , Michael Matz , "binutils@sourceware.org" Subject: Re: Output section type (READONLY) Message-ID: <20220217021219.qqwepnd4yjaq6ogq@gmail.com> References: <251473f45c9c4d2fa5edc3265c5ac77e06bb07b2.camel@debian.org> <740fedd2111e72f785bbe000890193f55a6a1d6d.camel@debian.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-1.5 required=5.0 tests=BAYES_00, FREEMAIL_FORGED_FROMDOMAIN, FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS, KAM_DMARC_STATUS, KAM_INFOUSMEBIZ, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) 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-List-Received-Date: Thu, 17 Feb 2022 02:12:23 -0000 On 2022-02-16, Nick Clifton wrote: > Hi Guys, > > I have gone ahead and applied an update form of Fanguri's patch (attached). Thanks, this enables a proper way to set the section type in the future. Hope someone implements this for gold as well since it does not recognize .note* as SHT_NOTE, either. > I extended the patch so that READONLY and type= can be used together > if desired, like this: > > .ro.note (READONLY (TYPE=SHT_NOTE)) : { LONG(5678); } ... But I am a little bit uneasy with the additional support for READONLY. Michael's comment (https://sourceware.org/pipermail/binutils/2022-February/119627.html) makes a lot of sense to me and I think we really need evidence that (READONLY) is needed and worth adding this syntax to support it... > (I chose this particular syntax because it was the easiest to implement. > > Other than that the patch retains all of the features in the original submission: > >https://sourceware.org/pipermail/binutils/2022-February/119600.html > >Cheers > Nick In addition, as mentioned on https://bugzilla.redhat.com/show_bug.cgi?id=2052801 ideally when the output section contains an input section of a different type, ld should report a type mismatch error to prevent misuse, but I don't know how...