Linking problem

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
pskyboy

Linking problem

Post by pskyboy »

Hey Guys

I am currently loading my Kernel at 1Mb physical address but looks like 3Gb virtually using the GDT. My problem is in my kernel if i jump to a function written in another file from the main one it will crash and bochs reports a running in bogus memory error. Has anyone got any ideas of this. To me its like the object files for the other source files with my functions in are not being linked correctly.

Any Ideas?
Cheers Peter
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:Linking problem

Post by Pype.Clicker »

i think you should try a disassembly of your final object file to see if jumps are linked correctly ...
pskyboy

Re:Linking problem

Post by pskyboy »

Ive tried dissasembling it but its a bit hard to follow due to the fact i am using c++.

Peter
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:Linking problem

Post by Pype.Clicker »

What is the final format of your object file (i.e. what is it linked to ?) did you check all your functions were there ...

could you provide a small sample of misworking jump/call with the relocation entries that are related to it ?
pskyboy

Re:Linking problem

Post by pskyboy »

All my functions are definately there as i had it working fine when it was linked to 1Mb it was only when i tried to link it to 0xC0000000 that all the problems arose. Im not quite sure what you want in terms of the jmp and relocation entries. Do you want a dissasembled version of my final binary file or some of it?

Also do you knwo of a viewer that will display object files ie the header info etc.

cheers
Peter
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:Linking problem

Post by Pype.Clicker »

objdump displays quite alot of informations, which avoid you from needing a detailed hexdump of the section headers, etc.
It is available in every distribution of Binutils (and should be available with your Linux/DjGPP distro)
Post Reply