flat assembler
Message board for the users of flat assembler.
![]() |
Author |
|
revolution
Actually it is a Windows bug in the loader refusing to accept empty relocs sections.
You can "fix" it by placing a dummy "dq 0" in the relocs section at the end. Or if you are worried about the extra bloat of 8 bytes you can check if the section is empty and only place the dq 0 if there is nothing else there. Last edited by revolution on 02 Jan 2018, 16:31; edited 1 time in total |
|||
![]() |
|
ShabbyBumblebutt
I'm sure that Fasm must show a warning in that case. How i'm supposed to know why my binary not works?
|
|||
![]() |
|
revolution
There are systems other than Windows that use the PE format. It is unfortunate that Windows has such a bug, but for most programs you can run without a relocs section perfectly fine. And for those non-trivial programs that want to have things like ASLR available then the relocs section would never be empty anyway. The impact is too low for MS to care about fixing it.
|
|||
![]() |
|
ShabbyBumblebutt
I make some trivial stub and it not even loading - how i'm supposed to know the reason without such warning?
|
|||
![]() |
|
revolution
I'm not sure what you are suggesting. Are you expecting fasm to tell of problems with Windows? It's actually Windows job to tell you why it fails. But Windows is not very helpful in these cases. It would be possible to make fasm always output a non-empty relocs section but then other systems that aren't Windows might fail. I don't know all the details of it, but empty sections are a problem for Windows, not just the relocs sections. It affects all sections.
|
|||
![]() |
|
ShabbyBumblebutt
Fasm can check subsystem (gui/console/native) for detecting windows program.
|
|||
![]() |
|
Tomasz Grysztar
revolution wrote: I don't know all the details of it, but empty sections are a problem for Windows, not just the relocs sections. It affects all sections. |
|||
![]() |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2019, Tomasz Grysztar.
Powered by rwasa.