one of these days I really should get started on trying to convince the glibc folks to add a dlopen-from-memory feature, so that maybe we finally get that feature sometime this decade 😅
@ariadne perhaps I am way too deep in the trenches to lack perspective on the impact this would have. what am I probably missing?
(1) if it is already in memory, then just mprotect(PROT_EXEC) it, why create potential for a weird machine when we don't need to?
(2) a better interface would be dlopen-from-FD, which could be used with a memfd in your specific usecase
@ariadne @MissingClara so you mean bsd's fdlopen which, ngl, does sound more useful (and you could implement a memdlopen as a wrapper if you wanted, as you pointed out)
@MissingClara You can already use memfd_create
and refer to it as /proc/self/fd/...