I'm using NASM. When I try to link the program (using this command "ld -s -o test test.o"), I get the below warning. As a result of that, when I run the progam it seg-faults. Does anyone have an idea what I'm screwing up?
Warning:
Code:Code:ld: warning: cannot find entry symbol _start; not setting start address
Code:; test.asm ; this is where the variables are stored. SECTION .DATA hello: db 'Hello world!',10 helloLen: equ $-hello ; the beginning of the executing code. SECTION .TEXT GLOBAL _START ; this is a routine that will be called when the program starts running. _START: ; Write 'Hello world!' to the screen mov eax, 4 ; 'write' system call mov ebx, 1 ; file descriptor 1 = screen mov ecx, hello ; string to write mov edx, helloLen ; length of string to write int 80h ; call the kernel ; Terminate program mov eax, 1 ; 'exit' system call mov ebx, 0 ; exit with error code 0, we want to exit without any errors. int 80h ; call the kernel




Reply With Quote