RFR: JDK-8274434: move os::get_default_process_handle and os::dll_lookup to os_posix for POSIX platforms
David Holmes
dholmes at openjdk.java.net
Wed Sep 29 04:02:35 UTC 2021
On Tue, 28 Sep 2021 11:13:00 GMT, Matthias Baesken <mbaesken at openjdk.org> wrote:
> Hello, please review this small change.
> The os::get_default_process_handle and os::dll_lookup functions are pretty similar across the POSIX platforms so they can be moved to os_posix.cpp.
Hi Matthias,
The refactoring is fine, but I do wonder (future cleanup ok) if we actually need the macOS special case - see comment below.
Thanks,
David
src/hotspot/os/posix/os_posix.cpp line 646:
> 644: // MacOS X needs to use RTLD_FIRST instead of RTLD_LAZY
> 645: // to avoid finding unexpected symbols on second (or later)
> 646: // loads of a library.
I find this a puzzling comment. RTLD_FIRST is not used instead of RTLD_LAZY it is used with it. RTLD_FIRST simply limits how dlsym will perform a search using the handle that dlopen returns. Second it is trying to protect against something that will happen on other Posix systems anyway, so can't really be a bug. So I have to question whether we really need to special case this code for macOS?
-------------
Marked as reviewed by dholmes (Reviewer).
PR: https://git.openjdk.java.net/jdk/pull/5737
More information about the hotspot-runtime-dev
mailing list