Linker problems, I think...
Posted: Sat Sep 16, 2006 2:38 am
I wish I didn't have to join this forum asking questions, but I've been completely stuck for several days on this issue.
I've been working a bit on-and-off on my hobby kernel project, things are going great. I finished my bootloader a few days ago, managed to write some cool memory management routines, but nothing outside main.c worked, despite being compiled and linked without any kinds of error or warning messages.
I tried rewriting the routines, adding printlining, removing the code within them, absolutely nothing except what was in main.c worked.
After moving all my external code to main.c, everything suddenly started working fine.
Checking the assembly, I see that all my calls to functions outside main.c, jumps to JNBE instructions that in turn jump to themselves.
Does anyone know a possible cause for this?
I'm using LD 2.13, GCC 2.8.1, and NASM 0.98.39.
Edit:
The strangest thing just happened; if I declare a function pointer that points to a function outside main.c, and call that one, it works all of a sudden =S
Edit 2:
Nevermind the last edit, it worked a couple of times and then stopped working for no reason.
I've been working a bit on-and-off on my hobby kernel project, things are going great. I finished my bootloader a few days ago, managed to write some cool memory management routines, but nothing outside main.c worked, despite being compiled and linked without any kinds of error or warning messages.
I tried rewriting the routines, adding printlining, removing the code within them, absolutely nothing except what was in main.c worked.
After moving all my external code to main.c, everything suddenly started working fine.
Checking the assembly, I see that all my calls to functions outside main.c, jumps to JNBE instructions that in turn jump to themselves.
Does anyone know a possible cause for this?
I'm using LD 2.13, GCC 2.8.1, and NASM 0.98.39.
Edit:
The strangest thing just happened; if I declare a function pointer that points to a function outside main.c, and call that one, it works all of a sudden =S
Edit 2:
Nevermind the last edit, it worked a couple of times and then stopped working for no reason.