Page 3 of 3

Re:Syscalls

Posted: Mon Sep 26, 2005 12:09 pm
by AR
It's been a while since I wrote my dynamic linker but I the method I used was rather simple:
ld ... -Bdynamic ../Kernel/ELFKernelImage

I don't recall why, most likely because it was probably easy. All that had to be done was checking st_shndx==0 for every symbol in the application, if true then going through the symbol table for the library for a symbol that is either STB_GLOBAL or STB_WEAK, you then need to compare the hashes and function names from the program to the library then binding it in the GOT. Note that this is extremely jerry-built to function within the controlled test environment and probably won't be sufficient.

As far as I recall, all symbols are GLOBAL by default unless you explicitly make them local, in GCC (I think there's something like "__attribute__((local))" ).