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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Mats,

On 23 August 2017 at 16:11, Mats Wichmann <mats@xxxxxxxxxxx> wrote:
> On 08/22/2017 05:11 PM, Michael Kerrisk (man-pages) wrote:
>> David,
>>
>> On 22 August 2017 at 04:53, David C. Rankin
>> <drankinatty@xxxxxxxxxxxxxxxxxx> wrote:
>>> 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".

Yes, that's my guess too. But a fix went into the page about 18 months
back to address that issue, which is why I'm wondering which version
of the page David is looking at.

Cheers,

Michael


-- 
Michael Kerrisk
Linux man-pages maintainer; http://www.kernel.org/doc/man-pages/
Linux/UNIX System Programming Training: http://man7.org/training/
--
To unsubscribe from this list: send the line "unsubscribe linux-man" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Kernel Documentation]     [Netdev]     [Linux Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux