By the way, this is 64 bits version of your program. It will work only on Windows because Windows and Linux 64 bits assembly have different calling convention. In addition, Windows requires shadow space on stack before calling another function.
extern printf
global hello
section .text
hello:
push rbp
mov rbp,rsp
sub rsp,32
mov rcx,message
xor rax,rax
call printf
add rsp, 32
pop rbp
ret
section .data
message:
db 'Hello, World', 10, 0
You can keep the command as in your post
nasm -f win64 hello.asm -o hello.o
gcc main.c hello.o -o hello.exe