Questions tagged [dynamic-loading]

Mechanism for a computer program to load a library (or other binary) into memory at runtime. Allows retrieving addresses of functions and variables contained in the library, executing functions, accessing variables, and unloading library from memory.

378 questions
11
votes
3 answers

jQuery getScript() vs document.createElement('script')

Assuming that both of these approaches load the script properly, and that I wait the appropriate amount of time before using the script (and/or use a callback), what are the major differences between these approaches. Note: I understand the first…
bebeastie
  • 205
  • 1
  • 3
  • 11
11
votes
2 answers

OpenGL on Linux: dlopen libGL.so

Most applications (and libraries) using OpenGL on Linux load libGL.so at runtime using dlopen API, instead of dynamically linking against it. Why do they do this? The only reason I can imagine is that it's because any graphic driver vendor provides…
peoro
  • 25,562
  • 20
  • 98
  • 150
11
votes
3 answers

Is it possible to uniquely identify dynamically imported functions by their name?

I used readelf --dyn-sym my_elf_binary | grep FUNC | grep UND to display the dynamically imported functions of my_elf_binary, from the dynamic symbol table in the .dynsym section to be precise. Example output would be: [...] 3: 00000000 0…
langlauf.io
  • 3,009
  • 2
  • 28
  • 45
11
votes
2 answers

ghc 7.4.2, Dynamically calling modules

I am trying to load and execute module dynamically, Below is my code TestModule.hs module TestModule where evaluate = "Hello !!!" Invoke.hs module Invoke where import GHC import DynFlags import GHC.Paths (libdir) import…
Xinus
  • 29,617
  • 32
  • 119
  • 165
9
votes
1 answer

Dynamic Loading Without extern "C"

I'd like to use libdl to dynamically load C++ in general. The problem is identifying symbols at runtime that have been name mangled. As described here, one solution is to remove name mangling by using extern…
Praxeolitic
  • 22,455
  • 16
  • 75
  • 126
8
votes
1 answer

Typescript dynamic module loading at runtime

I have defined an abstract BaseClass in a NodeJS Typescript project and I have a list of derived classes that implement and extend this BaseClass. // baseModule.ts export abstract class BaseClass { constructor() {} abstract method():…
Michael Sutherland
  • 527
  • 1
  • 5
  • 14
8
votes
1 answer

How does JIT compilation in Java load dynamically compiled instructions into memory?

In Java, JVMs (e.g. HotSpot) are capable of JIT compilation and this technique is used to speed up execution by compiling bytecode into native code. My question is, how does this technically happen? My understanding was that modern processors mark…
rationalrevolt
  • 663
  • 1
  • 6
  • 13
7
votes
1 answer

Getting undefined symbol error while dynamic loading of shared library

I am getting undefined symbol error while loading library dynamically. Here is my code snippet that generates this error : int main () { void *lib_handle = NULL; MyClass* (*create)(); void (*destroy)(MyClass*); char *error; …
Yuvi
  • 1,344
  • 4
  • 24
  • 46
7
votes
1 answer

How to handle "panic: the impossible happened" and continue in Haskell

I have the following code that uses the GHC API to load modules and get the type of an expression: typeObjects :: [String] -> [String] -> IO [Type] typeObjects modules objects = do defaultErrorHandler defaultDynFlags $ do runGhc (Just libdir)…
mentics
  • 6,852
  • 5
  • 39
  • 93
7
votes
3 answers

How to dynamically load a C# dll from a C++ DLL

I have a C++ application. This supports users' C++ plugin DLL's, it will dynamically load these DLL's and then be able to create and use the user's types dynamically. These user types derive from base types and interfaces defined in the main…
AlwaysTraining
  • 2,039
  • 18
  • 12
7
votes
0 answers

Pickle a dynamically imported class

I have a bunch of objects created from classes imported with module = imp.load_source(packageName, packagePath) that I need to pickle. It all works perfectly, as long as packagePath is directly in the Python path or the working dir. But as soon as…
7
votes
0 answers

Dynamic code loading w/ Haskell

I've been playing around with the plugins package. I want a host application to dynamically compile and load Haskell source files in a sandboxed environment. Compilation works just fine. Loading fails as soon as the plugin references modules…
W. Davis
  • 71
  • 3
6
votes
1 answer

load time relocation and virtual memory

I am wondering what load-time relocation actually means on a system with virtual memory support.I was thinking that in a system with virtual memory every executable will have addresses starting from zero and at run-time the addresses will be…
vjain27
  • 3,514
  • 9
  • 41
  • 60
6
votes
1 answer

When to actually use dlopen()? Does dlopen() means dynamic loading?

I have gone through below link, through which I understood how to create and use shared library. https://www.cprogramming.com/tutorial/shared-libraries-linux-gcc.html Step 1: Compiling with Position Independent Code $ gcc -c -Wall -Werror -fpic…
dev
  • 649
  • 9
  • 11
6
votes
3 answers

Implementing Plugin Architecture - Dynamic DLL loading

I've an application which is basically a designer with preloaded controls where you can design your pages using the controls. I'm planning to release more and more controls in the future. I don't want to release a new build for newly added controls…
NLV
  • 21,141
  • 40
  • 118
  • 183
1
2
3
25 26