A few days ago I was was writing some code to go over the data of
various sections. I know that sections marked SHT_NOBITS don't have
data, but I was expecting data = elf_getdata(scn, data) to return NULL.
Instead it return some value which, of course, proptly led to a seg
fault when I tried to dereference it. Of course, I can fix this by
avoiding elf_getdata() if(shdr.sh_type == SHT_NOBITS) but it would
probably be a good idea if elf_getdata returned NULL. I haven't had
time to jump into the source to see where this might be added, ie sorry
Anthony G. Basile, Ph. D.
Chair of Information Technology
Buffalo, NY 14201
I am finding elfutils is failing to compile with gcc 4.7 (devel), and the attached patch helped fix the issue.
Please review/comment/accept the patch.
Nitin A Kamble