linking errors

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
User avatar
bsunisol
Member
Member
Posts: 40
Joined: Fri Apr 06, 2007 3:00 pm
Location: Germany, Berlin and near Hamburg

linking errors

Post by bsunisol »

hi,
i am linking my osloader with ld but the loader makes a wrong call.
how could i order ld to give me the adresses of the funktions in the .obj files to compare them with the resulting binary-file?
User avatar
Kevin McGuire
Member
Member
Posts: 843
Joined: Tue Nov 09, 2004 12:00 am
Location: United States
Contact:

using objdump

Post by Kevin McGuire »

Since you did not say what operating system you were using I will give you the linux example. You also said object files so passing the map file option to the linker would not do exactly what you want. So:

man objdump
man ld
man gcc

hint: option -x
User avatar
bsunisol
Member
Member
Posts: 40
Joined: Fri Apr 06, 2007 3:00 pm
Location: Germany, Berlin and near Hamburg

Post by bsunisol »

i allready found an option to get a mapfile from ld.
it says the function is at DES:0x00000850.

but when i code call 0x850 instead of the label
the result is as bad as before.....
User avatar
Combuster
Member
Member
Posts: 9301
Joined: Wed Oct 18, 2006 3:45 am
Libera.chat IRC: [com]buster
Location: On the balcony, where I can actually keep 1½m distance
Contact:

Post by Combuster »

You should check wether you are using an absolute call or not. (you are probably not) run bochs' debugger to see wether the call points to the location you expect it to be.
"Certainly avoid yourself. He is a newbie and might not realize it. You'll hate his code deeply a few years down the road." - Sortie
[ My OS ] [ VDisk/SFS ]
Post Reply