aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.8/libbacktrace/elf.c
diff options
context:
space:
mode:
authorAndrew Hsieh <andrewhsieh@google.com>2014-06-20 13:50:27 +0000
committerGerrit Code Review <noreply-gerritcodereview@google.com>2014-06-20 02:04:52 +0000
commit3c447213baf828ebd01c45ad459552b3c9922c92 (patch)
tree198ed6386925c6ff5c24faf686b836aa74082836 /gcc-4.8/libbacktrace/elf.c
parente1be674a8e345aaa025ad9f1d38bab4272301e1d (diff)
parentf190d6284359da8ae8694b2d2e14b01602a959ed (diff)
downloadtoolchain_gcc-3c447213baf828ebd01c45ad459552b3c9922c92.tar.gz
toolchain_gcc-3c447213baf828ebd01c45ad459552b3c9922c92.tar.bz2
toolchain_gcc-3c447213baf828ebd01c45ad459552b3c9922c92.zip
Merge "Merge GCC 4.8.3"
Diffstat (limited to 'gcc-4.8/libbacktrace/elf.c')
-rw-r--r--gcc-4.8/libbacktrace/elf.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/gcc-4.8/libbacktrace/elf.c b/gcc-4.8/libbacktrace/elf.c
index ef9bcdfb4..9d2dfd3fe 100644
--- a/gcc-4.8/libbacktrace/elf.c
+++ b/gcc-4.8/libbacktrace/elf.c
@@ -725,6 +725,8 @@ elf_add (struct backtrace_state *state, int descriptor, uintptr_t base_address,
{
off_t end;
+ if (sections[i].size == 0)
+ continue;
if (min_offset == 0 || sections[i].offset < min_offset)
min_offset = sections[i].offset;
end = sections[i].offset + sections[i].size;
@@ -751,8 +753,13 @@ elf_add (struct backtrace_state *state, int descriptor, uintptr_t base_address,
descriptor = -1;
for (i = 0; i < (int) DEBUG_MAX; ++i)
+ {
+ if (sections[i].size == 0)
+ sections[i].data = NULL;
+ else
sections[i].data = ((const unsigned char *) debug_view.data
+ (sections[i].offset - min_offset));
+ }
if (!backtrace_dwarf_add (state, base_address,
sections[DEBUG_INFO].data,