|
Message-ID: <CAK4o1WxSLAnGtOv+eVAMP107E0_wxEJ1A82MkDx5soQRvgeN2w@mail.gmail.com> Date: Wed, 27 Aug 2014 18:20:24 +0100 From: Justin Cormack <justin@...cialbusservice.com> To: musl@...ts.openwall.com Subject: Re: static build and dlopen On Wed, Aug 27, 2014 at 6:01 PM, piranna@...il.com <piranna@...il.com> wrote: > The de-facto standard in Node.js is that all the compiled modules are > static ones (.a files) with no external dependencies at all, just to > make it simpler to move to another environments. This contrast to how > Python works, where compiled modules are dynamic ones (.so). I'm > honestly not sure what are the low-level details of Node.js compiled > modules, but the general idea of Node.js modules is make them as > independent as possible and left to Node.js require() function to > manage the dependencies, so probably this would also apply to compiled > ones... Only point left here is if in fact .node files are in fact .a > files with a different extension or if they are wrapped someway, so in > that case dlopen() is efectively loading .a files (that would be a > surprise to me, but would left open the door to solve this problem...) If this is really true, and they are static, then you should be able to write a loader that has a function called dlopen etc but which is not actually the full dynamic linker, just pretends to be, and will work from a static binary. It could link in the modules at compile time and just return static pointers (I have done this with Lua code, pretending to be in a dynamic environment when actually in a static one, just return pointers from dlsym calls that are fixed at compile time). Justin
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.