OpenSolaris

Printable Version Enter a New Search
Bug ID 6597841
Synopsis gelf_getdyn() reads one too many dynamic entries
State 10-Fix Delivered (Fix available in build)
Category:Subcategory library:libelf
Keywords
Responsible Engineer Ali Bahrami
Reported Against
Duplicate Of
Introduced In
Commit to Fix snv_73
Fixed In snv_73
Release Fixed solaris_nevada(snv_73)
Related Bugs
Submit Date 27-August-2007
Last Update Date 15-September-2007
Description
The following code:

   while ((gelf_getdyn(data_dyn, t, &gd))) {
   .....
   }

will read one too many .dynamic entries - if you're lucky, the data within
the section that follows the .dynamic section will have a value that can be
interpreted as a DT_ flag :-)
Work Around
Instead of the while loop, compute the number of dynamic entries (shdr.sh_size /
shdr.sh_entsize) and look at just that number of entries.
Comments
N/A