HI !! thank your for your quick answer.
So strace will show this output on the old binary I've compiled :
bash# strace ./new
execve("./new", ["./new"], [/* 78 vars */]) = 0
--- SIGSEGV (Segmentation fault) @ 0 (0) ---
+++ killed by SIGSEGV +++
The new code:
---------------------- new.asm ----------------
bits 32
section .text
global _start
_start:
pusha
mov eax,4
mov ebx,1
mov ecx,msg
mov edx,msg_len
int 0x80
popa
xor eax,eax
inc eax
int 0x80
section .data
msg db "test",0x0
msg_len equ $-msg
bash# nasm -f elf -o new.o new.asm
bash# ld -o new new.o
bash# ./new
testbash#
So as u can see it worked very fine.
I tried something else :
---------------------- new.asm --------------
bits 32
section .text
global _start
_start:
pusha
mov eax,4
mov ebx,1
mov ecx,msg
mov edx,msg_len
int 0x80
popa
xor eax,eax
inc eax
int 0x80
msg: db "test",0x0
msg_len equ $-msg
But it didnt work aswell.So the problem is that the kernel needs a .data section for the data. Hmm ...But thats quite annoying. I've been used to use no .data in my programms.