HackerGprat
HackerGprat

Reputation: 95

unable to link object file so i can't make it executalbe

I've started learning assembly language (from tutorials point) and they said:

To link the object file and create an executable file named hello, type ld -m elf_i386 -s -o hello hello.o

But the -m is not found in my terminal

Here's the tutorial link:

https://www.tutorialspoint.com/assembly_programming/assembly_basic_syntax.htm

I'm using persistence parrot os 4.6 VERSION NASM (LATEST ONE).

Upvotes: 0

Views: 38

Answers (1)

Peter Cordes
Peter Cordes

Reputation: 366036

"Type" is an instruction to you to use your keyboard to input this to a shell.

ld -m elf_i386 -s -o hello hello.o

It seems you did:

$ type ld -m ...
ld is /usr/bin/ld
bash: type: -m: not found

type is a shell built-in that can take multiple arguments and tell you whether each of them is an alias, shell-function, or found in the $PATH.

The tutorial you were using did not mean to use the type command, it wanted you to run ld, the linker. That's why it bolded the ld command, not including the word type.

"Type" is a poor choice of words. I would have said "run", and assumed that readers would copy/paste the text into a terminal window. But in any case, they're just using "type" as a plain English word, not part of the command.

Upvotes: 2

Related Questions