On Tue, 24 Mar 2026 13:46:27 GMT, Matthias Baesken <[email protected]> wrote:
>> Currently we have multiple dladdr - implementations on AIX in the codebase.
>> One of those is in hotspot, one in libawt.
>> We should unify those if possible.
>
> Matthias Baesken has updated the pull request incrementally with one
> additional commit since the last revision:
>
> Move JVM_dladdr to jvm_md.h
I think not making it JVM_LEAF is okay for a simple wrapper. I have a few other
suggestions and potential simplifications. Thanks
src/hotspot/os/aix/porting_aix.cpp line 429:
> 427: }
> 428:
> 429: int JVM_dladdr(void *addr, Dl_info *info) {
Suggestion:
int JVM_dladdr(void* addr, Dl_info* info) {
src/hotspot/os/posix/include/jvm_md.h line 66:
> 64:
> 65: #if defined(AIX)
> 66: #include "jni_md.h"
The current header file is only included in `jvm.h` which first includes
`jni.h` so I think we can rely on that and avoid the need to include `jni_md.h`
directly.
src/hotspot/os/posix/include/jvm_md.h line 67:
> 65: #if defined(AIX)
> 66: #include "jni_md.h"
> 67: #include "dl_info.h"
Can't we do a simple forward declaration for struct Dl_info and get rid of this
header file?
src/hotspot/os/posix/include/jvm_md.h line 71:
> 69: #ifdef __cplusplus
> 70: extern "C"
> 71: #endif
This should be paired with a trailing:
#ifdef __cplusplus
} /* extern "C" */
#endif /* __cplusplus */
src/hotspot/os/posix/include/jvm_md.h line 72:
> 70: extern "C"
> 71: #endif
> 72: JNIEXPORT int JVM_dladdr(void *addr, Dl_info *info);
Suggestion:
JNIEXPORT int JVM_dladdr(void* addr, Dl_info* info);
-------------
Changes requested by dholmes (Reviewer).
PR Review: https://git.openjdk.org/jdk/pull/30295#pullrequestreview-4003706985
PR Review Comment: https://git.openjdk.org/jdk/pull/30295#discussion_r2985538138
PR Review Comment: https://git.openjdk.org/jdk/pull/30295#discussion_r2985547869
PR Review Comment: https://git.openjdk.org/jdk/pull/30295#discussion_r2985542591
PR Review Comment: https://git.openjdk.org/jdk/pull/30295#discussion_r2985551417
PR Review Comment: https://git.openjdk.org/jdk/pull/30295#discussion_r2985553534