On Wed, 24 Jan 2024 07:30:27 GMT, Thomas Stuefe <stu...@openjdk.org> wrote:

> For me the unresolved question is still:
> 
> * do we want an unconditional load of *.a for a given *.so (have yet to see 
> any documentation for this a-file duality)

Yes. 
The documentation link - 
https://www.ibm.com/docs/en/aix/7.3?topic=memory-shared-objects-run-time-linking
The text  **In dynamic mode, input files specified with the -l flag may end in 
.so, as well as in .a. That is, a reference to -lfoo is satisfied by the first 
libfoo.so or libfoo.a found in any of the directories being searched. Dynamic 
mode is in effect by default unless the -bstatic option is used.**

https://www.ibm.com/docs/en/aix/7.3?topic=l-ld-command

Archive files are composite objects, which usually contain import files and 
object files, including shared objects. If an archive file contains another 
archive file or a member whose type is not recognized, the ld command issues a 
warning and ignores the unrecognized member. If an object file contained in an 
archive file has the F_LOADONLY bit set in the XCOFF header, the ld command 
ignores the member. This bit is usually used to designate old versions of 
shared objects that remain in the archive file to allow existing applications 
to load and run. New applications link with the new version of the shared 
object, that is, another member of the archive.



> * if we do, do we want that to be bidirectional? Someone specifies *.a, do we 
> want to attempt to load *.so?
> 

Considering the different scenarios, loading .a after .so failure should 
suffice. 
I got a chance to look at the right file in  OpenJ9-omr ,which has a native 
code which does an attempt to load archive files after trying to load .so 
files. This code was always there and it explains why the issue did not occur 
in Semeru, which is derived from this repository. 




> When in doubt, we should just mimic what OpenJ9 is doing on AIX. But I would 
> like a clear documentation as a comment in os_aix.cpp explaining the logic 
> and referencing the relevant OpenJ9 files.
> 
Any example comment you can refer ? I mean i just mention the file name in 
OpenJ9 and explain the logic ? 
Let me know for any further clarifications

-------------

PR Comment: https://git.openjdk.org/jdk/pull/16604#issuecomment-1909927553

Reply via email to