[RFC PATCH 9/9] fs/binfmt_elf_fdpic: Reflect that PIE binaries also work in KConfig help

Daniel Palmer posted 9 patches 1 week, 1 day ago
There is a newer version of this series
[RFC PATCH 9/9] fs/binfmt_elf_fdpic: Reflect that PIE binaries also work in KConfig help
Posted by Daniel Palmer 1 week, 1 day ago
Since commit 1bde925d2354 ("fs/binfmt_elf_fdpic.c: provide NOMMU loader for regular ELF binaries")
it has been possible to load some normal ELF binaries on nommu but it
wasn't documented in the help.

Since nolibc can generate static-pie binaries that work with this loader
document that normal ELFs can work as long as they are PIE and you have
a linker and that nolibc can also generate static-PIE binaries that
can load without any assitance.

Signed-off-by: Daniel Palmer <daniel@thingy.jp>
---
 fs/Kconfig.binfmt | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/fs/Kconfig.binfmt b/fs/Kconfig.binfmt
index 1949e25c7741..71573bfd32ac 100644
--- a/fs/Kconfig.binfmt
+++ b/fs/Kconfig.binfmt
@@ -69,6 +69,16 @@ config BINFMT_ELF_FDPIC
 
 	  It is also possible to run FDPIC ELF binaries on MMU linux also.
 
+	  On nommu systems this can also load normal ELF binaries as long as
+	  the binary is linked as PIE. If the binary is not static PIE, does not
+	  include it's own relocation code, this requires a linker like uldso to
+	  be present and set as the interpreter.
+
+	  nolibc included in the kernel source can create static-PIE binaries
+	  by including relocation code and the resulting binaries run on MMU
+	  systems with the normal ELF loader and on nommu systems with this
+	  loader.
+
 config ELFCORE
 	bool
 	help
-- 
2.51.0
Re: [RFC PATCH 9/9] fs/binfmt_elf_fdpic: Reflect that PIE binaries also work in KConfig help
Posted by Thomas Weißschuh 1 week ago
On 2026-01-31 16:44:40+0900, Daniel Palmer wrote:
> Since commit 1bde925d2354 ("fs/binfmt_elf_fdpic.c: provide NOMMU loader for regular ELF binaries")
> it has been possible to load some normal ELF binaries on nommu but it
> wasn't documented in the help.
> 
> Since nolibc can generate static-pie binaries that work with this loader
> document that normal ELFs can work as long as they are PIE and you have
> a linker and that nolibc can also generate static-PIE binaries that
> can load without any assitance.
> 
> Signed-off-by: Daniel Palmer <daniel@thingy.jp>
> ---
>  fs/Kconfig.binfmt | 10 ++++++++++
>  1 file changed, 10 insertions(+)
> 
> diff --git a/fs/Kconfig.binfmt b/fs/Kconfig.binfmt
> index 1949e25c7741..71573bfd32ac 100644
> --- a/fs/Kconfig.binfmt
> +++ b/fs/Kconfig.binfmt
> @@ -69,6 +69,16 @@ config BINFMT_ELF_FDPIC
>  
>  	  It is also possible to run FDPIC ELF binaries on MMU linux also.
>  
> +	  On nommu systems this can also load normal ELF binaries as long as
> +	  the binary is linked as PIE. If the binary is not static PIE, does not
> +	  include it's own relocation code, this requires a linker like uldso to
> +	  be present and set as the interpreter.

Something like this can be split out of this series and submitted standalone.

> +
> +	  nolibc included in the kernel source can create static-PIE binaries
> +	  by including relocation code and the resulting binaries run on MMU
> +	  systems with the normal ELF loader and on nommu systems with this
> +	  loader.

I don't think this paragraph should be here.
Maybe we can add the information to the nolibc documentation instead.

> +
>  config ELFCORE
>  	bool
>  	help
> -- 
> 2.51.0
>