From 8c2ea6b20a48d626d3dae78ac177affb7f67e182 Mon Sep 17 00:00:00 2001 From: Ian Lance Taylor Date: Fri, 22 Sep 2017 13:38:10 +0000 Subject: 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 --- libbacktrace/elf.c | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) (limited to 'libbacktrace/elf.c') 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. */ -- cgit v1.2.3