You want to use RTLD_NOW
when:
- you want to be notified that the library you
dlopen
ed has no unresolved symbols at load time, rather than at arbitrary later time - you want to pay the price (CPU, possible delays) of symbol resolution at load time, rather than at arbitrary later time
You want to use RTLD_LAZY
when
- you know that the library does have unresolvable symbols, but you are not using that part of the library
- generally, if you only use a few symbols from the library, and the library itself has a lot of symbols that would need resolution, but you aren't using most of them
- when failure to resolve a symbol after loading and resulting process termination is "ok".