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.0plink.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.