Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Date: Thu, 23 Apr 2020 02:25:31 +0300
From: Paul Sokolovsky <>
Subject: foreign-dlopen: dlopen() from static binary, again (and not the way
 you think!)


Just as many (well, few) people I was surprised by the inability to
dlopen() from a static binary
( , etc.). I started to
hack into musl's dynamic linker, just to find it a bit ... tangled.
That of course was nothing compared to taking a standalone ELF loader
and trying to deal with glibc's dynamic loader, that was total mess
(just look at, which tried to
do that; tried, because it doesn't work with recent glibc versions,
and need constant patching).

Oh, forgot to say that I'm not looking for a way to load a
particular musl-dynlinked shared library into musl-staticlinked binary.
So, arguments like "but you'll need to carry around musl's"
don't apply. What I'm looking for is a way to have a static closed-world
application, but let it, at the user's request, to interface with
whatever system may be outside.

So, seeing what a mess is doing "honest" dynamic loading for real
world, and given my usecase, which is about wanting to touch that mess
as little as possible with bare hands, I came to a cute blackbox'ish
solution to an issue. The rest of the story and proof of concept code
is at .

(Sorry for somewhat tangled message, I made that proof of concept a
month ago and it was justing sitting in my github account, so posting
mostly for search engines' use, to help people who may come up to
similar needs, whenever that may happen.)

Best regards,

Powered by blists - more mailing lists

Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.