polink: using /STUB and /ALIGN:64 together

Started by xenon, April 12, 2007, 04:01:27 PM

Previous topic - Next topic

xenon

polink seems to generate wrong addresses in the output executable when specifying both /stub and /align lower than 128. The output with wrong addresses can't be run, with error message: <something>.exe is not a valid Win32 application.

In the attachment,
main.obj comes from http://www.smorgasbordet.com/forum/index.php?topic=1062.0
plink.bat shows the linker command line that I use.
stub.exe is the DOS stub used by polink.

I understand that PE file less than 1024 bytes do not conform to standard. But in this case, it is a linker bug. With the /stub removed, the output runs fine. With the /align:64 changed to /align:128, it also runs correctly. Since I specify the default stub, the linker output for cases with or without the /stub should be the same except a timestamp. Compare "main right.exe" and "main wrong.exe" in hex editor.

Pelle

Not a big bug, if any. I will look at it, but it will get a very low priority...
/Pelle