On Fri, 15 Dec 2023 10:18:53 GMT, Joachim Kern <[email protected]> wrote:
>> src/hotspot/os/aix/os_aix.cpp line 206:
>>
>>> 204: constexpr int max_handletable = 1024;
>>> 205: static int g_handletable_used = 0;
>>> 206: static struct handletableentry g_handletable[max_handletable] = {{0,
>>> 0, 0, 0}};
>>
>> I would move all that new and clearly delineated dlopen stuff into an own
>> file, e.g. dlopen_aix.cpp or porting_aix.cpp (in porting_aix.cpp, we already
>> have wrappers for other functions). os_aix.cpp is already massive.
>
> I moved the static variable declarations and the functions `Aix_dlopen(),
> search_file_in_LIBPATH(), rtv_linkedin_libpath()` and `os::pd_dll_unload()`
> to porting_aix.cpp. This links, but in my opinion `os::pd_dll_unload()`
> should reside in os_aix.cpp, because it is member of the os class. But there
> it will not compile anymore if the static variables are moved away.
No, what I meant was to provide a "libc-like" equivalent for dlopen, similar to
what we do with dladdr (see
https://github.com/openjdk/jdk/blob/b7676822886eac21f61ff361a32928a966d8fe31/src/hotspot/os/aix/porting_aix.cpp#L306).
But never mind; I am also fine with moving os::pd_dlopen into a different cpp
file, e.g. "dlopen_aix.cpp". Just move it out of os_aix.cpp, since that is
already massive and you add >300 lines of more code and more dependencies.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/16920#discussion_r1427812795