Page 1 of 1

Linker error

Posted: Sun Feb 09, 2003 5:40 am
by 2100-OS
I get the following linker error:

ks.o(.data+0x2a): relocation truncated to fit: 16 .data

I'm using DJGPP LD, what does this error mean, since I didn't change the data section for a while, I think it's a bit weird, the linker also does not output a file.

Re:Linker error

Posted: Sun Feb 09, 2003 5:48 am
by Pype.Clicker
it means you have something like a 16-bits area where you try to store the reference to a 32-bits addressed object.

For instance (very common) :

Code: Select all

IDT_HANDLER:
      dw my_handler ; <<<<----
      dw CODE_SELECTOR
     db type, ...
dw 0
[/code[

Re:Linker error

Posted: Sun Feb 09, 2003 6:27 am
by 2100-OS
Found it

it was a typo

gdt_ptr:
   DW gdt_end - gdt - 1
   DW gdt

had to be:

gdt_ptr:
   DW gdt_end - gdt - 1
   DD gdt

tnx