Re: Sharing ELF definitions between NetBSD userspace and kernel

"Joseph Koshy" <[email protected]>
Newsgroups gmane.os.netbsd.devel.kernel,gmane.os.netbsd.devel.userlevel
Message-ID <[email protected]>
On 2025-11-25 22:13 Mouse <[email protected]> wrote:
m> Maybe it's just me being iconoclastic, but:

jk> Goal 1: To wean userland off the use of <sys/exec_elf.h> (a kernel
jk>   header).

m> Why is this desirable?  There are numerous <sys/...> headers which
m> define/describe interfaces between userland and the kernel (which to at
m> least some extent ELF is); a simple example is <sys/socket.h>.

Very little of <sys/exec_elf.h> is actually used by the kernel;
this file currently holds both kernel code (under #ifdef _KERNEL)
and ELF-related definitions for use by userland.

Other systems use one set of files for ELF (e.g. <elf.h>/<sys/elf.h>)
and another for kernel-related symbols, offering better separation of
concerns.

Regards,
Joseph Koshy | [email protected] | https://jkoshy.net/
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.