Skip to content

[LLD] Provide /PASSTHRU/ section rule similar to /DISCARD/ #65087

@kees

Description

@kees

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions