NO

Author Topic: polink: using /STUB and /ALIGN:64 together  (Read 2860 times)

xenon

  • Guest
polink: using /STUB and /ALIGN:64 together
« on: April 12, 2007, 04:01:27 PM »
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.

Offline Pelle

  • Administrator
  • Member
  • *****
  • Posts: 2266
    • http://www.smorgasbordet.com
Re: polink: using /STUB and /ALIGN:64 together
« Reply #1 on: April 12, 2007, 09:31:04 PM »
Not a big bug, if any. I will look at it, but it will get a very low priority...
/Pelle