<table border="1" cellspacing="0" cellpadding="8">
    <tr>
        <th>Issue</th>
        <td>
            <a href=https://github.com/llvm/llvm-project/issues/65087>65087</a>
        </td>
    </tr>

    <tr>
        <th>Summary</th>
        <td>
            [LLD] Provide /PASSTHRU/ section rule similar to /DISCARD/
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            new issue
      </td>
    </tr>

    <tr>
      <th>Assignees</th>
      <td>
      </td>
    </tr>

    <tr>
      <th>Reporter</th>
      <td>
          kees
      </td>
    </tr>
</table>

<pre>
    When building the Function-Granular Kernel Address Space Layout Randomization (FGKASLR), there needs to be a way to specify wildcards for input section names that should be passed through with their existing name (not collected into a new section, not discarded, and not seen as orphaned).

Right now, it's only possible to accomplish this be either naming each of these sections in the linker script (and with 64,000 sections, the linker becomes hugely slow, and complicates the kernel build), or by disabling orphan section warnings.

For example:

 /PASSTHRU/ : {
        *(.text.*)
    }

Here is one place where this need was discussed:
https://lore.kernel.org/linux-hardening/202109011815.1C439A6DA9@keescook/

There is an open binutils feature request for this as well:
https://sourceware.org/bugzilla/show_bug.cgi?id=28772
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJx0lM9y2zgMxp-GvmDikSj_00EHNR61O82hk3RnjzuUBEvY0KSWIKO4T78D2UnTnakPtkwI4A8fPtIw0-AQK7X9pLbHlUlx9KF6RuRV6_tL9deIDtpEtic3QBwRmuS6SN7dfQ7GJWsCfMXg0ELd9wGZ4WkyHcKDufgU4dG43p_ph5EUUPrQfP5aPz08Kl0qfS8FA4JD7BmihxbBwGwu8swTdnS6wEy270zoGU4-ALkpRWBcEMCZMzLE0UTg0SfbS4XJMGMPcQw-DSPMFEfZhwLgK3GUPiRPYJyP0HlrsYvYA7nowYDD-W0DQZR3emJBwF4WjOuXRUZ0YBh8mEbjJFauVXZUWX39fqRhjOD8LEkUld4zeGcvMHlmai1Kl6br_HmyxMJILPxIooowCiqabgR_kg4Y37gYyC3DsOSeMQB3gaYoHQnc0vFuo_R9lmXvKTe531Ja7LyIN6YB7QXYXjkl_0rUmbhoi_B8ne_igtvcfID2IrKY1grlVYP3ucwmOHID_6JH42UC5jxZVEX9MQJKN9_qp6fvXx7_VLoBVdSg9p9uwdtH6Vrpwzria1wvz-XPuNofP9b7IqYiURthsuLGefHZorCYDWbDy1CTWOWdZoxxYvmnG6Ub6wOur72vfRhkhVx6vRvFCdKe0o3OdJ6VWZ4f8u06v98UZb071qXaZHKEOu-fpdYHtO_jjc048JOcLXIpkmU4oYkpIAT8NyHHxe0LsGGY0drfULJPocPZBLxBtmn4QdYaiY1-_rtNw7obSBUN9ao46sN-r1d9VfRlUZoVVvmuLIpim23z1Vid2rbtyr1BvcNdlmOb6yIrTmWvTb5pN_sVVTrTRXbQZX7YZptyXW5PenswG9O2He52mdpkeDZk19a-nAVpRcwJq902O-xX1rRoeblttJaDtgSV1nL5hEpy7to0sNpkljjyzyqRol2uqYeHo9oe4VvwL9Tj_63z5sCQLALTmeSCil5eO_7xdF8_HpVuVinY6lcZB4pjatedP8uc7cvbz90U_D_YRaWbBZWVbpZW_gsAAP__sM2zFg">