Storing manual pages and other data in executables Lassi Kortela 14 Oct 2019 11:56 UTC

> I'm ambivalent.
> In this multilingual era, having manpages (in dozens of languages) within
> executable seems too much.
> I definitely prefer having basic instructions within the executable; and
> also if it can point to a canonical URI
> of documentation, it's not too much to seamlessly fetch the document from
> there.  So it's not so much about
> begin in one binary, but having consistent and robust link between related
> resources.

ELF files have support for sections that are not loaded into the runtime
program image by the kernel. NetBSD and OpenBSD have some kind of .ident
section like that (<https://www.netbsd.org/docs/kernel/elf-notes.html>).
DWARF debug symbols are probably in non-loaded sections. The resources
inside Windows .exe files are similar.

If the data is only loaded to RAM on demand, it doesn't really matter
how much there is (if you put the same data in different files, it'll
take the same amount of space - or a bit more due to extra directory
entries and block allocation in the file system). Of course it's still
useful to be able to build lean versions of the executable, and it's
arguably more flexible to keep the files separate (though they are
usually installed into /usr directories as non-writable files, so there
is not much need to edit the already-installed files in practice).