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:06:54 -0700
commitd9b061db93d777650d7d16b5ce687639a84a22c0 (patch)
tree4a7f9a53d5681281f1724f71d09c10cd23dd28c5
parent0ce3bf0f3608b310401d9c49fb3f8562d0133cf5 (diff)
downloadlibunwind-d9b061db93d777650d7d16b5ce687639a84a22c0.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;
}