Skip to content

Conversation

@wakabat
Copy link
Contributor

@wakabat wakabat commented Apr 2, 2025

Previous code relies on C glue code to piece metadata and actual function addresses after linking together. This change refines the process, so proper relocations are generated for each function / trampoline when building the object. This way a linker should be able to fulfill the task of filling in actual function addresses in the final binary, there is no need to use glue code to do the memcpy work anymore.

@wakabat wakabat requested a review from syrusakbary as a code owner April 2, 2025 08:36
@promptless
Copy link

promptless bot commented Apr 2, 2025

✅ No documentation updates required.

@wakabat wakabat changed the title Simply object initialization path with relocations Simplify object initialization path with relocations Apr 2, 2025
@syrusakbary
Copy link
Member

Thanks for the PR! We need to test the branch locally, and try a few cases... but in general looks good!

@wakabat wakabat force-pushed the use-relocation-to-setup-function-address-in-objects branch from 97b4ba8 to 64c0326 Compare April 23, 2025 05:35
@wakabat
Copy link
Contributor Author

wakabat commented Apr 23, 2025

Rebased against tip.

Previous code relies on C glue code to piece metadata and actual
function addresses after linking together. This change refines the
process, so proper relocations are generated for each function /
trampoline when building the object. This way a linker should be able to
fulfill the task of filling in actual function addresses in the final
binary, there is no need to use glue code to do the memcpy work anymore.
@wakabat wakabat force-pushed the use-relocation-to-setup-function-address-in-objects branch from 64c0326 to cd7731e Compare April 23, 2025 07:56
@syrusakbary
Copy link
Member

We tested locally (in aarch64 and x86_64) and it works well. We should be good to merge once the majority of tests pass (some jobs seem to be failing, but are unrelated to this PR)

@xdoardo xdoardo merged commit 5b7d9c9 into wasmerio:main Apr 23, 2025
81 of 84 checks passed
@wakabat wakabat deleted the use-relocation-to-setup-function-address-in-objects branch April 23, 2025 13:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants