Linker error when calling printf from _start [duplicate]
问题 This question already has answers here : Assembling 32-bit binaries on a 64-bit system (GNU toolchain) (2 answers) Closed 3 years ago . I tried to write simple program without main segment .data fmt db "test", 0xa, 0 segment .text global _start extern printf _start: lea rdi, [fmt] ; print simple string xor eax, eax call printf mov eax, 60 ; exit successfully xor edi, edi syscall Compile: yasm -f elf64 main.s; ld -o main main.o Got main.o: In function `_start': main.s:(.text+0xb): undefined