Re: .dlopen.notes section

Paul Eggert <[email protected]> Thu, 16 Jul 2026 16:38:59 -0700
Newsgroups gmane.comp.lib.gnulib.bugs
Organization UCLA Computer Science Department
Message-ID <[email protected]>
On 2026-07-16 15:21, Bruno Haible via Gnulib discussion list wrote:

> If I understand it correctly, this script adds a '.note.dlopen' section,
> in the format documented in
>    https://uapi-group.org/specifications/specs/elf_dlopen_metadata/
> and already implemented in
>    https://github.com/systemd/package-notes

Yes, that looks right. I didn't know about package-notes.

> AFAICS, Luca's preferred way to generate this section is via the
> SD_ELF_NOTE_DLOPEN macro defined in <systemd/sd-dlopen.h>.
> 
> The macro looks reasonable. But why is it in a systemd header??
> ...
> I would view it as a general utility header.
> Should we include a (standalone) copy of it in Gnulib?

Something like that sounds reasonable. Presumably the Gnulib package 
would be LGPLv2.1+ given that sd-dlopen.h includes _sd-common.h which is 
LGPLv2.1+.

I'm not entirely clear on how it'd be used, though. Would we keep 
sd-dlopen.h unchanged, and wrap it inside a Gnulib-named header (one 
with a better name perhaps), where the Gnulib-named header supplies 
no-ops on unsupported platforms? I guess to find that out we could (say) 
use the new module on Coreutils when it configures DLOPEN_LIBCRYPTO. 
Perhaps the new Gnulib module could take over some of the configury that 
coreutuils/configure.ac currently does for dlopen etc., so that other 
apps don't need to repeat that configury.