-
Notifications
You must be signed in to change notification settings - Fork 201
cranelift-module should document that finalize_definitions
needs to be called before finish
#1288
Comments
I know the CLIF is not super helpful but I'm not sure how to show the data/global objects I've sent to cranelift. If anyone knows, I would love to add that! |
Note that I've reproduced this bug on Windows as well so it's not something specific to the object file format. |
What are the relocations? ( |
I'm not sure there are any ...
Here's the symbol table if that helps:
|
For comparison, this is an object file emitted by
And a file emitted by
|
Strange. Never had problems with cranelift-object myself. |
I didn't call |
finalize_definitions
needs to be called before finish
Closes bytecodealliance#1288 by calling `module.finalize_definitions` whenever `module.finish` is called.
It's possible that I've misunderstood |
In my PR, I just called |
Closes bytecodealliance/cranelift#1288 by calling `module.finalize_definitions` whenever `module.finish` is called.
ideally reduced with the
bugpoint
clif-util command?git clone https://github.com/jyn514/rcc && cd rcc
git checkout cranelift-object
cargo run <<< 'int i = 1; int main(void) { return i; }'; ./a.out; echo $?
if so, with which assertion?
I expect this to return 1. Instead it returns (on my machine) 64.
I feel reasonably confident this is not a bug in my code because the exact same code works fine using cranelift-faerie (you can reproduce by checking out the
master
branch).CLIF (can reproduced with
cargo run -- --debug-asm
):Generated assembly. Note how the
lea
points to the next instruction which is not correct.cranelift-object 0.51.0 (git+https://github.com/bytecodealliance/cranelift#ec787eb281bb2e18e191508c17abe694e91f0677)
(Rust version, operating system, architecture...)
Rust version:
rustc 1.39.0 (4560ea788 2019-11-04)
System info:
Linux 5.0.0-37-generic
on Ubuntu 18.04 x86_64 with glibc.The text was updated successfully, but these errors were encountered: