Length of ELF dynamic symbol table
Posted: Wed Dec 07, 2011 9:27 pm
Hi,
I'm implementing dynamic linking, and I'm having trouble with lookups in the dynamic symbol table. I can't figure out how to determine the number of entries in the table, so I can't prevent myself from running off the end of the table if a symbol is not found in a shared object. The DYNAMIC segment doesn't seem to have any sort of "SYMSZ" or equivalent entry, and I can't look up the size of .dynsym because the object is already loaded into memory (and I assume is no longer guaranteed to have that information; I also wouldn't want to, because it's annoyingly complex to do.) There also doesn't seem to be any sort of terminating entry according to the specification.
How do I determine the length of the table?
I'm implementing dynamic linking, and I'm having trouble with lookups in the dynamic symbol table. I can't figure out how to determine the number of entries in the table, so I can't prevent myself from running off the end of the table if a symbol is not found in a shared object. The DYNAMIC segment doesn't seem to have any sort of "SYMSZ" or equivalent entry, and I can't look up the size of .dynsym because the object is already loaded into memory (and I assume is no longer guaranteed to have that information; I also wouldn't want to, because it's annoyingly complex to do.) There also doesn't seem to be any sort of terminating entry according to the specification.
How do I determine the length of the table?