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.129.124]) by sourceware.org (Postfix) with ESMTPS id B9F203858D28 for ; Mon, 31 Jan 2022 13:33:34 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org B9F203858D28 Received: from mail-wr1-f70.google.com (mail-wr1-f70.google.com [209.85.221.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-137-MHKgJZsQPvKfHlB0DpylbA-1; Mon, 31 Jan 2022 08:33:33 -0500 X-MC-Unique: MHKgJZsQPvKfHlB0DpylbA-1 Received: by mail-wr1-f70.google.com with SMTP id k7-20020adfb347000000b001dd761d46c7so3123398wrd.4 for ; Mon, 31 Jan 2022 05:33:32 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:mime-version:user-agent :content-language:to:cc:references:from:subject:in-reply-to :content-transfer-encoding; bh=YKdN97Q9MxS1y9zKy3bj1c83DeSOStCPozsfaKOXapo=; b=Ve/XljttcqqSWpBzqmktHRaea+c8ZlbPu5Mnuf0hNgXqowhDTPKPD62S/J+xcq5jC+ VXgIOLWvbDUkbeyowcVhJ7EIHZ+JbgDXwj1wQ5UNHwD2T5LeUKopHHLhmJFBA4QQ7VNo LPVoeZkGG51US8HdfK4+RmzRKs8bUevEGjQxSxDcJvpeEOzap7QxMJHugUIHjKIKqCL1 Mre6GHMnYc2OPyMjQ7zUxDLhHDz1ORcoCsqrnYhJ80Dn06VK45ILzgZf3lr7uvMRoHDO MrswVdPVSLkaq4NAIk7HdJiZgbEDxwvLX6kMMejd92ujijPWBrucu5xPw6krUuTnXBhl A8VQ== X-Gm-Message-State: AOAM532lNFHoa/dv7Sy/cwZzZsjlRVOXaFQu+I96g0LhBtJ5bz4iMdeK 8CQJJWtKldE3CssyxjXvJrEf3OzlhkhQiaUml+EodQ2ACh5uezKax0nywxl1/Vq8iCuebrh/H3x vToArMFfUkHVk7SZLwQ== X-Received: by 2002:a05:6000:2a7:: with SMTP id l7mr18034508wry.170.1643636011927; Mon, 31 Jan 2022 05:33:31 -0800 (PST) X-Google-Smtp-Source: ABdhPJymswwzuIke19ke3p2K1rJwbrgLeZcJh6ICl0eZpOpAnL9QrO4Gi8sMhjJFGbk2RUVhvsKjAg== X-Received: by 2002:a05:6000:2a7:: with SMTP id l7mr18034497wry.170.1643636011786; Mon, 31 Jan 2022 05:33:31 -0800 (PST) Received: from [192.168.1.6] (adsl-164-239.freeuk.com. [80.168.164.239]) by smtp.gmail.com with ESMTPSA id q2sm5946399wrw.14.2022.01.31.05.33.31 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 31 Jan 2022 05:33:31 -0800 (PST) Message-ID: <653b3fdf-61ed-2c41-5db2-de40bb51e8a0@redhat.com> Date: Mon, 31 Jan 2022 13:33:30 +0000 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.5.0 To: Fangrui Song , Alan Modra Cc: binutils@sourceware.org, Luca Boccassi References: <20220129074545.csaig4kn5bk4si5k@gmail.com> From: Nick Clifton Subject: Re: Output section type (READONLY) In-Reply-To: <20220129074545.csaig4kn5bk4si5k@gmail.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: 7bit X-Spam-Status: No, score=-4.3 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, NICE_REPLY_A, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H2, SPF_HELO_NONE, SPF_NONE, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham 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: Mon, 31 Jan 2022 13:33:35 -0000 Hi Fangrui, > Well, READONLY has another behavior that it forces non-SHF_WRITE output > even if an input section has the SHF_WRITE flag. > I find this quite dangerous if an input section has the SHF_WRITE flag. > I do not see in what circumstances a user may want this behavior. > This just seems very dangerous to use in general. So basically what you are saying is that if a input section is assigned to an output sections with incompatible attributes (presumably because of a linker script declaration) then the linker should issue a warning message, yes ? By extension then, this feature should cover not just the readonly section attribute, but the NOLOAD attribute as well. This sounds like it might be an interesting feature to implement for someone looking to gain experience with the binutils. Cheers Nick