Add tool largeaddr to set Large Address Aware flag on Windows exes.#83
Add tool largeaddr to set Large Address Aware flag on Windows exes.#83Abscissa wants to merge 1 commit intodlang:masterfrom
Conversation
|
There's actually a pull for Optlink adding this option, but Walter hasn't pulled it yet: Pinging @WalterBright |
There was a problem hiding this comment.
.scr is also a valid exe. Why didn't you use the functions from std.path to do this?
Oh yea. It is the same binary format, right? It's been a long time but IIRC the only difference between a .scr and .exe is that windows passes certain cmdline switches to a .scr depending on how it's launched, right?
Because startsWith/endsWith are always at the front of my mind ;) And in this particular case, I don't see much difference between In any case, since there's already a (now merged) pull to add the feature to optlink, I don't think there's much need for this. If people disagree, then of course I'll update this pull, but otherwise I'm going to check out the new optlink flag and if it seems to work on dmd then this can probably be closed (it was a fun little exercise anyway :) ). |
|
I'm sorry I'd overlooked that pull to optlink. Anyhow, .com is also a valid Windows executable extension. It should be treated just like .exe, but frankly it's obsolete and a waste of time. |
|
Don't I agree that the optlink patch is a more straightforward solution. |
Under DOS, yes, under Windows, no. |
Purely academic question at this point, but would it be possible for such a DOS com file to "look" like a normal PE exe if you check the first two bytes are "MZ" and look for "PE\0\0" at the offset indicated in byte #60(dec)? Ie, does the non-PE DOS com format guarantee that those two "magic value" checks are sufficient to distinguish a PE executable form a non-PE executable? BTW, I'm closing this because the optlink pull appears to be working fine, so AFAICT there's no need for this tool. |
|
I don't know what guarantees there are, but that's how it works. |
AFAIK, optlink doesn't have a way to set the Large Address Aware flag, which is important for something like DMD which uses a lot of memory. So this is a simple cli tool to do that.