From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/5770 Path: news.gmane.org!not-for-mail From: =?UTF-8?q?Cl=C3=A9ment=20Vasseur?= Newsgroups: gmane.linux.lib.musl.general Subject: [PATCH] fix dlerror when using dlopen with a static libc Date: Thu, 7 Aug 2014 17:49:29 +0200 Message-ID: <1407426569-78240-1-git-send-email-clement.vasseur@gmail.com> Reply-To: musl@lists.openwall.com NNTP-Posting-Host: plane.gmane.org X-Trace: ger.gmane.org 1407426594 30468 80.91.229.3 (7 Aug 2014 15:49:54 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 7 Aug 2014 15:49:54 +0000 (UTC) To: musl@lists.openwall.com Original-X-From: musl-return-5775-gllmg-musl=m.gmane.org@lists.openwall.com Thu Aug 07 17:49:47 2014 Return-path: Envelope-to: gllmg-musl@plane.gmane.org Original-Received: from mother.openwall.net ([195.42.179.200]) by plane.gmane.org with smtp (Exim 4.69) (envelope-from ) id 1XFPwl-0005q2-IL for gllmg-musl@plane.gmane.org; Thu, 07 Aug 2014 17:49:43 +0200 Original-Received: (qmail 15699 invoked by uid 550); 7 Aug 2014 15:49:41 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: Original-Received: (qmail 15689 invoked from network); 7 Aug 2014 15:49:41 -0000 X-Mailer: git-send-email 2.0.1 Xref: news.gmane.org gmane.linux.lib.musl.general:5770 Archived-At: when the dynamic loader is disabled, dlopen fails correctly but dlerror did not return a human readable error string like it should have. --- src/ldso/dynlink.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/ldso/dynlink.c b/src/ldso/dynlink.c index 12f14f7..aa1b99a 100644 --- a/src/ldso/dynlink.c +++ b/src/ldso/dynlink.c @@ -1603,6 +1603,8 @@ static int invalid_dso_handle(void *h) } void *dlopen(const char *file, int mode) { + strcpy(errbuf, "Dynamic loading not supported"); + errflag = 1; return 0; } void *__dlsym(void *restrict p, const char *restrict s, void *restrict ra) -- 2.0.1