From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pj1-x102c.google.com (mail-pj1-x102c.google.com [IPv6:2607:f8b0:4864:20::102c]) by sourceware.org (Postfix) with ESMTPS id 231193858D20 for ; Fri, 17 Nov 2023 03:23:45 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 231193858D20 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 231193858D20 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2607:f8b0:4864:20::102c ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1700191426; cv=none; b=XYKpmgVb/Gpv0QAXF+uZi6Ore8/koJOXSckbyk8pQ8hw9lU9lNg5J5n1uOo30eVNQpaR8ZFCdSn4Ap7I4k26ys7LEBuXuqnCIfYtuY0MFYT7hpyNQowSzv1g+KmdPgJ3bukQP5oJ1qRRxP3MXF9EkgStvKA7jx1wSFxFTzgd+7s= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1700191426; c=relaxed/simple; bh=9DZIpsvg/HDE1AETQ8K1f8dTIbmzFUM8ZkyyZiGECBg=; h=DKIM-Signature:Date:Message-ID:From:To:Subject; b=Y+rzdKidXTK1z7ubE5olGIAIrV5FDVKlB2RD8SXJFAQO3XkrWXgiWBTWiFyMVUgFMQjjsmcxZmwUKaacSjFrvt1I98usQh9r19YoZ6EY7KK1k0NKVpimURRYMWYxL4RnY3VWBwEB1KRNTax6RWACSF0WjgCn6a1k5aUaZ8taDRc= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-pj1-x102c.google.com with SMTP id 98e67ed59e1d1-28039ee1587so1201642a91.2 for ; Thu, 16 Nov 2023 19:23:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1700191424; x=1700796224; darn=sourceware.org; h=subject:to:from:message-id:date:from:to:cc:subject:date:message-id :reply-to; bh=9DZIpsvg/HDE1AETQ8K1f8dTIbmzFUM8ZkyyZiGECBg=; b=mShhAc7AehSSo5kXBKwAC5i40J8qvn0yOFIuazwHYALlQs++fYj/qJzm1dCOpJje++ GWvnck7Ak3Cmr1ulLSJfbZ3W5/T0quAAcVmWkI4kgkv0PECY501i+UX/gtI8hknB6nGN Rp7OaVqt3G+M4cWfg5Yd0XnskJF/hEvuV/fwhMWsCmy2ZT6sIAUJVnjwuSBU15cNl77R lajHH2ah+RFH+H4g2BfGu/UeF3FpVZciR+KFgZ2PmwTQbbOQTZnt9JxkaT5cViat8GOY ouEs8yBiwEWqXHpxVj0QvUgvJPLKUhu7hvnMg8rg6lRTvhBV05gkLe+txi3Adtr7Db/L d5Ag== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1700191424; x=1700796224; h=subject:to:from:message-id:date:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=9DZIpsvg/HDE1AETQ8K1f8dTIbmzFUM8ZkyyZiGECBg=; b=C8HXZpD39GnRIwp3XuNmM+mng9ovDV1MlE8zu24awMUFc/R1EUhvZHr2A+Z/COnUjD DmEss4/O6ngoidYSufcaYtDoLmJMHUTs2eFDyLm3BQbi3gime5mYoDCRCmRZh1g77q2q Uziig1ddXnMxtzNuDvokul7clKuu0fXHEJdy/fnMsZjPrXaQbRx8ltsYjApQS1L5IH+a MKk3eJ5aN/O+PTOMcME1dkeCumrcHIC1ds5Jxkpaet64+lsY2t/plPubKxnjHXTPdlda 9UnrNpjuS/B785uMIRqG+pJR/VvIlOuyiopsoHuucT8U23PdvLJXt8T6UX/oeWGOz6T8 XtZg== X-Gm-Message-State: AOJu0YybTeLuPpWHKJ/PTRr/yJge9CyOpUzvBaZqGKOruE053gRS4HGz YpsAVCoQ5YCKz8AMrLh+S9nBq8rO21k= X-Google-Smtp-Source: AGHT+IGZuSoG+xathxlmJZ2n4zyZI8eyjQHu+SHXKyFs7ccIhMhdh087QK85MoeHlTdA4GfZWwSVJw== X-Received: by 2002:a17:90b:1e49:b0:280:2652:d4c with SMTP id pi9-20020a17090b1e4900b0028026520d4cmr18048732pjb.13.1700191423915; Thu, 16 Nov 2023 19:23:43 -0800 (PST) Received: from localhost ([2804:7f0:3990:c9ca:64ee:c181:1da6:e88a]) by smtp.gmail.com with ESMTPSA id d13-20020a17090ad3cd00b00280202c092fsm390656pjw.33.2023.11.16.19.23.42 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 16 Nov 2023 19:23:43 -0800 (PST) Date: Fri, 17 Nov 2023 00:23:43 -0300 Message-ID: <03e9069f821eb383d1391f0a7f8b70f6@gmail.com> From: Matheus Afonso Martins Moreira To: binutils@sourceware.org Subject: Feature request: spare program headers X-Spam-Status: No, score=-1.4 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,TXREP,T_SCC_BODY_TEXT_LINE 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: Hello. I recently emailed this list about appending PHDRs to programs: https://sourceware.org/pipermail/binutils/2023-November/130532.html There turned out to be a simple and effective solution to my problem: the linker appends a number of empty PT_NULL entries to the PHDRs table. This allows post processing tools to overwrite those null headers in any way they want without impacting normal linker operations. The mold linker has already integrated this feature. I'd like to formally request that it be included in GNU ld as well. I have also filed an LLVM lld issue but there was no interest so far. Relevant links: mold https://github.com/rui314/mold/issues/1148 https://github.com/rui314/mold/commit/eb6c213f2a9aa8a101b2b52a791be369d165e6a9