Error while linking x86_64 assembly file

I was trying to assemble and link this file, but when i try to link it with the following command:

gcc x64_hello.o -o x64_hello.elf -nostdlib

gcc throws the following error:

/usr/bin/ld: x64_hello.o: relocation R_X86_64_32S against '.data' can not be used when making a PIE object; recompile with -fPIE /usr/bin/ld: Failed to set dynamic section sizes: bad value collect2: error: ld returned exit status 1