This is the mail archive of the
elfutils-devel@sourceware.org
mailing list for the elfutils project.
data = elf_getdata(scn, data) returns garbage for shdr.sh_type == SHT_NOBITS
- From: Anthony G. Basile <basile at opensource dot dyc dot edu>
- To: elfutils-devel at lists dot fedorahosted dot org
- Date: Mon, 11 Jul 2011 11:02:16 -0400
- Subject: data = elf_getdata(scn, data) returns garbage for shdr.sh_type == SHT_NOBITS
Hi everyone,
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
no patch.
--
Anthony G. Basile, Ph. D.
Chair of Information Technology
D'Youville College
Buffalo, NY 14201
(716) 829-8197