Stream: wasmtime

Topic: Generated ELF image without absolute relocation


view this post on Zulip Yury Delendik (Jul 06 2020 at 19:53):

Currently CL generated calls that are absolute. See example at https://github.com/bytecodealliance/wasmtime/pull/1931#issuecomment-654432484 .
So a good idea to convert them into relative PIC-style calls. Is it what CL is capable to do atm?

The following refactoring is a first step towards #1779 . The main idea is to create object/ELF image as the result of the compilation (which can be saved/serialized in the future). The linker will...

view this post on Zulip Alex Crichton (Jul 06 2020 at 20:11):

@Yury Delendik I think that's what dan mentioned about how ideally those relocation for intra-module calls are all relocated as relative offsets

view this post on Zulip Alex Crichton (Jul 06 2020 at 20:11):

so we can apply the relocations after cranelift is done, but before we finish the elf image

view this post on Zulip Alex Crichton (Jul 06 2020 at 20:12):

so they're sort of "apply once" relocations that are forgotten when we cache because they're already resolved

view this post on Zulip Yury Delendik (Jul 06 2020 at 20:12):

yes, I could not find an easy way

view this post on Zulip Alex Crichton (Jul 06 2020 at 20:12):

if they're absolute addresses right now though there's not much we can do about that

view this post on Zulip Yury Delendik (Jul 06 2020 at 20:13):

@Alex Crichton let me know if it will be useful to setup a meeting to discuss the PR

view this post on Zulip Alex Crichton (Jul 06 2020 at 20:14):

will do!

view this post on Zulip Alex Crichton (Jul 06 2020 at 20:14):

I don't think now's the right time to do relocation stuff on the PR though


Last updated: Dec 23 2024 at 13:07 UTC