Windows Support #734
Replies: 1 comment 7 replies
-
Supporting Windows (or Mac) is certainly a very large undertaking. I've heard that in LLD, the ELF, COFF/PE and Mach-O linkers are basically 3 separate linkers that share a few utilities, but are otherwise separate (but built together into one binary). I'm cautiously optimistic that it might be possible to share more than a few utilities, but I'm also pretty ignorant of COFF/PE and Mach-O, having never worked with either. Parsing of input objects is something that we fortunately don't need to implement, since the object crate, which we use for parsing ELF files has us covered there. The first thing to do would be to get a trivial program to link. This might be a test like Wild development is helped a lot by the use of linker-diff, which allows us to compare what we're producing with what other linkers produce. It'd be good to add support to linker-diff for working with PE binaries. Doing this, while a bit of an up-front investment, makes subsequent debugging a lot easier. Fortunately a bunch of the heavy lifting here is done by the object crate parsing the input files. Probably what I'd do would be to build out support in linker-diff and support in wild in parallel. e.g. get Wild to write the file header and section tables, then get linker-diff to check those bits. It should be possible to make a bunch of progress in that way before even a trivial executable or DLL can actually be executed. There would be lots of refactoring needed to wild as differences between the formats are dealt with. Where there are bits of code that are partially the same and partially different, we can hopefully put the different parts behind a trait in a similar way to what we've done with the Arch trait, which abstracts x86-64, aarch64 and soon riscv64. I'd say the first thing to do would be to familiarise yourself with the PE format. You're also welcome to book time in my calendar to discuss this in person. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hey i don't have much experience with linkers but know rust pretty well. I was wondering if you had a mental or physical list of what is required to get windows support. even if its not quite as good as linux support. i would be interested in starting work on it.
i did see windows is on the roadmap but pretty far down
Beta Was this translation helpful? Give feedback.
All reactions