Kotlin Native Shared Library Exported Function

I’m sure this has already been asked, sorry if I can’t find it. But how do I export a specific top-level function from Kotlin native in my dynamic shared library? I see my normal code is exported under an “exported symbols” pseudo-struct-namespace. I see c-interop code there are interop stubs that take header functions and delegate to “bridge” functions which are marked “private external”. I see the python extension example that uses a C file to bridge.

So, for example, say I wanted to implement/expose JNI_OnLoad, how would I? I see this code generated via interop:

fun JNI_OnLoad(vm: CValuesRef<JavaVMVar>?, reserved: CValuesRef<*>?): jint {
    memScoped {
        return kniBridge3(vm?.getPointer(memScope).rawValue, reserved?.getPointer(memScope).rawValue)
    }
}

Is there some way I can hand edit this? Has anyone ever manually exposed a function from a DLL before?

Issue created: Allow Top-Level Symbol Export in Shared Library · Issue #1220 · JetBrains/kotlin-native · GitHub

For anyone else curious, I updated the issue with what I ended up doing which is basically just passing Longs to the Kotlin side. I placed a PoC at GitHub - cretz/kotlin-native-sample-agent: Sample JVMTI Agent Using Kotlin Native.