<!DOCTYPE html><html><head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body>
<p>This is interesting. Yes, dlmopen seems to support loading "in a
namespace" which might achieve what you need.</p>
<p>If that's the case (I suggest perhaps you do some experiments
with C first), then it should be doable for you to create your own
SymbolLookup that is based on dlmopen (you can call dlmopen using
a downcall method handle, and get the library handle that way,
then pass the library handle to "dlsym" to do the lookup).</p>
<p>You can find an implementation of a dlopen-based lookup done
using jextract here:</p>
<p><a class="moz-txt-link-freetext" href="https://github.com/openjdk/jextract/blob/master/samples/dlopen/Dlopen.java">https://github.com/openjdk/jextract/blob/master/samples/dlopen/Dlopen.java</a></p>
<p>It should be relatively simple (I hope) to take that code and
tweak it so that it works on dlmopen.</p>
<p>Maurizio<br>
</p>
<p><br>
</p>
<p><br>
</p>
<div class="moz-cite-prefix">On 05/02/2025 17:20,
<a class="moz-txt-link-abbreviated" href="mailto:roberto.minoletti@trusthub.cloud">roberto.minoletti@trusthub.cloud</a> wrote:<br>
</div>
<blockquote type="cite" cite="mid:!&!AAAAAAAAAAAuAAAAAAAAAExtYa3gpX5HoQdE6pcyVYEBAMO2jhD3dRHOtM0AqgC7tuYAAAAAAA4AABAAAABYYYH4vapDRI90g5imSwWwAQAAAAA=@trusthub.cloud">
<pre><a class="moz-txt-link-freetext" href="https://docs.oracle.com/cd/E88353_01/html/E37843/dlmopen-3c.html" moz-do-not-send="true">https://docs.oracle.com/cd/E88353_01/html/E37843/dlmopen-3c.html</a>
Anyway it seems that Panama can not directly handle dlmopen so the idea
is to relay to JNA to connect to dlmopen first and then use Panama for a
better memory management and performance.
What do you think?</pre>
</blockquote>
</body>
</html>