Skip to content

Is it possible to access un-exported data #401

@joesonw

Description

@joesonw

Summary

I've compiled following code using tinygo

//go:wasmimport env call
func _call(ptr uint32)

//go:noinline
func call(f func()) {
	ptr := unsafe.Pointer(&f)
	_call(uint32(uintptr(ptr)))
}

and the resulted wasm will call my host function with value a pointer to a memory with two u32: 0 (receiver), 1 (index of function in the table), and the table is as following.

image

And the generated wasm does not export this table, is there any way I can access this function $main.main$1

Additional details

I've got it working with wazero, they exposed a function to retrieve unexported function defined in tables.

I am wondering if it's archievable in wasmer.

Metadata

Metadata

Assignees

No one assigned

    Labels

    ❓ questionFurther information is requested

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions