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 43B893858D39 for ; Mon, 20 May 2024 14:54:56 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 43B893858D39 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 43B893858D39 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=170.10.133.124 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1716216898; cv=none; b=Q8B6mh+rC6vMIpCaWlAXuM/+op5eW/94Lgtq0RQ//eB6/lg1I3uZjFqO1CMaAhNjSU2/wjMu2Xup3X6mTi0MxWDfgBRDk4khIYLvsBnDGEyqWvFFOiP1lwNFzWQZN9ldy8Sj9GBmFJceMkbSYU6NPS5EBWRfISBthkaDOh5wzqA= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1716216898; c=relaxed/simple; bh=MpBJUPPr2R5bOc/9aW2r3xVQ8cfbktxsj/Xg7JMFtHs=; h=DKIM-Signature:Message-ID:Date:MIME-Version:Subject:To:From; b=wzhIKetlVfqE4jppMTq2QAoesobnuT6Ykqaw5uzBpeL+/AjzsNrBgbiZKlNdZ1qUhgIrWgC6AmWkRVf8c+IseCZoFaGFuFBHqfUajSzavYkYvPLkcJhM+OL9PS09s2JO6DMZ/bv1JFXAVr4Ihn8r7OujGR1djM7T1H6xbFFoMqk= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1716216895; 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:autocrypt:autocrypt; bh=6yatHsExvZmx+kpGkAJnClYHIBU4WY4OBS3++1EfpE8=; b=fLlTIq9c2/kdh1hFXbR/nbN72AybN+UHdiuX0qNloNsrLa5h4pNQ9fka3dF0UppEhFUDBt Zxpf+uyH4maw7jGjgDFVfZ63beIlAvsEDDqPy+ymPPoiSURJ5m1V6b5jJf2fYvM5O04KSf hmyryXh6YVyMaV59UaA+dDGQ+54PDDM= Received: from mail-qk1-f200.google.com (mail-qk1-f200.google.com [209.85.222.200]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-446-XJVJmx3tPhatLsQOHkFgAA-1; Mon, 20 May 2024 10:54:53 -0400 X-MC-Unique: XJVJmx3tPhatLsQOHkFgAA-1 Received: by mail-qk1-f200.google.com with SMTP id af79cd13be357-7948102fc8eso113847185a.0 for ; Mon, 20 May 2024 07:54:53 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1716216892; x=1716821692; h=content-transfer-encoding:in-reply-to:autocrypt:from :content-language:references:to:subject:user-agent:mime-version:date :message-id:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=6yatHsExvZmx+kpGkAJnClYHIBU4WY4OBS3++1EfpE8=; b=looaDnPqW1m/G2N8cOwVJABaYPJTSBQRlVZWKEfOW4L1MkFcR3+BaLJZ6D3loTDwCA 2b3y4jThRNaoIkPWQIu7qjYm2O3oVxdXB9XywbOIacswY/NDz/qW0zSFdKd5GdtYHCa2 EHDuaRrTHDfldc9qM6fvaJL09DjP1igYaNVh5C0VQyQPNgi1lfkXaWj3w9tZ6/Pxw7gx Fh6eABPZHO43TtbSG7RoXGfxRvP0mQ6K9PZ2NuWEJ7vo5Vt93EH/33flYsAp4akHByK5 Rp/LrKvPBlX+8FHyeMap09Y0nWO2MBs7xtafFaYp/FdgnLqohwtXvv7cb6UHSl7+0vTA zGaQ== X-Forwarded-Encrypted: i=1; AJvYcCWeAklnP93Eo1lB8nU07SS7m75b9b8XBT3m6P8haj3JHJJHAjaptCsHCwSBs+Z2UTTi/hzeNoR0YQf+EpylsDYI1ZQCK5jpmw== X-Gm-Message-State: AOJu0YwlTeYcpeIex0Dc31KTBx68Wgy0snbCXdq2zeTfq8L7gE9hLQHN 5rFrDJuzuGJsnVN8i745YLn+V0R4rsb39EJEoK6fviufW0UaHJK0lsPa+7P4MnmCEPwtYfH1dAT GZEKXQUPPFs+5TP8ixpRC/W9GNT8uL59mutD4n0pcB6K9QBJ8o9nu3cbKTRj7HIQ= X-Received: by 2002:a05:620a:1a97:b0:78d:646d:e2e7 with SMTP id af79cd13be357-792c76101a4mr3677368385a.66.1716216892492; Mon, 20 May 2024 07:54:52 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGDR8oi5N7CWJ/cVk+pX7TbQHDERP2c2HvMLNC8bz8CyCux+vNcS65j8OcFcIaE3MyKqmYFyw== X-Received: by 2002:a05:620a:1a97:b0:78d:646d:e2e7 with SMTP id af79cd13be357-792c76101a4mr3677365985a.66.1716216892139; Mon, 20 May 2024 07:54:52 -0700 (PDT) Received: from [192.168.1.18] ([80.168.239.14]) by smtp.gmail.com with ESMTPSA id af79cd13be357-792e91acc94sm748359485a.26.2024.05.20.07.54.51 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 20 May 2024 07:54:51 -0700 (PDT) Message-ID: <3ec26bd3-bfac-4729-9cf4-572830dce1d9@redhat.com> Date: Mon, 20 May 2024 15:54:49 +0100 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: How to set alignment and READONLY of a brand new section To: Massimiliano Cialdi , binutils@sourceware.org References: From: Nick Clifton Autocrypt: addr=nickc@redhat.com; keydata= xsFNBFm/2cUBEADkvRqMWfAryJ52T4J/640Av5cam9ojdFih9MjcX7QWFxIzJfTFYq2z+nb4 omdfZosdCJL2zGcn6C0AxpHNvxR9HMD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FAlm/2cUCGwwACgkQE/zvid2ePE/dqQ/6ApUwgsZz tps0MOdRddjPwz44pWXS5MG45irMQXELGQyxkrafc8lwHeABYstoK8dpopTcJGE3dZGL3JNz 1YWxQ5AV4uyqBn5N8RubcA8NzR6DQP+OGPIwzMketvVC/cbbKDZqf0uTDy3jP65OFhSkTEIy nYv1Mb4JJl3Sq+haUbfWLAV5nboSuHmiZE6Bz2+TjdoVkNwHBfpqxu6MlWka+P98SUcmY8iV hPy9QC1XFOGdFDFf1kYgHW27mFwds35NQhNARgftAVz9FZXruW6tFIIfisjr3rVjD9R8VgL7 l5vMr9ylOFpepnI6+wd2X1566HW7F1Zw1DIrY2NHL7kL5635bHrJY4n7o/n7Elk/Ca/MAqzd IZxz6orfXeImsqZ6ODn4Y47PToS3Tr3bMNN9N6tmOPQZkJGHDBExbhAi/Jp8fpWxMmpVCUl6 c85cOBCR4s8tZsvGYOjR3CvqKrX4bb8GElrhOvAJa6DdmZXc7AyoVMaTvhpq3gJYKmC64oqt 7zwIHwaCxTbP6C6oUp9ENRV7nHnXN3BlvIgCo4QEs6HkDzkmgYlCEOKBiDyVMSkPDZdsspa+ K4GlU2Swi/BDJMjtDxyo+K0M81LXXxOeRfEIfPtZ3ddxBKPva1uSsuz+pbN9d1JY8Ko5T/h1 6susi2ReUyNJEJaSnjO5z13TQ1U= In-Reply-To: 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=-2.8 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL,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 Massimiliano, > I apologize in advance if this is not the right place for this question. No this is the right place. :-) >     .CLI_cmd_section : ALIGN(8) > Though, inspecting with objdump I see that the section is aligned to 32 bytes: >  26 .CLI_cmd_section   00000068  0000000000009020  0000000000009020  00008020  2**5  CONTENTS, ALLOC, LOAD, DATA The ALIGN() directive can only increase an output section's alignment. It does not force a specified alignment. So if an input section has an alignment greater than 8 this will make the output section also be aligned to this larger value. You can however override an input section's alignment by using the SUBALIGN() directive. So this might work: .CLI_cmd_section : ALIGN(8) SUBALIGN(8) (Without an actual testcase I cannot be sure of this. For all I know there may be a linker bug here as well...) > Also I would like this section to be READONLY, but if I try to impose it I get a warning on the link which I don't know how "serious" it is: > > /usr/bin/ld: /tmp/ccDmg9Dd.o: warning: relocation in read-only section `.CLI_cmd.__CLI_cmd_help' > /usr/bin/ld: warning: creating DT_TEXTREL in a PIE It is pretty serious. The linker is telling you that it needs to create a run-time relocation that will affect the contents of a read-only section. Which is bad because it means that the loader will have to remove the read-only protection from that section in order to be able to implement the relocation. You need to investigate and find out what information this relocation is trying to store in the .CLI_cmd_section and then decide if a) the information is not needed and so can be removed from the input or b) the information is needed and so the .CLI_cmd_section should not be marked as READONLY. Cheers Nick