flat assembler
Message board for the users of flat assembler.
Index
> Linux > [fasm2] Problem with 'format ELF64' |
| Author |
|
|
revolution 05 Jan 2026, 01:53
I've had success with linking in the past by using
Code: ld ... -e start ... Code: public start start: ;... |
|||
|
|
Jessé 05 Jan 2026, 04:00
Oooh, shame on me!
Sorry guys to annoy you with my lack of competence, it seems that my attention has blown away a fuse today! Clearly my own 'ld' command line is missing the 'asmextern.o' file as the source object. The correct is: Quote:
With optional '-e _start' also working normally. Change it here and it worked. Consider solved. Thanks anyways, revolution. |
|||
|
|
Jessé 05 Jan 2026, 04:09
And here, I let the correct working code, because the above one also has errors (if anyone wanna test it):
Code: format ELF64 extrn fprintf extrn exit extrn stdout public _start section '.text' executable align 4 _start: endbr64 mov rdi, [got.stdout] mov rdi, [rdi] lea rsi, [msg0] xor al, al call plt.fprintf sub rsp, 8 xor edi, edi jmp plt.exit section '.data' writeable msg0: db 'This is a fasm2 program, compiled in' db ' a traditional way!',10,0 |
|||
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2025, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.