remove redundant code in do_dlsym function
authorRich Felker <dalias@aerifal.cx>
Tue, 21 Apr 2015 17:07:06 +0000 (13:07 -0400)
committerRich Felker <dalias@aerifal.cx>
Tue, 21 Apr 2015 17:07:06 +0000 (13:07 -0400)
commit 637dd2d383cc1f63bf02a732f03786857b22c7bd introduced the checks
for RTLD_DEFAULT and RTLD_NEXT here, claiming they fixed a regression,
but the above conditional block clearly already covered these cases,
and removing the checks produces no difference in the generated code.

src/ldso/dynlink.c

index 62bfed8e1109615235579f2168d6c803278b65a5..efb0049667365a4a7fe9ed3874d980cf84c27e7f 100644 (file)
@@ -1500,7 +1500,7 @@ static void *do_dlsym(struct dso *p, const char *s, void *ra)
                        return __tls_get_addr((size_t []){def.dso->tls_id, def.sym->st_value});
                return def.dso->base + def.sym->st_value;
        }
-       if (p != RTLD_DEFAULT && p != RTLD_NEXT && invalid_dso_handle(p))
+       if (invalid_dso_handle(p))
                return 0;
        if (p->ghashtab) {
                gh = gnu_hash(s);