When building relocatable code lookup function addresses dynamically via fp$foo functions#259
When building relocatable code lookup function addresses dynamically via fp$foo functions#259
fp$foo functions#259Conversation
| } | ||
| Out << "],"; | ||
|
|
||
| Out << "\"externFunctions\": ["; |
There was a problem hiding this comment.
isn't externs enough for the purpose here - idn't externFunctions duplicating part of it?
There was a problem hiding this comment.
externs is for external global data and we want to be able to handle the corresponding g$ and fp$ helpers separately.
There was a problem hiding this comment.
Can't emscripten.py tell which of the externs are functions and which are globals? Then it could create the helpers there? Or is this just easier to do here?
There was a problem hiding this comment.
No. IIUC emscripten.py gets all the info it has from the metadata so we need to encode this somehow.
There was a problem hiding this comment.
I could instead list them in the declares sections with the fp$ prefix so we would know which decleres we of this type.
There was a problem hiding this comment.
Sounds good either way - you know this code the best at this point.
eb38dd4 to
a4dce6f
Compare
There is upstream fastcomp change coming which addresses function pointer equality between wasm modules (i.e. SIDE_MODULE/MAIN_MODULE): emscripten-core/emscripten-fastcomp#259 This change prepares for that change by handling the new externFunctions metadata attribute. This new key represents a list of all non-static functions in a relocatable module which are address taken. The module will call fp$<name>() in order to find out the runtime address (table entry) for such functions. Once both these changes land they they will fix #8268.
a4dce6f to
1a34ed0
Compare
There is upstream fastcomp change coming which addresses function pointer equality between wasm modules (i.e. SIDE_MODULE/MAIN_MODULE): emscripten-core/emscripten-fastcomp#259 This change prepares for that change by handling the new externFunctions metadata attribute. This new key represents a list of all non-static functions in a relocatable module which are address taken. The module will call fp$<name>() in order to find out the runtime address (table entry) for such functions. Once both these changes land they they will fix #8268.
There is upstream fastcomp change coming which addresses function pointer equality between wasm modules (i.e. SIDE_MODULE/MAIN_MODULE): emscripten-core/emscripten-fastcomp#259 This change prepares for that change by handling the new externFunctions metadata attribute. This new key represents a list of all non-static functions in a relocatable module which are address taken. The module will call fp$<name>() in order to find out the runtime address (table entry) for such functions. Once both these changes land they they will fix #8268.
) There is upstream fastcomp change coming which addresses function pointer equality between wasm modules (i.e. SIDE_MODULE/MAIN_MODULE): emscripten-core/emscripten-fastcomp#259 This change prepares for that change by handling the new externFunctions metadata attribute. This new key represents a list of all non-static functions in a relocatable module which are address taken. The module will call fp$<name>() in order to find out the runtime address (table entry) for such functions. Once both these changes land they they will fix #8268.
…via `fp$foo` functions This means that the dynamic linker then assigned function pointers and both main module and side module use `fp$foo` accessors to lookup function addresses, just like they do for global addresses. This allows the test_dylink_function_pointer_equality test in emscripten to pass. See emscripten-core/emscripten#8268.
1a34ed0 to
391bf5b
Compare
…scripten-core#9393) There is upstream fastcomp change coming which addresses function pointer equality between wasm modules (i.e. SIDE_MODULE/MAIN_MODULE): emscripten-core/emscripten-fastcomp#259 This change prepares for that change by handling the new externFunctions metadata attribute. This new key represents a list of all non-static functions in a relocatable module which are address taken. The module will call fp$<name>() in order to find out the runtime address (table entry) for such functions. Once both these changes land they they will fix emscripten-core#8268.
This means that the dynamic linker then assigned function pointers
and both main module and side module use
fp$fooaccessors to lookupfunction addresses, just like they do for global addresses.
This allows the test_dylink_function_pointer_equality test in emscripten
to pass.
See emscripten-core/emscripten#8268.