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