Syscalls

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.
AR

Re:Syscalls

Post 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))" ).
Post Reply