Joined: 16 Jun 2003
Location: Kraków, Poland
Re: fasmg examples - no relocs for pe64
When I'm compiling win32.exe from examples, I get .reloc section filled.
When I do the same for pe64 file, reloc section is created, but is zero length
What am I missing about pe64 relocations? How do they work?
Since in long mode the default addressing is RIP-relative, usually no relocations are needed as the code is already position-independent. Only when you use an instruction that contains absolute address in its encoding (like "mov rax,var" instead of "lea rax,[var]") a relocation is going to be necessary.
Also, PE macros redefine both dd and dq data types for relocation. In case of PE64, do both dd and dq should be processed for relocation or only dq?
They have different relocation types that apply. For dword it is IMAGE_REL_BASED_HIGHLOW while for qword it is IMAGE_REL_BASED_DIR64.
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You cannot attach files in this forum You can download files in this forum