0

I have a binary which has a library dynamically linked to it, the binary isn't starting because the library is required to be loaded at the start of the binary. The library is listed under ldd command output for the binary too.

ldd app
libabc.so => not found

Is it possible to have the library lazy loaded which will not require the binary to resolve the library before starting?

Note: AIX has a flag -blazy which specifies the library to be lazy loaded and binary is able to start without resolving the library.

Abinash Kumar
  • 331
  • 1
  • 2
  • 15
  • What is the reason the library isn't found? Have it been installed in a non-standard location? Did you forget to link with the `-rpath` option to specify that non-standard location? – Some programmer dude Nov 14 '22 at 06:58
  • And even with lazy loading, if the library is used in your application then it must be loaded sooner or later, which means it still needs to be found. – Some programmer dude Nov 14 '22 at 06:59
  • I don't think the usual GNU(-compatible) tools on Linux have such a feature. – user17732522 Nov 14 '22 at 07:10
  • 3
    If your linker (OS?) doesn't have an option for lazy loading, and you don't want the libraries implicitly loaded during program startup, then have your program explicitly load them (e.g. code using `dlopen()`). This will typically have an effect that the library is not listed by ldd (but it is possible to use ltrace to find usage of `dlopen()` and its arguments, if you need to work out what libraries your program uses). – Peter Nov 14 '22 at 07:11

0 Answers0