yurydelendik opened PR #1931 from compiler-elf
to main
:
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 work with this image directly after it is allocated in the
CodeMemory
. In the past, we did the similar thing with debug image created for GDB JIT interface. Now, we can use the ELF image created after compilation, and convert it to an loadable object.There is somewhat common/duplicated code in
cranelift-object
andcreates/obj
, this PR is not refactoring this crates yet. It is work for follow up PRs.The changes:
- Create the ELF image from
Compilation
- Create
CodeMemory
from the ELF image- Link using ELF image
- Remove creation of GDB JIT images from
crates/debug
- Move
make_trampoline
from compiler.rs- Pilot usage of
serde
to save all compilation artifacts
yurydelendik edited PR #1931 from compiler-elf
to main
:
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 work with this image directly after it is allocated in the
CodeMemory
. In the past, we did the similar thing with debug image created for GDB JIT interface. Now, we can use the ELF image created after compilation, and convert it to an loadable object.There is somewhat common/duplicated code in
cranelift-object
andcreates/obj
, this PR is not refactoring these crates yet. It is a work for follow up PRs.The changes:
- Create the ELF image from
Compilation
- Create
CodeMemory
from the ELF image- Link using ELF image
- Remove creation of GDB JIT images from
crates/debug
- Move
make_trampoline
from compiler.rs- Pilot usage of
serde
to save all compilation artifacts
alexcrichton submitted PR Review.
alexcrichton created PR Review Comment:
Should this only happen if the symbol is actually referenced?
alexcrichton created PR Review Comment:
FWIW I've seen this prefix in a number of places. Is there a way that we can canonicalize what's going on here? Ideally the name of a function would be contextually defined on some sort of
Module
type as well to account for the name section, but that may be a bit of a larger refactoring.
alexcrichton submitted PR Review.
alexcrichton created PR Review Comment:
This list shows up in a few places, could we perhaps have an "iterator macro" which does this for us? Something like:
macro_rules! add_libcall_symbol { // ... } for_each_libcall!(add_libcall_symbol);
alexcrichton created PR Review Comment:
This has a similar branch above for normal code symbols, so could these two perhaps be unified with a helper function?
yurydelendik updated PR #1931 from compiler-elf
to main
:
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 work with this image directly after it is allocated in the
CodeMemory
. In the past, we did the similar thing with debug image created for GDB JIT interface. Now, we can use the ELF image created after compilation, and convert it to an loadable object.There is somewhat common/duplicated code in
cranelift-object
andcreates/obj
, this PR is not refactoring these crates yet. It is a work for follow up PRs.The changes:
- Create the ELF image from
Compilation
- Create
CodeMemory
from the ELF image- Link using ELF image
- Remove creation of GDB JIT images from
crates/debug
- Move
make_trampoline
from compiler.rs- Pilot usage of
serde
to save all compilation artifacts
yurydelendik updated PR #1931 from compiler-elf
to main
:
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 work with this image directly after it is allocated in the
CodeMemory
. In the past, we did the similar thing with debug image created for GDB JIT interface. Now, we can use the ELF image created after compilation, and convert it to an loadable object.There is somewhat common/duplicated code in
cranelift-object
andcreates/obj
, this PR is not refactoring these crates yet. It is a work for follow up PRs.The changes:
- Create the ELF image from
Compilation
- Create
CodeMemory
from the ELF image- Link using ELF image
- Remove creation of GDB JIT images from
crates/debug
- Move
make_trampoline
from compiler.rs- Pilot usage of
serde
to save all compilation artifacts
yurydelendik submitted PR Review.
yurydelendik created PR Review Comment:
it is preferable, but not necessary. To detect which libcall is used we need to to prescan relocations or track which symbols exist. We can get away with dumping all at this moment.
yurydelendik submitted PR Review.
yurydelendik created PR Review Comment:
In this case these names are just unique string identifier (which can be converted back into
FuncIndex
). We can maintain separate map of FuncIndex<->obj function somewhere else.
yurydelendik updated PR #1931 from compiler-elf
to main
:
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 work with this image directly after it is allocated in the
CodeMemory
. In the past, we did the similar thing with debug image created for GDB JIT interface. Now, we can use the ELF image created after compilation, and convert it to an loadable object.There is somewhat common/duplicated code in
cranelift-object
andcreates/obj
, this PR is not refactoring these crates yet. It is a work for follow up PRs.The changes:
- Create the ELF image from
Compilation
- Create
CodeMemory
from the ELF image- Link using ELF image
- Remove creation of GDB JIT images from
crates/debug
- Move
make_trampoline
from compiler.rs- Pilot usage of
serde
to save all compilation artifacts
alexcrichton submitted PR Review.
alexcrichton created PR Review Comment:
I'm mostly just a bit worried about this conversion is open-coded in a number of places. Not the worst thing in the world but it'd be great if we could centralize/document this somehow.
pchickey submitted PR Review.
pchickey submitted PR Review.
pchickey created PR Review Comment:
It would be good to avoid these
unwrap
s and instead make these functions fallible, which will allow the user to recover when loading a bad object.
pchickey submitted PR Review.
yurydelendik updated PR #1931 from compiler-elf
to main
:
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 work with this image directly after it is allocated in the
CodeMemory
. In the past, we did the similar thing with debug image created for GDB JIT interface. Now, we can use the ELF image created after compilation, and convert it to an loadable object.There is somewhat common/duplicated code in
cranelift-object
andcreates/obj
, this PR is not refactoring these crates yet. It is a work for follow up PRs.The changes:
- Create the ELF image from
Compilation
- Create
CodeMemory
from the ELF image- Link using ELF image
- Remove creation of GDB JIT images from
crates/debug
- Move
make_trampoline
from compiler.rs- Pilot usage of
serde
to save all compilation artifacts
yurydelendik updated PR #1931 from compiler-elf
to main
:
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 work with this image directly after it is allocated in the
CodeMemory
. In the past, we did the similar thing with debug image created for GDB JIT interface. Now, we can use the ELF image created after compilation, and convert it to an loadable object.There is somewhat common/duplicated code in
cranelift-object
andcreates/obj
, this PR is not refactoring these crates yet. It is a work for follow up PRs.The changes:
- Create the ELF image from
Compilation
- Create
CodeMemory
from the ELF image- Link using ELF image
- Remove creation of GDB JIT images from
crates/debug
- Move
make_trampoline
from compiler.rs- Pilot usage of
serde
to save all compilation artifacts
yurydelendik submitted PR Review.
yurydelendik created PR Review Comment:
It this moment we fully trust the generated image, but in the future it might change. I added TODO comment about that.
yurydelendik submitted PR Review.
yurydelendik created PR Review Comment:
centralized name handling (inside object.rs) and added more docs
yurydelendik updated PR #1931 from compiler-elf
to main
:
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 work with this image directly after it is allocated in the
CodeMemory
. In the past, we did the similar thing with debug image created for GDB JIT interface. Now, we can use the ELF image created after compilation, and convert it to an loadable object.There is somewhat common/duplicated code in
cranelift-object
andcreates/obj
, this PR is not refactoring these crates yet. It is a work for follow up PRs.The changes:
- Create the ELF image from
Compilation
- Create
CodeMemory
from the ELF image- Link using ELF image
- Remove creation of GDB JIT images from
crates/debug
- Move
make_trampoline
from compiler.rs- Pilot usage of
serde
to save all compilation artifacts
alexcrichton submitted PR Review.
yurydelendik updated PR #1931 from compiler-elf
to main
:
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 work with this image directly after it is allocated in the
CodeMemory
. In the past, we did the similar thing with debug image created for GDB JIT interface. Now, we can use the ELF image created after compilation, and convert it to an loadable object.There is somewhat common/duplicated code in
cranelift-object
andcreates/obj
, this PR is not refactoring these crates yet. It is a work for follow up PRs.The changes:
- Create the ELF image from
Compilation
- Create
CodeMemory
from the ELF image- Link using ELF image
- Remove creation of GDB JIT images from
crates/debug
- Move
make_trampoline
from compiler.rs- Pilot usage of
serde
to save all compilation artifacts
yurydelendik updated PR #1931 from compiler-elf
to main
:
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 work with this image directly after it is allocated in the
CodeMemory
. In the past, we did the similar thing with debug image created for GDB JIT interface. Now, we can use the ELF image created after compilation, and convert it to an loadable object.There is somewhat common/duplicated code in
cranelift-object
andcreates/obj
, this PR is not refactoring these crates yet. It is a work for follow up PRs.The changes:
- Create the ELF image from
Compilation
- Create
CodeMemory
from the ELF image- Link using ELF image
- Remove creation of GDB JIT images from
crates/debug
- Move
make_trampoline
from compiler.rs- Pilot usage of
serde
to save all compilation artifacts
yurydelendik edited PR #1931 from compiler-elf
to main
:
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 work with this image directly after it is allocated in the
CodeMemory
. In the past, we did the similar thing with debug image created for GDB JIT interface. Now, we can use the ELF image created after compilation, and convert it to an loadable object.There is somewhat common/duplicated code in
cranelift-object
andcreates/obj
, this PR is not refactoring these crates yet. It is a work for follow up PRs.The changes:
- Create the ELF image from
Compilation
- Create
CodeMemory
from the ELF image- Link using ELF image
- Remove creation of GDB JIT images from
crates/debug
- Move
make_trampoline
from compiler.rs- <del>Pilot usage of
serde
to save all compilation artifacts</del>
yurydelendik merged PR #1931.
Last updated: Nov 22 2024 at 17:03 UTC