Linker error

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
2100-OS

Linker error

Post 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.
User avatar
Pype.Clicker
Member
Member
Posts: 5964
Joined: Wed Oct 18, 2006 2:31 am
Location: In a galaxy, far, far away
Contact:

Re:Linker error

Post 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[
2100-OS

Re:Linker error

Post 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
Post Reply