i´m new to assembly and using yasm, with the ebe editor.
Now after the first steps i want to check the global/extern mechanism.
Therefore i made 2 modules:
actor.asm
extern greeter
section .text
global main
main:
push rbp
call greeter wrt ..plt
pop rbp
mov rax,0
ret
greeter.asm
extern printf
section .data
msg: db "Hello world", 0
fmt: db "%s", 10, 0
section .text
global greeter
type greeter function
size greeter greeter.end -greeter
greeter:
push rbp
mov rdi,fmt
mov rsi,msg
mov rax,0
call printf
pop rbp
mov rax,0
ret
.end:
Both files are compiled and when i run the first, following error message appears:
/home/1/Öffentlich/EBE_Space/ext_glob_test/actor.o: In function
main': /home/1/Öffentlich/EBE_Space/ext_glob_test/actor.asm:6: undefined reference to
greeter'
What´s wrong? What´s necessary to make a global function linkable?
TIA