flat assembler
Message board for the users of flat assembler.
Index
> Compiler Internals > fixups possibly broken |
Author |
|
baldr 01 Nov 2010, 01:37
b1528932,
fasm is, by definition, flat. It can handle forward references for numerical constants, not for fixups. Beliefs have nothing to do with that. |
|||
01 Nov 2010, 01:37 |
|
revolution 01 Nov 2010, 04:11
b1528932: You are right, the Windows loader does not care where the fixups are in the exe file. In theory you can put them at the beginning of the exe, but currently fasm does not support such an arrangement.
Perhaps at the very least fasm could report an error if any relocatable labels are placed after the fixup section. |
|||
01 Nov 2010, 04:11 |
|
Tomasz Grysztar 01 Nov 2010, 06:53
revolution wrote: Perhaps at the very least fasm could report an error if any relocatable labels are placed after the fixup section. As for the support for forward-referencing fixups, it would be quite simple to implement into fasm, analogously to the section table building (since size of section table can also grow depending on what is defined later in source). It's just that never before anyone suggested that it would be needed for some purpose. |
|||
01 Nov 2010, 06:53 |
|
Tomasz Grysztar 27 Nov 2010, 10:56
I implemented resolving of "forward referenced" fixups in 1.69.27. Be warned that it was not thoroughly tested yet.
|
|||
27 Nov 2010, 10:56 |
|
bitRAKE 28 Nov 2010, 01:39
Important to also note that Windows loader will not reclaim memory used by fixup section unless it is at end of EXE (or with other discardable sections at end).
|
|||
28 Nov 2010, 01:39 |
|
revolution 28 Nov 2010, 01:47
bitRAKE wrote: Important to also note that Windows loader will not reclaim memory used by fixup section unless it is at end of EXE (or with other discardable sections at end). |
|||
28 Nov 2010, 01:47 |
|
bitRAKE 28 Nov 2010, 04:45
I don't know about never, but there they are. Doesn't appear the 64-loader reclaims the memory either.
Edit: if the fixups are not in their own section the program gets relocated for no reason at all. Yet, that is the only way I see not to have a wasted page. Also, seeing some other weird settings. |
|||
28 Nov 2010, 04:45 |
|
bitRAKE 28 Nov 2010, 05:49
Relocation page is now readable (at $12000):
Code: format PE64 GUI 5.0 at 0 section '' code readable writeable executable entry $ enter 32,0 xor r9,r9 lea r8,[.title] lea edx,[.text] xor ecx,ecx call [MessageBoxA] leave retn .title db "Hello?",0 .text db "Debugger didn't stop!",0 _user db 'USER32' _MessageBoxA db 0,0,'MessageBoxA',0 align 8 _user.table: MessageBoxA dq RVA _MessageBoxA data import dd 0,0,0,RVA _user,RVA _user.table rd 5 end data section '' fixups _________________ ¯\(°_o)/¯ “languages are not safe - uses can be” Bjarne Stroustrup |
|||
28 Nov 2010, 05:49 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.