Repository navigation
Conversation
|
This is producing an invalid object on MacOS: How to reproduceint main(void)
{
return 0;
}clang --target=wasm32-wasi --sysroot /opt/wasi-libc -O2 -s -o a.wasm a.c
lucetc-wasi a.wasmWASM file and resulting object files: |
|
Looks like I moved too much into |
fd4c8d9 to
c662906
Compare
|
Pretty ugly, but the following diff over https://gist.github.com/4eccc9f79d8db408e1c1717a4d446d49 BTW, that file can come in handy: https://opensource.apple.com/source/ld64/ld64-128.2/src/ld/parsers/macho_relocatable_file.cpp.auto.html |
|
@jedisct1 Thanks for figuring out those fixes! Can you explain more about the underscore prefix, or point to some documentation about it? I see that faerie writes the underscore for every symbol, but you've only added for globals. I might have to come up with a way of making the underscore an option in |
|
Hi @philipc , The Mach-O documentation says:
So I guess it indeed should also be applied to non-exported functions. COFF symbols also need leading underscores. |
|
I don't think any other calling convention has even been used on MacOS. LLVM skips leading underscores unconditionally on Mach-O files. So maybe it would make sense to heave the |
|
I've opened gimli-rs/object#127 to fix those issues, if you could review that. I chosen to make the mangling optional, and disable this for objcopy. That LLVM link is only for the symbolizer, which is a bit higher level than the API that the object crate wants to provide. I've based this on this LLVM code. |
c662906 to
7aa8caf
Compare
|
Closing in favor of #295 |
No description provided.