Linker has problem with addressing
Posted: Sun Jan 10, 2010 12:45 am
If I try to access data at some location in the following way: "DWORD [ some_label ]" nasm will assemble fine as expected, but ld throws an error that I cannot fix... The error looks like this:
This is preventing me from addressing anything (I'm still in my boot loader and haven't even begun to switch from 16 to 32 bit at all yet).
Here's a cut-out of an example source that generates this error:
This error appears per occurrence.
Help appreciated,
Brodeur235
Code: Select all
./../assembled_modules/bl_s2.o: In function `bl_s2_main':
./../source/boot_loader/stage_2/bl_s2.asm:(.text+0x12): relocation truncated to fit: R_386_16 against `.text'
Here's a cut-out of an example source that generates this error:
Code: Select all
%include "system.inc"
[BITS 16]
bl_s2_main:
; disable interrupts
cli
; setup stack
xor ax,ax
mov ss,ax
mov esp,0x00008000
; setup data
xor ax,ax
mov ds,ax
mov ax, [ (apple+0x7C00) ]
; pause
jmp $
apple dw 0x0000
Help appreciated,
Brodeur235