summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRoss Burton <ross.burton@intel.com>2018-07-04 12:11:08 +0100
committerMark Wielaard <mark@klomp.org>2018-07-05 21:06:40 +0200
commite893aab0d12284c8909ebacfca529c0b554abb9c (patch)
tree7c50c7de9492e68b36ef7dbfedca4404aa198c60
parentd612684109f0395b86e4aaad9ba94e02f79a099a (diff)
Consolidate error.h inclusion in system.h
error.h isn't standard and so isn't part of the musl C library. To easy future porting, consolidate the inclusion of error.h into system.h. https://sourceware.org/bugzilla/show_bug.cgi?id=21008 Signed-off-by: Ross Burton <ross.burton@intel.com>
-rw-r--r--lib/ChangeLog6
-rw-r--r--lib/color.c2
-rw-r--r--lib/system.h1
-rw-r--r--lib/xmalloc.c1
-rw-r--r--libasm/ChangeLog8
-rw-r--r--libasm/asm_end.c1
-rw-r--r--libasm/asm_newscn.c1
-rw-r--r--libcpu/i386_gendis.c3
-rw-r--r--libcpu/i386_lex.l2
-rw-r--r--libcpu/i386_parse.y1
-rw-r--r--libdw/ChangeLog4
-rw-r--r--libdw/libdw_alloc.c1
-rw-r--r--libebl/ChangeLog4
-rw-r--r--libebl/eblopenbackend.c1
-rw-r--r--src/ChangeLog19
-rw-r--r--src/addr2line.c1
-rw-r--r--src/ar.c1
-rw-r--r--src/arlib.c2
-rw-r--r--src/arlib2.c1
-rw-r--r--src/elfcmp.c3
-rw-r--r--src/elfcompress.c2
-rw-r--r--src/elflint.c1
-rw-r--r--src/findtextrel.c3
-rw-r--r--src/nm.c1
-rw-r--r--src/objdump.c1
-rw-r--r--src/ranlib.c1
-rw-r--r--src/readelf.c1
-rw-r--r--src/size.c1
-rw-r--r--src/stack.c1
-rw-r--r--src/strings.c1
-rw-r--r--src/strip.c1
-rw-r--r--src/unstrip.c2
-rw-r--r--tests/ChangeLog37
-rw-r--r--tests/addrscopes.c2
-rw-r--r--tests/allregs.c2
-rw-r--r--tests/backtrace-data.c2
-rw-r--r--tests/backtrace-dwarf.c2
-rw-r--r--tests/backtrace.c2
-rw-r--r--tests/buildid.c2
-rw-r--r--tests/debugaltlink.c2
-rw-r--r--tests/debuglink.c2
-rw-r--r--tests/deleted.c1
-rw-r--r--tests/dwarfcfi.c2
-rw-r--r--tests/dwfl-addr-sect.c2
-rw-r--r--tests/dwfl-bug-addr-overflow.c1
-rw-r--r--tests/dwfl-bug-fd-leak.c2
-rw-r--r--tests/dwfl-bug-getmodules.c2
-rw-r--r--tests/dwfl-proc-attach.c2
-rw-r--r--tests/dwfl-report-elf-align.c2
-rw-r--r--tests/dwfllines.c2
-rw-r--r--tests/dwflmodtest.c2
-rw-r--r--tests/dwflsyms.c1
-rw-r--r--tests/early-offscn.c2
-rw-r--r--tests/ecp.c2
-rw-r--r--tests/elfstrmerge.c1
-rw-r--r--tests/find-prologues.c2
-rw-r--r--tests/funcretval.c2
-rw-r--r--tests/funcscopes.c2
-rw-r--r--tests/getsrc_die.c2
-rw-r--r--tests/line2addr.c2
-rw-r--r--tests/low_high_pc.c1
-rw-r--r--tests/next_cfi.c2
-rw-r--r--tests/rdwrmmap.c2
-rw-r--r--tests/saridx.c2
-rw-r--r--tests/sectiondump.c2
-rw-r--r--tests/varlocs.c2
-rw-r--r--tests/vdsosyms.c2
67 files changed, 116 insertions, 63 deletions
diff --git a/lib/ChangeLog b/lib/ChangeLog
index fbe34a82..86a53d2c 100644
--- a/lib/ChangeLog
+++ b/lib/ChangeLog
@@ -1,3 +1,9 @@
+2018-07-04 Ross Burton <ross.burton@intel.com>
+
+ * color.c: Remove error.h, add system.h include.
+ * system.h: Add error.h include.
+ * xmalloc.c: Remove error.h include.
+
2018-06-01 Mark Wielaard <mark@klomp.org>
* printversion.c (print_version): Update copyright year.
diff --git a/lib/color.c b/lib/color.c
index f62389d5..9ffbf55f 100644
--- a/lib/color.c
+++ b/lib/color.c
@@ -32,11 +32,11 @@
#endif
#include <argp.h>
-#include <error.h>
#include <libintl.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
+#include "system.h"
#include "libeu.h"
#include "color.h"
diff --git a/lib/system.h b/lib/system.h
index 92033355..292082bd 100644
--- a/lib/system.h
+++ b/lib/system.h
@@ -30,6 +30,7 @@
#define LIB_SYSTEM_H 1
#include <errno.h>
+#include <error.h>
#include <stddef.h>
#include <stdint.h>
#include <sys/param.h>
diff --git a/lib/xmalloc.c b/lib/xmalloc.c
index 0cde384f..0424afc8 100644
--- a/lib/xmalloc.c
+++ b/lib/xmalloc.c
@@ -30,7 +30,6 @@
# include <config.h>
#endif
-#include <error.h>
#include <libintl.h>
#include <stddef.h>
#include <stdlib.h>
diff --git a/libasm/ChangeLog b/libasm/ChangeLog
index fffcced0..2efd85fa 100644
--- a/libasm/ChangeLog
+++ b/libasm/ChangeLog
@@ -1,3 +1,11 @@
+2018-07-04 Ross Burton <ross.burton@intel.com>
+
+ * asm_end.c: Remove error.h include.
+ * asm_newscn.c: Likewise.
+ * i386_gendis.c: Likewise and add system.h include.
+ * i386_lex.l: Likewise.
+ * i386_parse.y: Likewise.
+
2017-02-27 Ulf Hermann <ulf.hermann@qt.io>
* Makefile.am: Use dso_LDFLAGS.
diff --git a/libasm/asm_end.c b/libasm/asm_end.c
index ced24f50..5aab8dfa 100644
--- a/libasm/asm_end.c
+++ b/libasm/asm_end.c
@@ -32,7 +32,6 @@
#endif
#include <assert.h>
-#include <error.h>
#include <libintl.h>
#include <stdio.h>
#include <stdlib.h>
diff --git a/libasm/asm_newscn.c b/libasm/asm_newscn.c
index ddbb25df..7cdf484f 100644
--- a/libasm/asm_newscn.c
+++ b/libasm/asm_newscn.c
@@ -32,7 +32,6 @@
#endif
#include <assert.h>
-#include <error.h>
#include <libintl.h>
#include <stdlib.h>
#include <string.h>
diff --git a/libcpu/i386_gendis.c b/libcpu/i386_gendis.c
index aae5eae6..37d2ecd6 100644
--- a/libcpu/i386_gendis.c
+++ b/libcpu/i386_gendis.c
@@ -31,12 +31,11 @@
# include <config.h>
#endif
-#include <error.h>
#include <errno.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
-
+#include "system.h"
extern int i386_parse (void);
diff --git a/libcpu/i386_lex.l b/libcpu/i386_lex.l
index ef1b53b6..a4705aa9 100644
--- a/libcpu/i386_lex.l
+++ b/libcpu/i386_lex.l
@@ -31,10 +31,10 @@
#endif
#include <ctype.h>
-#include <error.h>
#include <libintl.h>
#include <libeu.h>
+#include "system.h"
#include "i386_parse.h"
diff --git a/libcpu/i386_parse.y b/libcpu/i386_parse.y
index 5fc06825..910d5458 100644
--- a/libcpu/i386_parse.y
+++ b/libcpu/i386_parse.y
@@ -34,7 +34,6 @@
#include <assert.h>
#include <ctype.h>
#include <errno.h>
-#include <error.h>
#include <inttypes.h>
#include <libintl.h>
#include <math.h>
diff --git a/libdw/ChangeLog b/libdw/ChangeLog
index da7ed9d0..cb4f34ed 100644
--- a/libdw/ChangeLog
+++ b/libdw/ChangeLog
@@ -1,3 +1,7 @@
+2018-07-04 Ross Burton <ross.burton@intel.com>
+
+ * libdw_alloc.c: Remove error.h include.
+
2018-06-28 Mark Wielaard <mark@klomp.org>
* dwarf_next_cfi.c (dwarf_next_cfi): Check whether length is zero.
diff --git a/libdw/libdw_alloc.c b/libdw/libdw_alloc.c
index d6af23a2..f1e08714 100644
--- a/libdw/libdw_alloc.c
+++ b/libdw/libdw_alloc.c
@@ -31,7 +31,6 @@
# include <config.h>
#endif
-#include <error.h>
#include <errno.h>
#include <stdlib.h>
#include "libdwP.h"
diff --git a/libebl/ChangeLog b/libebl/ChangeLog
index aa82e3a1..f76afd10 100644
--- a/libebl/ChangeLog
+++ b/libebl/ChangeLog
@@ -1,3 +1,7 @@
+2018-07-04 Ross Burton <ross.burton@intel.com>
+
+ * eblopenbackend.c: Remove error.h include.
+
2018-04-25 Mark Wielaard <mark@klomp.org>
* eblopenbackend.c (default_debugscn_p): Add new DWARF5 sections
diff --git a/libebl/eblopenbackend.c b/libebl/eblopenbackend.c
index 8b063f41..1962e608 100644
--- a/libebl/eblopenbackend.c
+++ b/libebl/eblopenbackend.c
@@ -32,7 +32,6 @@
#include <assert.h>
#include <dlfcn.h>
-#include <error.h>
#include <libelfP.h>
#include <dwarf.h>
#include <stdlib.h>
diff --git a/src/ChangeLog b/src/ChangeLog
index 6d962bbb..606a5973 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,22 @@
+2018-07-04 Ross Burton <ross.burton@intel.com>
+
+ * addr2line.c: Remove error.h include.
+ * ar.c: Likewise.
+ * arlib.c: Likewise and add system.h include.
+ * arlib2.c: Likewise.
+ * elfcmp.c: Likewise.
+ * elfcompress.c: Likewise.
+ * elflint.c: Likewise.
+ * findtextrel.c: Likewise.
+ * nm.c: Likewise.
+ * objdump.c: Likewise.
+ * ranlib.c: Likewise.
+ * readelf.c: Likewise.
+ * stack.c: Likewise.
+ * strings.c: Likewise.
+ * strip.c: Likewise.
+ * unstrip.c: Likewise.
+
2018-06-25 Mark Wielaard <mark@klomp.org>
* readelf.c (print_decoded_line_section): Use dwarf_next_lines
diff --git a/src/addr2line.c b/src/addr2line.c
index 5acafa00..b7eb893e 100644
--- a/src/addr2line.c
+++ b/src/addr2line.c
@@ -23,7 +23,6 @@
#include <argp.h>
#include <assert.h>
#include <errno.h>
-#include <error.h>
#include <fcntl.h>
#include <inttypes.h>
#include <libdwfl.h>
diff --git a/src/ar.c b/src/ar.c
index 818115bd..6f98f75d 100644
--- a/src/ar.c
+++ b/src/ar.c
@@ -22,7 +22,6 @@
#include <argp.h>
#include <assert.h>
-#include <error.h>
#include <fcntl.h>
#include <gelf.h>
#include <libintl.h>
diff --git a/src/arlib.c b/src/arlib.c
index e0839aab..778e0878 100644
--- a/src/arlib.c
+++ b/src/arlib.c
@@ -21,7 +21,6 @@
#endif
#include <assert.h>
-#include <error.h>
#include <gelf.h>
#include <inttypes.h>
#include <libintl.h>
@@ -31,6 +30,7 @@
#include <libeu.h>
+#include "system.h"
#include "arlib.h"
diff --git a/src/arlib2.c b/src/arlib2.c
index 553fc57b..11f44e5d 100644
--- a/src/arlib2.c
+++ b/src/arlib2.c
@@ -20,7 +20,6 @@
# include <config.h>
#endif
-#include <error.h>
#include <libintl.h>
#include <limits.h>
#include <string.h>
diff --git a/src/elfcmp.c b/src/elfcmp.c
index 50464207..b40df8bf 100644
--- a/src/elfcmp.c
+++ b/src/elfcmp.c
@@ -23,7 +23,6 @@
#include <argp.h>
#include <assert.h>
#include <errno.h>
-#include <error.h>
#include <fcntl.h>
#include <locale.h>
#include <libintl.h>
@@ -36,7 +35,7 @@
#include <printversion.h>
#include "../libelf/elf-knowledge.h"
#include "../libebl/libeblP.h"
-
+#include "system.h"
/* Prototypes of local functions. */
static Elf *open_file (const char *fname, int *fdp, Ebl **eblp);
diff --git a/src/elfcompress.c b/src/elfcompress.c
index 25378a45..bdb0e3b5 100644
--- a/src/elfcompress.c
+++ b/src/elfcompress.c
@@ -18,7 +18,6 @@
#include <config.h>
#include <assert.h>
#include <argp.h>
-#include <error.h>
#include <stdbool.h>
#include <stdlib.h>
#include <inttypes.h>
@@ -34,6 +33,7 @@
#include ELFUTILS_HEADER(ebl)
#include ELFUTILS_HEADER(dwelf)
#include <gelf.h>
+#include "system.h"
#include "libeu.h"
#include "printversion.h"
diff --git a/src/elflint.c b/src/elflint.c
index 0a26d97d..eec799b2 100644
--- a/src/elflint.c
+++ b/src/elflint.c
@@ -24,7 +24,6 @@
#include <assert.h>
#include <byteswap.h>
#include <endian.h>
-#include <error.h>
#include <fcntl.h>
#include <gelf.h>
#include <inttypes.h>
diff --git a/src/findtextrel.c b/src/findtextrel.c
index 8f1e239a..49731592 100644
--- a/src/findtextrel.c
+++ b/src/findtextrel.c
@@ -23,7 +23,6 @@
#include <argp.h>
#include <assert.h>
#include <errno.h>
-#include <error.h>
#include <fcntl.h>
#include <gelf.h>
#include <libdw.h>
@@ -37,7 +36,7 @@
#include <unistd.h>
#include <printversion.h>
-
+#include "system.h"
struct segments
{
diff --git a/src/nm.c b/src/nm.c
index 969c6d35..ffe8ca69 100644
--- a/src/nm.c
+++ b/src/nm.c
@@ -26,7 +26,6 @@
#include <ctype.h>
#include <dwarf.h>
#include <errno.h>
-#include <error.h>
#include <fcntl.h>
#include <gelf.h>
#include <inttypes.h>
diff --git a/src/objdump.c b/src/objdump.c
index 0dd9a6aa..6b365d5c 100644
--- a/src/objdump.c
+++ b/src/objdump.c
@@ -21,7 +21,6 @@
#endif
#include <argp.h>
-#include <error.h>
#include <fcntl.h>
#include <inttypes.h>
#include <libintl.h>
diff --git a/src/ranlib.c b/src/ranlib.c
index cc0ee233..b9083484 100644
--- a/src/ranlib.c
+++ b/src/ranlib.c
@@ -24,7 +24,6 @@
#include <argp.h>
#include <assert.h>
#include <errno.h>
-#include <error.h>
#include <fcntl.h>
#include <gelf.h>
#include <libintl.h>
diff --git a/src/readelf.c b/src/readelf.c
index faed61a6..7cf0d18a 100644
--- a/src/readelf.c
+++ b/src/readelf.c
@@ -24,7 +24,6 @@
#include <ctype.h>
#include <dwarf.h>
#include <errno.h>
-#include <error.h>
#include <fcntl.h>
#include <gelf.h>
#include <inttypes.h>
diff --git a/src/size.c b/src/size.c
index ad8dbcbb..5ff3f2af 100644
--- a/src/size.c
+++ b/src/size.c
@@ -21,7 +21,6 @@
#endif
#include <argp.h>
-#include <error.h>
#include <fcntl.h>
#include <gelf.h>
#include <inttypes.h>
diff --git a/src/stack.c b/src/stack.c
index 52ae3a86..c5f347e1 100644
--- a/src/stack.c
+++ b/src/stack.c
@@ -18,7 +18,6 @@
#include <config.h>
#include <assert.h>
#include <argp.h>
-#include <error.h>
#include <stdlib.h>
#include <inttypes.h>
#include <stdio.h>
diff --git a/src/strings.c b/src/strings.c
index 03d0f133..ef40d5ec 100644
--- a/src/strings.c
+++ b/src/strings.c
@@ -25,7 +25,6 @@
#include <ctype.h>
#include <endian.h>
#include <errno.h>
-#include <error.h>
#include <fcntl.h>
#include <gelf.h>
#include <inttypes.h>
diff --git a/src/strip.c b/src/strip.c
index 773ed548..791347c1 100644
--- a/src/strip.c
+++ b/src/strip.c
@@ -24,7 +24,6 @@
#include <assert.h>
#include <byteswap.h>
#include <endian.h>
-#include <error.h>
#include <fcntl.h>
#include <fnmatch.h>
#include <gelf.h>
diff --git a/src/unstrip.c b/src/unstrip.c
index f368e696..057efef3 100644
--- a/src/unstrip.c
+++ b/src/unstrip.c
@@ -31,7 +31,6 @@
#include <argp.h>
#include <assert.h>
#include <errno.h>
-#include <error.h>
#include <fcntl.h>
#include <fnmatch.h>
#include <libintl.h>
@@ -48,6 +47,7 @@
#include <gelf.h>
#include <libebl.h>
#include <libdwfl.h>
+#include "system.h"
#include "libdwelf.h"
#include "libeu.h"
#include "printversion.h"
diff --git a/tests/ChangeLog b/tests/ChangeLog
index 765a874b..61b50371 100644
--- a/tests/ChangeLog
+++ b/tests/ChangeLog
@@ -1,3 +1,40 @@
+2018-07-04 Ross Burton <ross.burton@intel.com>
+
+ * addrscopes.c: Remove error.h include, add system.h include.
+ * allregs.c: Likewise.
+ * backtrace-data.c: Likewise.
+ * backtrace-dwarf.c: Likewise.
+ * backtrace.c: Likewise.
+ * buildid.c: Likewise.
+ * debugaltlink.c: Likewise.
+ * debuglink.c: Likewise.
+ * deleted.c : Likewise.
+ * dwarfcfi.c: Likewise.
+ * dwfl-addr-sect.c: Likewise.
+ * dwfl-bug-addr-overflow.c: Likewise.
+ * dwfl-bug-fd-leak.c: Likewise.
+ * dwfl-bug-getmodules.c: Likewise.
+ * dwfl-proc-attach.c: Likewise.
+ * dwfl-report-elf-align.c: Likewise.
+ * dwfllines.c: Likewise.
+ * dwflmodtest.c: Likewise.
+ * dwflsyms.c: Likewise.
+ * early-offscn.c: Likewise
+ * ecp.c: Likewise.
+ * elfstrmerge.c: Likewise.
+ * find-prologues.c: Likewise.
+ * funcretval.c: Likewise.
+ * funcscopes.c: Likewise.
+ * getsrc_die.c: Likewise.
+ * line2addr.c: Likewise.
+ * low_high_pc.c: Likewise.
+ * next_cfi.c: Likewise.
+ * rdwrmmap.c: Likewise.
+ * saridx.c: Likewise.
+ * sectiondump.c: Likewise.
+ * varlocs.c: Likewise.
+ * vdsosyms.c: Likewise.
+
2018-06-28 Mark Wielaard <mark@klomp.org>
* next_cfi.c: New file.
diff --git a/tests/addrscopes.c b/tests/addrscopes.c
index 791569f5..b231b6a9 100644
--- a/tests/addrscopes.c
+++ b/tests/addrscopes.c
@@ -25,8 +25,8 @@
#include <stdio_ext.h>
#include <locale.h>
#include <stdlib.h>
-#include <error.h>
#include <string.h>
+#include "system.h"
static void
diff --git a/tests/allregs.c b/tests/allregs.c
index 286f7e3c..f18f0b28 100644
--- a/tests/allregs.c
+++ b/tests/allregs.c
@@ -21,13 +21,13 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
-#include <error.h>
#include <locale.h>
#include <argp.h>
#include <assert.h>
#include ELFUTILS_HEADER(dwfl)
#include <dwarf.h>
+#include "system.h"
#include "../libdw/known-dwarf.h"
static const char *
diff --git a/tests/backtrace-data.c b/tests/backtrace-data.c
index a387d8ff..67ecd475 100644
--- a/tests/backtrace-data.c
+++ b/tests/backtrace-data.c
@@ -27,7 +27,6 @@
#include <dirent.h>
#include <stdlib.h>
#include <errno.h>
-#include <error.h>
#include <unistd.h>
#include <dwarf.h>
#if defined(__x86_64__) && defined(__linux__)
@@ -41,6 +40,7 @@
#include <string.h>
#include ELFUTILS_HEADER(dwfl)
#endif
+#include "system.h"
#if !defined(__x86_64__) || !defined(__linux__)
diff --git a/tests/backtrace-dwarf.c b/tests/backtrace-dwarf.c
index 7ff826cd..e1eb4928 100644
--- a/tests/backtrace-dwarf.c
+++ b/tests/backtrace-dwarf.c
@@ -21,10 +21,10 @@
#include <stdio_ext.h>
#include <locale.h>
#include <errno.h>
-#include <error.h>
#include <unistd.h>
#include <sys/types.h>
#include ELFUTILS_HEADER(dwfl)
+#include "system.h"
#ifndef __linux__
diff --git a/tests/backtrace.c b/tests/backtrace.c
index f5dd761f..24ab68dd 100644
--- a/tests/backtrace.c
+++ b/tests/backtrace.c
@@ -24,7 +24,6 @@
#include <dirent.h>
#include <stdlib.h>
#include <errno.h>
-#include <error.h>
#include <unistd.h>
#include <dwarf.h>
#ifdef __linux__
@@ -39,6 +38,7 @@
#include <argp.h>
#include ELFUTILS_HEADER(dwfl)
#endif
+#include "system.h"
#ifndef __linux__
diff --git a/tests/buildid.c b/tests/buildid.c
index 87c18773..2390eff7 100644
--- a/tests/buildid.c
+++ b/tests/buildid.c
@@ -23,13 +23,13 @@
#include ELFUTILS_HEADER(elf)
#include ELFUTILS_HEADER(dwelf)
#include <stdio.h>
-#include <error.h>
#include <string.h>
#include <stdlib.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <unistd.h>
+#include "system.h"
int
main (int argc, char *argv[])
diff --git a/tests/debugaltlink.c b/tests/debugaltlink.c
index 6d97d500..e7dc8623 100644
--- a/tests/debugaltlink.c
+++ b/tests/debugaltlink.c
@@ -23,13 +23,13 @@
#include ELFUTILS_HEADER(dw)
#include ELFUTILS_HEADER(dwelf)
#include <stdio.h>
-#include <error.h>
#include <string.h>
#include <stdlib.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <unistd.h>
+#include "system.h"
int
main (int argc, char *argv[])
diff --git a/tests/debuglink.c b/tests/debuglink.c
index 935d1029..f92b9b59 100644
--- a/tests/debuglink.c
+++ b/tests/debuglink.c
@@ -21,13 +21,13 @@
#include <errno.h>
#include ELFUTILS_HEADER(dwelf)
#include <stdio.h>
-#include <error.h>
#include <string.h>
#include <stdlib.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <unistd.h>
+#include "system.h"
int
main (int argc, char *argv[])
diff --git a/tests/deleted.c b/tests/deleted.c
index 6be35bc2..f4e8f768 100644
--- a/tests/deleted.c
+++ b/tests/deleted.c
@@ -21,7 +21,6 @@
#include <unistd.h>
#include <assert.h>
#include <stdio.h>
-#include <error.h>
#include <errno.h>
#ifdef __linux__
#include <sys/prctl.h>
diff --git a/tests/dwarfcfi.c b/tests/dwarfcfi.c
index db4a36ff..29849e71 100644
--- a/tests/dwarfcfi.c
+++ b/tests/dwarfcfi.c
@@ -18,7 +18,6 @@
#include <config.h>
#include <assert.h>
#include <inttypes.h>
-#include <error.h>
#include ELFUTILS_HEADER(dw)
#include <dwarf.h>
#include <argp.h>
@@ -30,6 +29,7 @@
#include <stdlib.h>
#include <string.h>
+#include "system.h"
#include "../libdw/known-dwarf.h"
static const char *
diff --git a/tests/dwfl-addr-sect.c b/tests/dwfl-addr-sect.c
index 21e470a3..4d85c007 100644
--- a/tests/dwfl-addr-sect.c
+++ b/tests/dwfl-addr-sect.c
@@ -23,11 +23,11 @@
#include <stdio_ext.h>
#include <stdlib.h>
#include <string.h>
-#include <error.h>
#include <locale.h>
#include <argp.h>
#include ELFUTILS_HEADER(dwfl)
#include <dwarf.h>
+#include "system.h"
static int
handle_address (Dwfl *dwfl, Dwarf_Addr address)
diff --git a/tests/dwfl-bug-addr-overflow.c b/tests/dwfl-bug-addr-overflow.c
index aa8030e1..9a3373a6 100644
--- a/tests/dwfl-bug-addr-overflow.c
+++ b/tests/dwfl-bug-addr-overflow.c
@@ -20,7 +20,6 @@
#include <inttypes.h>
#include <stdio.h>
#include <stdio_ext.h>
-#include <error.h>
#include <locale.h>
#include ELFUTILS_HEADER(dwfl)
diff --git a/tests/dwfl-bug-fd-leak.c b/tests/dwfl-bug-fd-leak.c
index 689cdd79..ee3a916b 100644
--- a/tests/dwfl-bug-fd-leak.c
+++ b/tests/dwfl-bug-fd-leak.c
@@ -24,9 +24,9 @@
#include <dirent.h>
#include <stdlib.h>
#include <errno.h>
-#include <error.h>
#include <unistd.h>
#include <dwarf.h>
+#include "system.h"
#ifndef __linux__
int
diff --git a/tests/dwfl-bug-getmodules.c b/tests/dwfl-bug-getmodules.c
index 1ee989f8..2783f65c 100644
--- a/tests/dwfl-bug-getmodules.c
+++ b/tests/dwfl-bug-getmodules.c
@@ -17,8 +17,8 @@
#include <config.h>
#include ELFUTILS_HEADER(dwfl)
+#include "system.h"
-#include <error.h>
static const Dwfl_Callbacks callbacks =
{
diff --git a/tests/dwfl-proc-attach.c b/tests/dwfl-proc-attach.c
index e7bb2010..102ba181 100644
--- a/tests/dwfl-proc-attach.c
+++ b/tests/dwfl-proc-attach.c
@@ -20,7 +20,6 @@
#include <stdio.h>
#include <stdlib.h>
#include <errno.h>
-#include <error.h>
#include <unistd.h>
#ifdef __linux__
#include <sys/types.h>
@@ -31,6 +30,7 @@
#include ELFUTILS_HEADER(dwfl)
#include <pthread.h>
#endif
+#include "system.h"
#ifndef __linux__
int
diff --git a/tests/dwfl-report-elf-align.c b/tests/dwfl-report-elf-align.c
index a4e97d3c..6558ab81 100644
--- a/tests/dwfl-report-elf-align.c
+++ b/tests/dwfl-report-elf-align.c
@@ -20,11 +20,11 @@
#include <inttypes.h>
#include <stdio.h>
#include <stdio_ext.h>
-#include <error.h>
#include <locale.h>
#include <string.h>
#include <stdlib.h>
#include ELFUTILS_HEADER(dwfl)
+#include "system.h"
static const Dwfl_Callbacks offline_callbacks =
diff --git a/tests/dwfllines.c b/tests/dwfllines.c
index 90379dd2..d732e401 100644
--- a/tests/dwfllines.c
+++ b/tests/dwfllines.c
@@ -27,7 +27,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
-#include <error.h>
+#include "system.h"
int
main (int argc, char *argv[])
diff --git a/tests/dwflmodtest.c b/tests/dwflmodtest.c
index 0027f96b..9251d158 100644
--- a/tests/dwflmodtest.c
+++ b/tests/dwflmodtest.c
@@ -23,11 +23,11 @@
#include <stdio_ext.h>
#include <stdlib.h>
#include <string.h>
-#include <error.h>
#include <locale.h>
#include <argp.h>
#include ELFUTILS_HEADER(dwfl)
#include <dwarf.h>
+#include "system.h"
static bool show_inlines;
diff --git a/tests/dwflsyms.c b/tests/dwflsyms.c
index 49ac3346..bc23cb63 100644
--- a/tests/dwflsyms.c
+++ b/tests/dwflsyms.c
@@ -25,7 +25,6 @@
#include <stdio.h>
#include <stdio_ext.h>
#include <stdlib.h>
-#include <error.h>
#include <string.h>
static const char *
diff --git a/tests/early-offscn.c b/tests/early-offscn.c
index 924cb9ef..af29da5a 100644
--- a/tests/early-offscn.c
+++ b/tests/early-offscn.c
@@ -19,11 +19,11 @@
#endif
#include <errno.h>
-#include <error.h>
#include <fcntl.h>
#include <gelf.h>
#include <stdio.h>
#include <stdlib.h>
+#include "system.h"
int
main (int argc, char *argv[])
diff --git a/tests/ecp.c b/tests/ecp.c
index 38a6859e..1df40a32 100644
--- a/tests/ecp.c
+++ b/tests/ecp.c
@@ -20,11 +20,11 @@
#endif
#include <errno.h>
-#include <error.h>
#include <fcntl.h>
#include <gelf.h>
#include <stdlib.h>
#include <unistd.h>
+#include "system.h"
int
main (int argc, char *argv[])
diff --git a/tests/elfstrmerge.c b/tests/elfstrmerge.c
index 3bb90c42..ba0d68df 100644
--- a/tests/elfstrmerge.c
+++ b/tests/elfstrmerge.c
@@ -24,7 +24,6 @@
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
-#include <error.h>
#include <stdio.h>
#include <inttypes.h>
#include <unistd.h>
diff --git a/tests/find-prologues.c b/tests/find-prologues.c
index ba8ae371..b0bf9362 100644
--- a/tests/find-prologues.c
+++ b/tests/find-prologues.c
@@ -25,9 +25,9 @@
#include <stdio_ext.h>
#include <locale.h>
#include <stdlib.h>
-#include <error.h>
#include <string.h>
#include <fnmatch.h>
+#include "system.h"
struct args
diff --git a/tests/funcretval.c b/tests/funcretval.c
index 8d19d117..16cd1a44 100644
--- a/tests/funcretval.c
+++ b/tests/funcretval.c
@@ -25,9 +25,9 @@
#include <stdio_ext.h>
#include <locale.h>
#include <stdlib.h>
-#include <error.h>
#include <string.h>
#include <fnmatch.h>
+#include "system.h"
struct args
diff --git a/tests/funcscopes.c b/tests/funcscopes.c
index 9c901858..689d376a 100644
--- a/tests/funcscopes.c
+++ b/tests/funcscopes.c
@@ -25,9 +25,9 @@
#include <stdio_ext.h>
#include <locale.h>
#include <stdlib.h>
-#include <error.h>
#include <string.h>
#include <fnmatch.h>
+#include "system.h"
static void
diff --git a/tests/getsrc_die.c b/tests/getsrc_die.c
index 055aede0..f878fa62 100644
--- a/tests/getsrc_die.c
+++ b/tests/getsrc_die.c
@@ -19,7 +19,6 @@
#endif
#include <errno.h>
-#include <error.h>
#include <fcntl.h>
#include <inttypes.h>
#include <libelf.h>
@@ -27,6 +26,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
+#include "system.h"
int
diff --git a/tests/line2addr.c b/tests/line2addr.c
index e0d65d3d..663746fd 100644
--- a/tests/line2addr.c
+++ b/tests/line2addr.c
@@ -26,7 +26,7 @@
#include <locale.h>
#include <stdlib.h>
#include <string.h>
-#include <error.h>
+#include "system.h"
static void
diff --git a/tests/low_high_pc.c b/tests/low_high_pc.c
index 5c6b343c..78b6ad08 100644
--- a/tests/low_high_pc.c
+++ b/tests/low_high_pc.c
@@ -25,7 +25,6 @@
#include <stdio_ext.h>
#include <locale.h>
#include <stdlib.h>
-#include <error.h>
#include <string.h>
#include <fnmatch.h>
diff --git a/tests/next_cfi.c b/tests/next_cfi.c
index b923744f..fae0028c 100644
--- a/tests/next_cfi.c
+++ b/tests/next_cfi.c
@@ -18,7 +18,6 @@
#include <config.h>
#include <assert.h>
#include <inttypes.h>
-#include <error.h>
#include ELFUTILS_HEADER(dw)
#include <dwarf.h>
#include <argp.h>
@@ -31,6 +30,7 @@
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
+#include "system.h"
void
handle_section (const unsigned char e_ident[],
diff --git a/tests/rdwrmmap.c b/tests/rdwrmmap.c
index 6f027dfe..490a4eea 100644
--- a/tests/rdwrmmap.c
+++ b/tests/rdwrmmap.c
@@ -19,11 +19,11 @@
#endif
#include <errno.h>
-#include <error.h>
#include <stdio.h>
#include <fcntl.h>
#include <unistd.h>
#include <libelf.h>
+#include "system.h"
int
main (int argc __attribute__ ((unused)), char *argv[])
diff --git a/tests/saridx.c b/tests/saridx.c
index 8a450d82..e7f0c566 100644
--- a/tests/saridx.c
+++ b/tests/saridx.c
@@ -17,7 +17,6 @@
#include <config.h>
-#include <error.h>
#include <fcntl.h>
#include <gelf.h>
#include <stdio.h>
@@ -25,6 +24,7 @@
#include <string.h>
#include <time.h>
#include <unistd.h>
+#include "system.h"
static const char *machines[] =
diff --git a/tests/sectiondump.c b/tests/sectiondump.c
index 3033fedc..f33484f9 100644
--- a/tests/sectiondump.c
+++ b/tests/sectiondump.c
@@ -18,13 +18,13 @@
#include <config.h>
#include <errno.h>
-#include <error.h>
#include <fcntl.h>
#include <gelf.h>
#include <inttypes.h>
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
+#include "system.h"
/* Prototypes for local functions. */
diff --git a/tests/varlocs.c b/tests/varlocs.c
index 25124399..40505196 100644
--- a/tests/varlocs.c
+++ b/tests/varlocs.c
@@ -25,13 +25,13 @@
#include <dwarf.h>
#include <stdio.h>
#include <stdlib.h>
-#include <error.h>
#include <string.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <unistd.h>
+#include "system.h"
#include "../libdw/known-dwarf.h"
// The Dwarf, Dwarf_CFIs and address bias of
diff --git a/tests/vdsosyms.c b/tests/vdsosyms.c
index b876c10b..7bfa7381 100644
--- a/tests/vdsosyms.c
+++ b/tests/vdsosyms.c
@@ -18,13 +18,13 @@
#include <config.h>
#include <assert.h>
#include <errno.h>
-#include <error.h>
#include <inttypes.h>
#include <stdio.h>
#include <string.h>
#include <sys/types.h>
#include <unistd.h>
#include ELFUTILS_HEADER(dwfl)
+#include "system.h"
#ifndef __linux__
int