Skip to content

Comments

Add tool largeaddr to set Large Address Aware flag on Windows exes.#83

Closed
Abscissa wants to merge 1 commit intodlang:masterfrom
Abscissa:largeaddr
Closed

Add tool largeaddr to set Large Address Aware flag on Windows exes.#83
Abscissa wants to merge 1 commit intodlang:masterfrom
Abscissa:largeaddr

Conversation

@Abscissa
Copy link
Contributor

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.

@ghost
Copy link

ghost commented Aug 28, 2013

There's actually a pull for Optlink adding this option, but Walter hasn't pulled it yet:

DigitalMars/optlink#9

Pinging @WalterBright

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

.scr is also a valid exe. Why didn't you use the functions from std.path to do this?

@Abscissa
Copy link
Contributor Author

.scr is also a valid exe.

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?

Why didn't you use the functions from std.path to do this?

Because startsWith/endsWith are always at the front of my mind ;) And in this particular case, I don't see much difference between foo.toLower().extension == ".foo" vs foo.toLower().endsWith(".foo"). The std.path works fine too, of course.

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 :) ).

@WalterBright
Copy link
Member

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.

@yebblies
Copy link
Contributor

Don't .com files have a different format? Or something.

I agree that the optlink patch is a more straightforward solution.

@WalterBright
Copy link
Member

Don't .com files have a different format?

Under DOS, yes, under Windows, no.

@Abscissa
Copy link
Contributor Author

Don't .com files have a different format?
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.

@Abscissa Abscissa closed this Aug 29, 2013
@WalterBright
Copy link
Member

I don't know what guarantees there are, but that's how it works.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants