RFR: JDK-8274434: move os::get_default_process_handle and os::dll_lookup to os_posix for POSIX platforms
Matthias Baesken
mbaesken at openjdk.java.net
Wed Sep 29 07:20:31 UTC 2021
On Wed, 29 Sep 2021 03:58:11 GMT, David Holmes <dholmes 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.
>
> 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?
hi David, thanks for your comment and questions. Maybe some Mac expert could comment why the special handling was needed ? Indeed it would be good to remove the special handling and have the same code on all Posix platforms.
Best regards, Matthias
-------------
PR: https://git.openjdk.java.net/jdk/pull/5737
More information about the hotspot-runtime-dev
mailing list