From: Mike Frysinger <vapier-aBrp7R+bbdUdnm+yROfE0A@public.gmane.org>
To: Thomas Klausner <tk-JlXkzPh5ucKzZXS1Dc/lvw@public.gmane.org>
Cc: mtk.manpages-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org,
linux-man-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: Re: bug in dlopen(3) man page
Date: Sun, 09 Mar 2014 19:25:20 -0400 [thread overview]
Message-ID: <15509951.scfVQB3357@vapier> (raw)
In-Reply-To: <20140308213059.GA25275-k3ZVrZPR2RPzPE21tAIdciO7C/xPubJB@public.gmane.org>
[-- Attachment #1: Type: text/plain, Size: 1151 bytes --]
On Sat 08 Mar 2014 22:30:59 Thomas Klausner wrote:
> There is a bug in dlopen(3). The NOTES section claims:
>
> "The symbols RTLD_DEFAULT and RTLD_NEXT are defined by <dlfcn.h> only
> when _GNU_SOURCE was defined before including it."
>
> However, this is not correct.
>
> From dlfcn.h on a "Gentoo Base System release 2.1":
> #ifdef __USE_GNU
> ...
> # define RTLD_NEXT ((void *) -1l)
> ...
> # define RTLD_DEFAULT ((void *) 0)
> ...
>
> You can verify this by compiling the attached program. For me it gives:
> test.c: In function `main':
> test.c:8: error: `RTLD_NEXT' undeclared (first use in this function)
> test.c:8: error: (Each undeclared identifier is reported only once
> test.c:8: error: for each function it appears in.)
>
> It works if I set "__USE_GNU_" instead.
>
> Please also check the "Glibc extensions: dladdr() and dlvsym()"
> section, it also mentions _GNU_SOURCE.
the man page is correct. you must define _GNU_SOURCE before including any
headers. you must never use the __USE_XXX defines directly.
see feature_test_macros(7) for details as the dlopen() man page references.
-mike
[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 836 bytes --]
next prev parent reply other threads:[~2014-03-09 23:25 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-03-08 21:30 bug in dlopen(3) man page Thomas Klausner
[not found] ` <20140308213059.GA25275-k3ZVrZPR2RPzPE21tAIdciO7C/xPubJB@public.gmane.org>
2014-03-09 23:25 ` Mike Frysinger [this message]
2014-03-10 11:53 ` Thomas Klausner
[not found] ` <20140310115304.GS25275-k3ZVrZPR2RPzPE21tAIdciO7C/xPubJB@public.gmane.org>
2014-03-10 12:32 ` Michael Kerrisk (man-pages)
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=15509951.scfVQB3357@vapier \
--to=vapier-abrp7r+bbdudnm+yrofe0a@public.gmane.org \
--cc=linux-man-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=mtk.manpages-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
--cc=tk-JlXkzPh5ucKzZXS1Dc/lvw@public.gmane.org \
/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.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox