The libima library initialization routines, so_init() and InitLibrary(), are not thread-safe functions. Therefore, the initialization routines are not called correctly for MT-safe interfaces.
Workaround: Do not use the lazyload parameter to link to libima. For example, do not compile the code by using the lazyload parameter.
cc example.c -mt -z lazyload -lima
Instead, use the following command to compile the code:
cc example.c -mt -z nolazyload -lima -z lazyload