diff options
| author | Alexander Kabaev <kan@FreeBSD.org> | 2011-01-25 19:17:50 +0000 |
|---|---|---|
| committer | Alexander Kabaev <kan@FreeBSD.org> | 2011-01-25 19:17:50 +0000 |
| commit | 1bc9325f8ac05aa5b6fca13777a995ae79f93281 (patch) | |
| tree | 3a1f40a4b43cfcb9543abe4045112ccf4c0d5637 /lib/libelf | |
| parent | f9ad4da76d9b05650f0aafa761644798be9cedbf (diff) | |
Notes
Diffstat (limited to 'lib/libelf')
| -rw-r--r-- | lib/libelf/elf_data.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/libelf/elf_data.c b/lib/libelf/elf_data.c index 9241b09dce18..b8c10de0ac20 100644 --- a/lib/libelf/elf_data.c +++ b/lib/libelf/elf_data.c @@ -115,8 +115,10 @@ elf_getdata(Elf_Scn *s, Elf_Data *d) d->d_type = elftype; d->d_version = e->e_version; - if (sh_type == SHT_NOBITS) + if (sh_type == SHT_NOBITS || sh_size == 0) { + STAILQ_INSERT_TAIL(&s->s_data, d, d_next); return (d); + } if ((d->d_buf = malloc(msz*count)) == NULL) { (void) _libelf_release_data(d); |
