0

I have written a Hello world program in assembly.I compile the code using nasm

nasm -f elf64 -o Hello.o Hello.asm

The NASM compiling is successful and a object file is created. But when I link it using ld linker

ld -o Hello Hello.o

and then run it with \. Hello this error occurs- bash: .:Hello: cannot execute binary file

Kshitij Joshi
  • 137
  • 1
  • 10
  • 7
    Don't `\. Hello`, but `./Hello` – James Brown Sep 07 '20 at 07:31
  • 2
    @KshitijJoshi : What is the backslash supposed to do? Also, you seem to have a space between the period and the `H`. This means that the command you effectively run here is `. Hello`, i.e. you try to _source_ a binary, which of course is not possible. – user1934428 Sep 07 '20 at 10:31

0 Answers0