Thread (1 message) 1 message, 1 author, 2017-08-23

Re: dlopen man page example fails for x86_64 (release 4.12), OK for 32-bit target

From: Mats Wichmann <hidden>
Date: 2017-08-23 14:57:30

Possibly related (same subject, not in this thread)

On 08/23/2017 08:11 AM, Mats Wichmann wrote:
On 08/22/2017 05:11 PM, Michael Kerrisk (man-pages) wrote:
quoted
David,

On 22 August 2017 at 04:53, David C. Rankin
[off-list ref] wrote:
quoted
All,

  The man 3 dlopen example needs updating to run on x86_64. It will run fine
as a 32-bit compile (with -m32), but fails without it, e.g.

$ gcc -Wall -Wextra -pedantic -Wshadow -std=gnu11 -Ofast -ldl -o
bin/dlopen_man_ex dlopen_man_ex.c

$ ./bin/dlopen_man_ex
/usr/lib/libm.so: invalid ELF header
This sounds like you're picking up the linker script, which is not an
ELF file, but rather link-time instructions - you can't dlopen that.  If
the "magic" in /usr/include/gnu is working, you should be getting an
soname line "libc.so.6" plugged in, not "libc.so".
of course, libm rather than libc.  sigh.

--
To unsubscribe from this list: send the line "unsubscribe linux-man" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help