Dan Gohman
Dan Gohman
As far as I can tell, there isn't universal consensus on the right way to handle this. I tend to think it can be ok, as long as the new...
Do you expect you'll add the emscriptenized load-wasm-worker.js feature eventually? (In other words, is this the first step toward implementing the comment in the first line of https://github.com/WebAssembly/polyfill-prototype-1/blob/master/Makefile ?)
I myself don't feel I have a clear view of how faerie's "automatic" approach to relocations should work, so I'm stepping back as reviewer here.
@philipc I believe you are correct, and we should fix this.
Yes, PE-COFF support is something that people have been thinking about, as can be seen [in some comments](https://github.com/m4b/faerie/blob/13cc7e44adebd1f930761646cee484721dc6ffe8/tests/artifact.rs#L198).
How "grand" are you thinking here? Would this include dynamic relocations? Would it include common assembler "fixups"?
What if `peek` returned an `Option`?
How about this? ```rust let peek = goblin::peek(&mut fd)?; match peek { None => println!("unknown magic: {:#x}", magic), Some(magic) => { let bytes = { let mut v = Vec::new();...
I'm suggesting peek return an Option. With invalid magic, peek would return None, and in that case you wouldn't call parse at all.
```rust fn peek(fd: &mut File) -> Result; fn parse(hint: Hint, bytes: &[u8]) -> Result; ```