Conversation
|
Pushed a commit to bjorn3/rustc_codegen_cranelift#435 to use this, so mach-O gets tested on travis. |
|
The mach-O version might not work correctly, or I am using https://travis-ci.org/bjorn3/rustc_codegen_cranelift/jobs/512168839#L375 I will investigate tomorrow. |
|
Added an objdump invocation to bjorn3/rustc_codegen_cranelift#435: Conclusion: |
|
Added this code to obj.declare(".faerie", Decl::section(SectionKind::Data))?;
obj.define(".faerie", b"faerie".to_vec())?;Then: |
|
It seems like the section is emitted correctly, but when linking the final dylib it is omitted. (The linker invocation seems to differ between cg_llvm and cg_clif) |
Done |
|
@bjorn3 I'm seeing the section emitted correctly on mach, along with its data "some data". E.g.: unless I'm missing something? It would be easy to add a test for this, we could emit the object file with goblin, then parse the object, check to see the data is in the section. Anyway should we merge? |
|
I think so. The problem with cg_clif is probably caused by different linker invocations than cg_llvm uses. |
|
Ping @m4b |
|
gosh I'm really sorry @bjorn3 merging this now... |
|
No problem. The PR I need this for is still blocked on a rustc PR anyway. |
See https://github.com/bjorn3/rustc_codegen_cranelift/pull/435#issuecomment-477429904
This hasn't been tested with mach-O yet.