Currently each of our three dlsym() instances behaves differently. From
seg-faulting, to abort() to assert(). Just use abort throughout, since
assert() is no-op when NDEBUG is defined.
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Link: https://github.com/kmod-project/kmod/pull/355
Signed-off-by: Lucas De Marchi <lucas.de.marchi@gmail.com>
void *fp;
fp = dlsym(RTLD_NEXT, f);
- assert(fp);
+ if (fp == NULL) {
+ fprintf(stderr, "FIXME FIXME FIXME: could not load %s symbol: %s\n", f,
+ dlerror());
+ abort();
+ }
return fp;
}
int err;
size_t sz;
- if (nextlib_uname == NULL)
+ if (nextlib_uname == NULL) {
nextlib_uname = dlsym(RTLD_NEXT, "uname");
+ if (nextlib_uname == NULL) {
+ fprintf(stderr,
+ "FIXME FIXME FIXME: could not load uname symbol: %s\n",
+ dlerror());
+ abort();
+ }
+ }
err = nextlib_uname(u);
if (err < 0)