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 BFB903858C42 for ; Fri, 26 Apr 2024 09:59:05 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org BFB903858C42 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 BFB903858C42 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=170.10.129.124 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1714125547; cv=none; b=XVt5RVjx+gEz4akvDsa+SKouRshFfw471qYVlDWsuFI3i5IH3SzsZNFMfNS8dTgSI0mtU7i2FTQCBw++3ClnvfsUtRwnElpQrmUE/iB27hNv7DjhVt/+tw+v+6FYqkFLDSDYOTDfXVcAlpzYeXc6NUTjoBzfbxjIW/KiFwpKBgo= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1714125547; c=relaxed/simple; bh=vdWGjMNvXz/fxCdBOrvQCpHR3Fcr6iJ+U0JQM8cDAk8=; h=DKIM-Signature:Message-ID:Date:MIME-Version:Subject:To:From; b=kK4qHGXP5gi9nQU0lVrP8g2dO1c261+DOkBuPROnoUS4Wx37w9lKy6sPeNpphMaz10WPBYWP8VLGHIQL94Jy/LW9U1jnNZia/PUpwHAIGHhe+K0+k29TNl+Ty6v3qrBqeyNt0iVpqNHi2NnCDC6XMZntJ3JBLgKdI3CkCWh0vdY= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1714125545; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc: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=JyCmpmX50hcikOcoVNluhv2MdEZ0xWx5Rlh7ZmorJK8=; b=L82N/v9beqQQNPJVrkTk/EnYWBLqZbtUdnFEksK83sjk6oWy4cOgRvv64gNUN8FZMu61wj 5iW3qW6alL3mI+7qk1HiFXsHwc3ojJz7AkbQ/YAwPY2TtWN4G2TrpJiQY8GKy993R56r/u e8Sygsf9yKM87V0cpbi6bTAYaJ9lUdo= Received: from mail-qv1-f71.google.com (mail-qv1-f71.google.com [209.85.219.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-281-Tx668P2ePLKnXbf9MqAoRw-1; Fri, 26 Apr 2024 05:59:03 -0400 X-MC-Unique: Tx668P2ePLKnXbf9MqAoRw-1 Received: by mail-qv1-f71.google.com with SMTP id 6a1803df08f44-6a049c7d190so23177416d6.0 for ; Fri, 26 Apr 2024 02:59:03 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714125543; x=1714730343; h=content-transfer-encoding:in-reply-to:autocrypt:from :content-language:references:cc:to:subject:user-agent:mime-version :date:message-id:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=JyCmpmX50hcikOcoVNluhv2MdEZ0xWx5Rlh7ZmorJK8=; b=s+M8UIeR3ptd77LWjC4i44xUkWKtfoALrbgr7XgF7c+HS2lxToy12R7w583oHZpkaD Is4J3Dr/Z4vbZwWZTCCWWLv90qwCcnD89o/4iHs4hnO4f2pvebnn+XlFFtjYOA3ULh97 9kyxuSOU/paawvkFe/VrLPkA1V2X5x7V6ZRO/AsZue/45KEd/Riiz7KitLs+iSXx5Ycg aW4KbR+tUWzLpW0xmprho0qDf/K704s73dKRztPVxf29rnOp31xfNkAEW6G2k96412h1 BCSWi1mVTNwGBuDvnw7BEIB/S6VkBod+FO194iIvA8zSTvrat+/SNqrEZXL4CdYVPOkS 2u6Q== X-Forwarded-Encrypted: i=1; AJvYcCXsSiE9DBVLWg+40KMIYoOQJEPQIHeKZrhnA/qzO3rT1Awl25kyBtU4LK3TpIe4zeQFzdMK+2tpxyKf3evqMO823H8+E3xrhg== X-Gm-Message-State: AOJu0YwShe+IF+0RTXk/MW2DxbWVlPM+0pmcwFldY0ON1h5F3YlntY6/ PSzl7a0eEc0w/P1ZVTm4Cfxz3YsOvWp1HtkqatEwQJzybZ6NpMYXVoeWufnF+F7/S4E23kerERh nvKp1D/EUGy3R734+shfReLnRsaVVgJxe1RfF1iHjBAvcmWfHUkHrrZI= X-Received: by 2002:a05:6214:20eb:b0:6a0:5ab0:3dd1 with SMTP id 11-20020a05621420eb00b006a05ab03dd1mr2209206qvk.43.1714125543194; Fri, 26 Apr 2024 02:59:03 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEwTzkexjWHnsmbPCpfqztsWwHH+XwmZMCJ+85Ib8Ou3lFaZASpCs25JVRylq4L3QLQz/RGVw== X-Received: by 2002:a05:6214:20eb:b0:6a0:5ab0:3dd1 with SMTP id 11-20020a05621420eb00b006a05ab03dd1mr2209198qvk.43.1714125542891; Fri, 26 Apr 2024 02:59:02 -0700 (PDT) Received: from [192.168.1.18] ([79.123.79.31]) by smtp.gmail.com with ESMTPSA id m11-20020a0cac4b000000b006a0503a5217sm3054966qvb.108.2024.04.26.02.59.01 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 26 Apr 2024 02:59:02 -0700 (PDT) Message-ID: Date: Fri, 26 Apr 2024 10:59:00 +0100 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: RFC: ld: Add --text-section-ordering-file (version 2) To: Alan Modra Cc: hjl.tools@gmail.com, binutils@sourceware.org, siddhesh@redhat.com References: <87edat7g1e.fsf@redhat.com> From: Nick Clifton Autocrypt: addr=nickc@redhat.com; keydata= xsFNBFm/2cUBEADkvRqMWfAryJ52T4J/640Av5cam9ojdFih9MjcX7QWFx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v4/ImcXR43D4WVxxBE AjKag02b+1yfABEBAAHCwV8EGAECAAkFAlm/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: 7bit X-Spam-Status: No, score=-2.6 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,RCVD_IN_SORBS_WEB,SPF_HELO_NONE,SPF_NONE,TXREP autolearn=no 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 Alan, > This seems really clunky to me. How about a script that augments > the default script, but looks very similar to other scripts, ie. with > a SECTIONS clause? To take your example, use a script like: > > SECTIONS > { > .text : { > *(.text.hot) > *(.text.cold) > *(.text.warm) > *(.text.foo*) > } > .data : { > *(.data.big) > *(.bar) > } > } > > Then arrange to insert the contents of each output section statement > in this script at the start of corresponding output section statement > in the default script. Well I had several reasons: 1. I wanted the feature to be compatible with the gold linker, which just uses the plain section name format, not the linker script format. 2. I wanted users who are not familiar with linker scripts to be able to use the feature. In particular I am hoping that package maintainers that profile their programs can use this feature to experiment with different section orderings without having to learn how to create their own scripts. 3. I want the linker script to be able to define where, within an output section, the ordering should take place. That way, if there are things that must appear at the start of the section, before any ordering, the script can make sure that this happens. eg: .init : { LONG (0) INCLUDE section-ordering-file (*.init) LONG (0) } I just made that example up, but I am sure that you get the idea. The other thing is practicality. With the current method the contents of the section ordering file can be parsed as they appear during the normal linker script processing. If on the other hand the ordering file was to be processed first and then parts of it inserted ad hoc into the output section statements, that would require a lot more hacking on the parser. It could be done, but I like keeping things simple. Cheers Nick