Sam Clegg
Sam Clegg
Maybe DynamicLinking.md is a better place for such a note. I'll add it there if that makes sense?
I agree it might make sense to add something like "function pointers are represented as integer indexes into a linker defined table called `__indirect_function_table`". The Linking.md documents talks about table...
There is no support in the linker yet for merging tables, or even for tables with pre-existing elements. i.e. Object files can define tables, but only empty ones (at least...
Object files can define tables (with size, type, etc), they just can't define element segments for them.
`R_WASM_TABLE_INDEX` is only for the `__indirect_function_table`.. you can think of it as short hand for `R_WASM_INDIRECT_FUNCTION_TABLE_INDEX`.
Hmm.. my understanding is that we already do (1). lld will check that relocation targets and warn if they don't match: https://github.com/llvm/llvm-project/blob/4ac0b9be230596e24e439109f2d23ea3dd81ebfd/lld/wasm/InputChunks.cpp#L47 When llvm generates the object file it patches...
> > The circular nature of imports and exports between shared libraries means that we can't directly import functions from other modules. > > That makes sense in general, but...
Interesting. Sounds like there are some real benefits for your use case. I have a couple of questions: 1. I the primary advantage here only present on wasm64? In which...
> Fantasizing beyond your use case, what would be fun is a SLEB version of this, the idea being that it can make data really small (with offsets possibly fitting...
@sunfishcode @jgravelle-google @NWilson thoughts?