Hello all,
I'm having trouble linking the following code:
SECTION .data ; Section containing initialised data
WordString: dw 'CQ'
DoubleString: dd 'Stop'
SECTION .bss ; Section containing uninitialized data
SECTION .text ; Section containing code
global _start ; Linker needs this to find the entry point!
_start:
nop ; This no-op keeps gdb happy...
mov ax, WordString
mov edx, DoubleString
mov eax, 1 ; Code for Exit Syscall
mov ebx, 0 ; Return a code of zero
int 80H ; Make kernel call
The error that I get when trying to link follows:
nasm -f elf -g -F stabs sandbox.asm -l sandbox.lst
ld -o sandbox sandbox.o
sandbox.o:sandbox.asm:19: relocation truncated to fit: R_386_16 against `.data'
make: *** [sandbox] Error 1
I'm running this in Ubuntu 10.10 32bit.
Any input would be highly appreciated it.
I'm trying to learn assembly and the reason why this does not work is really bothering me.
Thanks,
-r