1 https://sourceware.org/bugzilla/show_bug.cgi?id=21002
15 +#define error(status, errno, ...) \
17 + warn(__VA_ARGS__); \
18 + if (status) exit(status)
22 #include <sys/param.h>
28 +#define canonicalize_file_name(name) realpath(name,NULL)
31 #if __BYTE_ORDER == __LITTLE_ENDIAN
34 --- a/libdw/libdw_alloc.c
35 +++ b/libdw/libdw_alloc.c
36 @@ -73,5 +73,5 @@ __attribute ((noreturn)) attribute_hidde
40 - error (EXIT_FAILURE, ENOMEM, "libdw");
41 + error (EXIT_FAILURE, errno, gettext ("cannot allocate memory"));
43 --- a/libdwfl/dwfl_error.c
44 +++ b/libdwfl/dwfl_error.c
45 @@ -140,6 +140,7 @@ __libdwfl_seterrno (Dwfl_Error error)
47 dwfl_errmsg (int error)
49 + static __thread char s[64] = "";
50 if (error == 0 || error == -1)
52 int last_error = global_error;
53 @@ -154,7 +155,8 @@ dwfl_errmsg (int error)
54 switch (error &~ 0xffff)
56 case OTHER_ERROR (ERRNO):
57 - return strerror_r (error & 0xffff, "bad", 0);
58 + strerror_r (error & 0xffff, s, sizeof(s));
60 case OTHER_ERROR (LIBELF):
61 return elf_errmsg (error & 0xffff);
62 case OTHER_ERROR (LIBDW):