here is something super simple:
My code (p1.s):
.intel_syntax noprefix
.arch i386
.data
poruka:
.asciz "Zdravo svete!\n"
kraj_poruke:
.equ duzina_poruke, kraj_poruke - poruka
.text
.extern write
.extern exit
.globl _start
_start:
push duzina_poruke
push offset poruka
push 1
call write
add esp, 12
push 0
call exit
.end
The commands I use to assemble and link the files:
as -o p1.o p1.s
ld -o p1 -dynamic-linker /lib/ld-linux.so.2 p1.o -l c
After these commands, I have the p1.s, p1.o and p1 files all in the directory where I want them.
The error I get:
bash ./p1 : Accessing a corrupted shared library.
Why? :D Thanks in advance!
Could someone please explain to me why this doesn't work? Thanks in advance! :)