util: Add dlfcn helpers
Heavily based on systemd: add similar (but simplified) functions to
dlopen() a library and load specific symbols from it. This will be
useful to allow to load the compression libraries as needed. A few
differences from the systemd implementation:
1) It's allowed to link directly to the library and hence bypass the
dlopen() + dlsym()
2) The only entrypoint is dlsym_many() which is already declared with
the sentinel: it's expected callers will use an x-macro that doesn't
allow forgetting the sentinel
3) No support yet for ELF info annotation yet
Signed-off-by: Lucas De Marchi <lucas.de.marchi@gmail.com>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
Link: https://github.com/kmod-project/kmod/pull/262