mailing list of musl libc
 help / color / mirror / code / Atom feed
From: "Clément Vasseur" <clement.vasseur@gmail.com>
To: musl@lists.openwall.com
Subject: [PATCH] fix dlerror when using dlopen with a static libc
Date: Thu,  7 Aug 2014 17:49:29 +0200	[thread overview]
Message-ID: <1407426569-78240-1-git-send-email-clement.vasseur@gmail.com> (raw)

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



             reply	other threads:[~2014-08-07 15:49 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-08-07 15:49 Clément Vasseur [this message]
2014-08-08  4:55 ` Rich Felker

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1407426569-78240-1-git-send-email-clement.vasseur@gmail.com \
    --to=clement.vasseur@gmail.com \
    --cc=musl@lists.openwall.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/musl/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).