summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStephen Webb <swebb@blackberry.com>2020-06-23 16:48:07 -0400
committerDave Watson <dade.watson@gmail.com>2020-07-02 16:07:49 -0700
commit475e7c4110fb83c8d4cf285b774b27c4395c148c (patch)
tree39dd661c282069496f0d0020028d71774f799f81
parent6e9f3999d00856d6534a9179dbc18d59ff8a5748 (diff)
downloadlibunwind-475e7c4110fb83c8d4cf285b774b27c4395c148c.tar.gz
Make SHF_COMPRESSED use contingent on its existence
A recent change broke builds for many non-recent and non-Linux targets by adding code dependent on a non-portable preprocessor macro SHF_COMPRESSED found in some more recent GLIBC elf.h headers. This fixes the firt part of #190. Signed-off-by: Stephen Webb <swebb@blackberry.com>
-rw-r--r--src/dwarf/Gfind_proc_info-lsb.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/dwarf/Gfind_proc_info-lsb.c b/src/dwarf/Gfind_proc_info-lsb.c
index 0cfb4d4f..7ab60a3f 100644
--- a/src/dwarf/Gfind_proc_info-lsb.c
+++ b/src/dwarf/Gfind_proc_info-lsb.c
@@ -127,6 +127,7 @@ load_debug_frame (const char *file, char **buf, size_t *bufsize, int is_local)
return 1;
}
+#if defined(SHF_COMPRESSED)
if (shdr->sh_flags & SHF_COMPRESSED)
{
unsigned long destSize;
@@ -161,6 +162,7 @@ load_debug_frame (const char *file, char **buf, size_t *bufsize, int is_local)
}
else
{
+#endif
*bufsize = shdr->sh_size;
GET_MEMORY(*buf, *bufsize);
@@ -168,7 +170,9 @@ load_debug_frame (const char *file, char **buf, size_t *bufsize, int is_local)
Debug (4, "read %zd bytes of .debug_frame from offset %zd\n",
*bufsize, shdr->sh_offset);
+#if defined(SHF_COMPRESSED)
}
+#endif
munmap(ei.image, ei.size);
return 0;
}