OSDev.org

The Place to Start for Operating System Developers
It is currently Fri Mar 29, 2024 5:20 am

All times are UTC - 6 hours




Post new topic Reply to topic  [ 1 post ] 
Author Message
 Post subject: Symbols in ELF
PostPosted: Mon Mar 04, 2002 10:05 am 
I'm writing a simple dynamic linker for my kernel, and am now stuck with elf symbols.. Can anyone tell me if the following code is correct? It's supposed to find the symbol using the hash table, but it doesn't seem to. Neither do I, when I try to do this manually :( ..

   cur_index = hash_table[(name_hash % nbucket) + 2];
   while (cur_index != STN_UNDEF)
   {
     cur_symbol = sym_table + hash_table[cur_index + 2];
     if (strcmp(name, str_table + cur_symbol->st_name) == 0)
     {
       if (cur_symbol->st_shndx == STN_UNDEF) break;
       return(cur_symbol);
     }
     cur_index = hash_table[cur_index + 2 + nbucket];
   }


Top
  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 1 post ] 

All times are UTC - 6 hours


Who is online

Users browsing this forum: Bing [Bot], Google [Bot], Majestic-12 [Bot] and 117 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group