aboutsummaryrefslogtreecommitdiff
path: root/libbacktrace/elf.c
diff options
context:
space:
mode:
authorIan Lance Taylor <iant@golang.org>2017-09-22 13:38:10 +0000
committerIan Lance Taylor <ian@gcc.gnu.org>2017-09-22 13:38:10 +0000
commit8c2ea6b20a48d626d3dae78ac177affb7f67e182 (patch)
tree45668dec72f6f6dbdf72fb967ca86b70695798e0 /libbacktrace/elf.c
parent4d6e2f33a437fc6ead8218bf5f0e2cdb3e834d9e (diff)
re PR sanitizer/77631 (no symbols in backtrace shown by ASan when debug info is split)
PR sanitizer/77631 * configure.ac: Check for lstat and readlink. * elf.c (lstat, readlink): Provide dummy versions if real versions are not available. * configure, config.h.in: Rebuild. From-SVN: r253095
Diffstat (limited to 'libbacktrace/elf.c')
-rw-r--r--libbacktrace/elf.c29
1 files changed, 29 insertions, 0 deletions
diff --git a/libbacktrace/elf.c b/libbacktrace/elf.c
index eb7d303712a..fac46860a54 100644
--- a/libbacktrace/elf.c
+++ b/libbacktrace/elf.c
@@ -75,6 +75,35 @@ xstrnlen (const char *s, size_t maxlen)
#endif
+#ifndef HAVE_LSTAT
+
+/* Dummy version of lstat for systems that don't have it. */
+
+static int
+xlstat (const char *path ATTRIBUTE_UNUSED, struct stat *st ATTRIBUTE_UNUSED)
+{
+ return -1;
+}
+
+#define lstat xlstat
+
+#endif
+
+#ifndef HAVE_READLINK
+
+/* Dummy version of readlink for systems that don't have it. */
+
+static ssize_t
+xreadlink (const char *path ATTRIBUTE_UNUSED, char *buf ATTRIBUTE_UNUSED,
+ size_t bufsz ATTRIBUTE_UNUSED)
+{
+ return -1;
+}
+
+#define readlink xreadlink
+
+#endif
+
#ifndef HAVE_DL_ITERATE_PHDR
/* Dummy version of dl_iterate_phdr for systems that don't have it. */