2016-12-29 03:53:45 +00:00
|
|
|
https://sourceware.org/bugzilla/show_bug.cgi?id=21002
|
|
|
|
|
2018-06-17 09:08:51 +00:00
|
|
|
--- a/lib/system.h
|
|
|
|
+++ b/lib/system.h
|
2018-12-20 17:07:40 +00:00
|
|
|
@@ -30,7 +30,18 @@
|
2017-05-05 23:05:56 +00:00
|
|
|
#define LIB_SYSTEM_H 1
|
2015-06-14 17:43:40 +00:00
|
|
|
|
2018-09-18 04:07:57 +00:00
|
|
|
#include <errno.h>
|
|
|
|
-#include <error.h>
|
2016-12-29 03:53:45 +00:00
|
|
|
+#ifdef HAVE_ERROR_H
|
|
|
|
+#include "error.h"
|
|
|
|
+#else
|
|
|
|
+#include "err.h"
|
2017-05-05 23:05:56 +00:00
|
|
|
+#include <stdio.h>
|
2018-12-20 17:07:40 +00:00
|
|
|
+#define error(status, errno, ...) \
|
|
|
|
+ do { \
|
|
|
|
+ fflush(stdout); \
|
|
|
|
+ warn(__VA_ARGS__); \
|
|
|
|
+ if (status) exit(status); \
|
|
|
|
+ } while(0)
|
2015-06-14 17:43:40 +00:00
|
|
|
+#endif
|
2017-05-05 23:05:56 +00:00
|
|
|
#include <stddef.h>
|
|
|
|
#include <stdint.h>
|
|
|
|
#include <sys/param.h>
|
2018-12-20 17:07:40 +00:00
|
|
|
@@ -38,6 +49,10 @@
|
2017-05-05 23:05:56 +00:00
|
|
|
#include <byteswap.h>
|
|
|
|
#include <unistd.h>
|
|
|
|
|
2016-12-29 03:53:45 +00:00
|
|
|
+#ifndef __GLIBC__
|
|
|
|
+#define canonicalize_file_name(name) realpath(name,NULL)
|
|
|
|
+#endif
|
2017-05-05 23:05:56 +00:00
|
|
|
+
|
|
|
|
#if __BYTE_ORDER == __LITTLE_ENDIAN
|
|
|
|
# define LE32(n) (n)
|
|
|
|
# define LE64(n) (n)
|
2018-06-17 09:08:51 +00:00
|
|
|
--- a/libdw/libdw_alloc.c
|
|
|
|
+++ b/libdw/libdw_alloc.c
|
2018-09-18 04:07:57 +00:00
|
|
|
@@ -73,5 +73,5 @@ __attribute ((noreturn)) attribute_hidde
|
2015-06-14 17:43:40 +00:00
|
|
|
__libdw_oom (void)
|
|
|
|
{
|
|
|
|
while (1)
|
|
|
|
- error (EXIT_FAILURE, ENOMEM, "libdw");
|
2016-12-29 03:53:45 +00:00
|
|
|
+ error (EXIT_FAILURE, errno, gettext ("cannot allocate memory"));
|
2015-06-14 17:43:40 +00:00
|
|
|
}
|
2018-06-17 09:08:51 +00:00
|
|
|
--- a/libdwfl/dwfl_error.c
|
|
|
|
+++ b/libdwfl/dwfl_error.c
|
2019-09-05 23:57:39 +00:00
|
|
|
@@ -154,7 +154,7 @@ dwfl_errmsg (int error)
|
2015-06-14 17:43:40 +00:00
|
|
|
switch (error &~ 0xffff)
|
|
|
|
{
|
|
|
|
case OTHER_ERROR (ERRNO):
|
|
|
|
- return strerror_r (error & 0xffff, "bad", 0);
|
2019-09-05 23:57:39 +00:00
|
|
|
+ return strerror_l (error & 0xffff, LC_GLOBAL_LOCALE);
|
2015-06-14 17:43:40 +00:00
|
|
|
case OTHER_ERROR (LIBELF):
|
|
|
|
return elf_errmsg (error & 0xffff);
|
|
|
|
case OTHER_ERROR (LIBDW):
|