5

I'm building a compiler and a virtual machine for executing my byte code. The language allows to bind external C functions, which may be defined in some external shared object, as well as the main compiler/VM binary (some essential language built-ins).

I know I can dynamically bind symbols within the main executable with dlopen(NULL, ...), however NOT after I run strip on the binary. I have the following questions then:

  1. Is there a way to do this on a strip'ed binary?
  2. How portable is this feature across UNIX systems in general?
  3. Is it possible to do the same trick on Windows somehow?
  4. Any alternatives ways of binding dynamically within the main executable?
0

1 Answer 1

6
  1. Use strip -d instead to only strip debug symbols.

  2. The dlopen(3) man page says:

    CONFORMING TO
           POSIX.1-2001 describes dlclose(), dlerror(), dlopen(), and dlsym().
    

    So, very portable across *nix.

  3. Windows uses LoadLibrary() and GetProcAddress() instead.

  4. No.

Sign up to request clarification or add additional context in comments.

Your Answer

Draft saved
Draft discarded

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.