From 891e6547b4fdec10fe4ffa3b1ef5ddb524bcde39 Mon Sep 17 00:00:00 2001 From: Rich Felker Date: Mon, 25 Jan 2016 18:51:33 -0500 Subject: move static-linked stub invalid dso handle checking out of dynlink.c --- src/ldso/dlerror.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'src/ldso/dlerror.c') diff --git a/src/ldso/dlerror.c b/src/ldso/dlerror.c index 588828e9..378f0356 100644 --- a/src/ldso/dlerror.c +++ b/src/ldso/dlerror.c @@ -2,6 +2,7 @@ #include #include #include "pthread_impl.h" +#include "libc.h" char *dlerror() { @@ -50,3 +51,14 @@ void __dl_seterr(const char *fmt, ...) __dl_vseterr(fmt, ap); va_end(ap); } + +__attribute__((__visibility__("hidden"))) +int __dl_invalid_handle(void *); + +static int stub_invalid_handle(void *h) +{ + __dl_seterr("Invalid library handle %p", (void *)h); + return 1; +} + +weak_alias(stub_invalid_handle, __dl_invalid_handle); -- cgit v1.2.1