New: dlopen example with libm.so is incorrect
https://bugzilla.kernel.org/show_bug.cgi?id=108821
Bug ID: 108821
Summary: dlopen example with libm.so is incorrect
Product: Documentation
Version: unspecified
Hardware: All
OS: Linux
Status: NEW
Severity: normal
Priority: P1
Component: man-pages
Assignee: documentation_man-pages-ztI5WcYan/[email protected]
Reporter: [email protected]
Regression: No
This does not work because libm.so can be a linker script:
handle = dlopen("libm.so", RTLD_LAZY);The proper way to do this is to include <gnu/lib-names.h> and use LIBM_SO.
Signature · 6 lines
You are receiving this mail because: You are watching the assignee of the bug. -- To unsubscribe from this list: send the line "unsubscribe linux-man" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
[Bug 108821] dlopen example with libm.so is incorrect
In reply to a message not in the archivehttps://bugzilla.kernel.org/show_bug.cgi?id=108821
Florian Weimer <[email protected]> changed:
What |Removed |Added
----------------------------------------------------------------------------
See Also| |https://sourceware.org/bugz | |illa/show_bug.cgi?id=18915
Signature · 6 lines
You are receiving this mail because: You are watching the assignee of the bug. -- To unsubscribe from this list: send the line "unsubscribe linux-man" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
[Bug 108821] dlopen example with libm.so is incorrect
In reply to a message not in the archivehttps://bugzilla.kernel.org/show_bug.cgi?id=108821
Michael Kerrisk <[email protected]> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |[email protected]
--- Comment #1 from Michael Kerrisk <[email protected]> --- Hi Florian,
I'm reluctant code a glibc dependency into what I would like to be a fairly vanilla dlopen example. What if I used a function from libc itself (e.g., strlen()). Does the same issue exist?
Cheers,
Michael
Signature · 6 lines
You are receiving this mail because: You are watching the assignee of the bug. -- To unsubscribe from this list: send the line "unsubscribe linux-man" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
[Bug 108821] dlopen example with libm.so is incorrect
In reply to a message not in the archivehttps://bugzilla.kernel.org/show_bug.cgi?id=108821
--- Comment #2 from Florian Weimer <[email protected]> --- (In reply to Michael Kerrisk from comment #1)
Quoted 4 lines
Hi Florian,
I'm reluctant code a glibc dependency into what I would like to be a fairly vanilla dlopen example.
Fair point. Although the example might confuse users because even where it works, it typically needs development packages at run time (because the .so link are only installed by them).
Quoted 2 lines
What if I used a function from libc itself (e.g.,
strlen()). Does the same issue exist?
libc.so is a linker script, too. libm.so.6 and libc.so.6 are not, but they are glibc-specific to (some moderately current Solaris versions use libm.so.2 and libc.so.1, for example).
Signature · 6 lines
You are receiving this mail because: You are watching the assignee of the bug. -- To unsubscribe from this list: send the line "unsubscribe linux-man" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
[Bug 108821] dlopen example with libm.so is incorrect
In reply to a message not in the archivehttps://bugzilla.kernel.org/show_bug.cgi?id=108821
--- Comment #3 from Michael Kerrisk <[email protected]> --- So, I'm inclined to close this as WONTFIX. I mean: this example will work for most people on most systems, right? The alternative is to create a bigger example where I build a little library that is then dlopen()-ed. But that seems like a little too much work, and might actually be less easy to understand than the current example.
Do you have a strong objection to WONTFIX, Florian?
Signature · 6 lines
You are receiving this mail because: You are watching the assignee of the bug. -- To unsubscribe from this list: send the line "unsubscribe linux-man" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
[Bug 108821] dlopen example with libm.so is incorrect
In reply to a message not in the archivehttps://bugzilla.kernel.org/show_bug.cgi?id=108821
--- Comment #4 from Florian Weimer <[email protected]> --- (In reply to Michael Kerrisk from comment #3)
Quoted 2 lines
So, I'm inclined to close this as WONTFIX. I mean: this example will work for most people on most systems, right?
With glibc, libm.so is increasingly a linker script on x86_64 due to this change:
<https://sourceware.org/glibc/wiki/libmvec>
This was introduced in glibc 2.22, so few distributions have this change yet.
Signature · 6 lines
You are receiving this mail because: You are watching the assignee of the bug. -- To unsubscribe from this list: send the line "unsubscribe linux-man" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
[Bug 108821] dlopen example with libm.so is incorrect
In reply to a message not in the archivehttps://bugzilla.kernel.org/show_bug.cgi?id=108821
Michael Kerrisk <[email protected]> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |RESOLVED
Resolution|--- |CODE_FIX--- Comment #5 from Michael Kerrisk <[email protected]> --- Thanks for all of the info Florian. So, in the end it seems best to make the change you already suggested :-}. Done!
Signature · 6 lines
You are receiving this mail because: You are watching the assignee of the bug. -- To unsubscribe from this list: send the line "unsubscribe linux-man" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html