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
Fri Oct 1 12:14:27 UTC 2021

On Fri, 1 Oct 2021 11:53:59 GMT, Lutz Schmidt <lucy at openjdk.org> wrote:

> OK, it's not that simple to explain. Let me therefore start with the simple statement I got from the knowledgeable contact: _**The PR is correct. All necessary information can be found in the man page.**_
> So I read the man pages (MacOS and Linux). RTLD_FIRST does only exist on MacOS. It's purpose is to limit symbol search by dlsym(). Symbols in the image are only resolved if dlsym() is called with the image's handle. If the handle was returned by a dlopen(NULL, RTLD_FIRST) call, only the main executable will be searched by dlsym() calls using that handle.
> The above behaviour has to be combined with distinct defaults for RTLD_GLOBAL (default on MacOS) and RTLD_LOCAL (default n Linux).
> In effect, what we get in both cases is a handle which is tagged such that only the associated image is searched by dlsym() calls.
> I hope that helps a bit. I will approve the pull request now.

Hi Lutz, thanks for the explanation. So I think we keep the PR as-is and preserve the macOS specific handling.

Best regards, Matthias


PR: https://git.openjdk.java.net/jdk/pull/5737

More information about the hotspot-runtime-dev mailing list