flat assembler
Message board for the users of flat assembler.
Index
> Linux > How to make x32 objects and executable? |
Author |
|
Jin X 12 Apr 2017, 08:26
"format ELF executable 3" makes x86 executable
"format ELF64 executable 3" makes x64 executable But how can I make x32 (x64 with 32-bit pointers) execetables? https://en.wikipedia.org/wiki/X32_ABI p.s. What does mean "3" after "executable" is these lines? |
|||
12 Apr 2017, 08:26 |
|
Tomasz Grysztar 12 Apr 2017, 09:58
It should be an ELF file with class ELFCLASS32 and machine EM_X86_64. fasm's "format ELF" is always ELFCLASS32/EM_386 and "format ELF64" is always ELFCLASS64/EM_X86_64. But you can experiment with the ELF formatting macros in fasmg, since they allow to set up these properties freely:
Code: ELF.Settings.Class = ELFCLASS32 ELF.Settings.Machine = EM_X86_64 ELF.Settings.ABI = ELFOSABI_LINUX include 'format/elfexe.inc' include 'x64.inc' use64 |
|||
12 Apr 2017, 09:58 |
|
Jin X 13 Apr 2017, 08:30
Thanks!
But why don't you make "format ELFx32" support in original fasm? |
|||
13 Apr 2017, 08:30 |
|
Jin X 13 Apr 2017, 12:38
You may compare headers of x64 and x32 programs made by 'as'+'ld' or 'nasm' to be sure or to find other differences...
|
|||
13 Apr 2017, 12:38 |
|
Tomasz Grysztar 13 Apr 2017, 15:53
Jin X wrote: You may compare headers of x64 and x32 programs made by 'as'+'ld' or 'nasm' to be sure or to find other differences... |
|||
13 Apr 2017, 15:53 |
|
revolution 20 Feb 2019, 09:09
See here for a working example.
|
|||
20 Feb 2019, 09:09 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.