summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYonggang Luo <luoyonggang@gmail.com>2022-10-21 02:25:46 +0800
committerMark Wielaard <mark@klomp.org>2022-10-28 14:05:07 +0200
commit9f90a3d6636bbf6eec647909f870137eef2d1bd9 (patch)
treefc4fd3467687b228bf0902bc7af6abd92f1c0477
parent13f21dfb9bd09ad4816901ecd63daddc580a8465 (diff)
downloadelfutils-9f90a3d6636bbf6eec647909f870137eef2d1bd9.tar.gz
lib{asm,cpu,dw,dwfl,dwelf}: Move platform depended include into system.h
Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
-rw-r--r--lib/ChangeLog4
-rw-r--r--lib/color.c1
-rw-r--r--libasm/ChangeLog8
-rw-r--r--libasm/asm_abort.c1
-rw-r--r--libasm/asm_addint8.c2
-rw-r--r--libasm/asm_begin.c2
-rw-r--r--libasm/asm_end.c2
-rw-r--r--libasm/libasmP.h3
-rw-r--r--libcpu/ChangeLog6
-rw-r--r--libcpu/i386_disasm.c1
-rw-r--r--libcpu/memory-access.h3
-rw-r--r--libdw/ChangeLog7
-rw-r--r--libdw/dwarf_begin_elf.c2
-rw-r--r--libdw/dwarf_end.c1
-rw-r--r--libdw/dwarf_setalt.c2
-rw-r--r--libdw/libdw_find_split_unit.c1
-rw-r--r--libdwelf/ChangeLog5
-rw-r--r--libdwelf/dwelf_elf_begin.c2
-rw-r--r--libdwelf/dwelf_strtab.c1
-rw-r--r--libdwfl/ChangeLog21
-rw-r--r--libdwfl/argp-std.c1
-rw-r--r--libdwfl/core-file.c6
-rw-r--r--libdwfl/dwfl_build_id_find_debuginfo.c2
-rw-r--r--libdwfl/dwfl_build_id_find_elf.c1
-rw-r--r--libdwfl/dwfl_end.c1
-rw-r--r--libdwfl/dwfl_frame.c1
-rw-r--r--libdwfl/dwfl_module.c1
-rw-r--r--libdwfl/dwfl_module_getdwarf.c1
-rw-r--r--libdwfl/dwfl_report_elf.c2
-rw-r--r--libdwfl/dwfl_segment_report_module.c2
-rw-r--r--libdwfl/find-debuginfo.c1
-rw-r--r--libdwfl/gzip.c2
-rw-r--r--libdwfl/image-header.c4
-rw-r--r--libdwfl/link_map.c2
-rw-r--r--libdwfl/linux-pid-attach.c1
-rw-r--r--libdwfl/offline.c1
-rw-r--r--libdwfl/open.c2
37 files changed, 55 insertions, 51 deletions
diff --git a/lib/ChangeLog b/lib/ChangeLog
index ab555c17..6bb0d4d0 100644
--- a/lib/ChangeLog
+++ b/lib/ChangeLog
@@ -1,3 +1,7 @@
+2022-09-21 Yonggang Luo <luoyonggang@gmail.com>
+
+ * color.c: Don't include unistd.h.
+
2022-09-20 Yonggang Luo <luoyonggang@gmail.com>
* system.h: Use BYTE_ORDER, LITTLE_ENDIAN and BIG_ENDIAN.
diff --git a/lib/color.c b/lib/color.c
index bd105ec2..8063dc26 100644
--- a/lib/color.c
+++ b/lib/color.c
@@ -34,7 +34,6 @@
#include <argp.h>
#include <stdlib.h>
#include <string.h>
-#include <unistd.h>
#include "system.h"
#include "libeu.h"
#include "color.h"
diff --git a/libasm/ChangeLog b/libasm/ChangeLog
index c65fd21b..ce0f24f4 100644
--- a/libasm/ChangeLog
+++ b/libasm/ChangeLog
@@ -1,3 +1,11 @@
+2022-10-21 Yonggang Luo <luoyonggang@gmail.com>
+
+ * asm_abort.c: Don't include unistd.h.
+ * asm_addint8.c: Don't include byteswap.h and endian.h.
+ * asm_begin.c: Don't include unistd.h and system.h.
+ * asm_end.c: Likewise.
+ * libasmP.h: Include system.h.
+
2021-09-06 Dmitry V. Levin <ldv@altlinux.org>
* asm_align.c (__libasm_ensure_section_space): Remove casts of calloc
diff --git a/libasm/asm_abort.c b/libasm/asm_abort.c
index 12743dc6..696298c4 100644
--- a/libasm/asm_abort.c
+++ b/libasm/asm_abort.c
@@ -32,7 +32,6 @@
#endif
#include <stdlib.h>
-#include <unistd.h>
#include <libasmP.h>
#include <libelf.h>
diff --git a/libasm/asm_addint8.c b/libasm/asm_addint8.c
index bb7d40f2..7f823e09 100644
--- a/libasm/asm_addint8.c
+++ b/libasm/asm_addint8.c
@@ -31,8 +31,6 @@
# include <config.h>
#endif
-#include <byteswap.h>
-#include <endian.h>
#include <inttypes.h>
#include <string.h>
diff --git a/libasm/asm_begin.c b/libasm/asm_begin.c
index a190202c..9e4dfe43 100644
--- a/libasm/asm_begin.c
+++ b/libasm/asm_begin.c
@@ -37,11 +37,9 @@
#include <stdio_ext.h>
#include <stdlib.h>
#include <string.h>
-#include <unistd.h>
#include <gelf.h>
#include "libasmP.h"
-#include <system.h>
static AsmCtx_t *
diff --git a/libasm/asm_end.c b/libasm/asm_end.c
index a26120f2..c06d2366 100644
--- a/libasm/asm_end.c
+++ b/libasm/asm_end.c
@@ -35,12 +35,10 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
-#include <unistd.h>
#include <sys/stat.h>
#include <libasmP.h>
#include <libelf.h>
-#include <system.h>
static int
diff --git a/libasm/libasmP.h b/libasm/libasmP.h
index 5b5fb776..11f42511 100644
--- a/libasm/libasmP.h
+++ b/libasm/libasmP.h
@@ -32,6 +32,9 @@
#include <stdio.h>
#include <libasm.h>
+
+#include <system.h>
+
#include "libebl.h"
#include "libdwelf.h"
diff --git a/libcpu/ChangeLog b/libcpu/ChangeLog
index 93c4b72f..06ffe02f 100644
--- a/libcpu/ChangeLog
+++ b/libcpu/ChangeLog
@@ -1,3 +1,9 @@
+2022-10-21 Yonggang Luo <luoyonggang@gmail.com>
+
+ * i386_disasm.c: Don't include endian.h.
+ * memory-access.h: Don't include byteswap.h and endian.h.
+ Do include system.h.
+
2022-09-20 Yonggang Luo <luoyonggang@gmail.com>
* memory-access.h: Use BYTE_ORDER, LITTLE_ENDIAN and BIG_ENDIAN.
diff --git a/libcpu/i386_disasm.c b/libcpu/i386_disasm.c
index 40475b81..599d1654 100644
--- a/libcpu/i386_disasm.c
+++ b/libcpu/i386_disasm.c
@@ -34,7 +34,6 @@
#include <assert.h>
#include <config.h>
#include <ctype.h>
-#include <endian.h>
#include <errno.h>
#include <gelf.h>
#include <stddef.h>
diff --git a/libcpu/memory-access.h b/libcpu/memory-access.h
index 3b6ca19b..6e92fc5b 100644
--- a/libcpu/memory-access.h
+++ b/libcpu/memory-access.h
@@ -29,11 +29,10 @@
#ifndef _MEMORY_ACCESS_H
#define _MEMORY_ACCESS_H 1
-#include <byteswap.h>
-#include <endian.h>
#include <limits.h>
#include <stdint.h>
+#include <system.h>
/* When loading this file we require the macro MACHINE_ENCODING to be
defined to signal the endianness of the architecture which is
diff --git a/libdw/ChangeLog b/libdw/ChangeLog
index 9bce3921..3c595a3d 100644
--- a/libdw/ChangeLog
+++ b/libdw/ChangeLog
@@ -1,3 +1,10 @@
+2022-10-21 Yonggang Luo <luoyonggang@gmail.com>
+
+ * dwarf_begin_elf.h: Don't include unistd.h and endian.h.
+ * dwarf_end.c: Don't include unistd.h.
+ * dwarf_setalt.c: Likewise.
+ * libdw_find_split_unit.c: Likewise.
+
2022-10-19 Mark Wielaard <mark@klomp.org>
* dwarf.h (DW_LLE_GNU_view_pair): New constant.
diff --git a/libdw/dwarf_begin_elf.c b/libdw/dwarf_begin_elf.c
index a48dada6..8fcef335 100644
--- a/libdw/dwarf_begin_elf.c
+++ b/libdw/dwarf_begin_elf.c
@@ -38,11 +38,9 @@
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
-#include <unistd.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
-#include <endian.h>
#include "libelfP.h"
#include "libdwP.h"
diff --git a/libdw/dwarf_end.c b/libdw/dwarf_end.c
index 77f537a7..8dd075cf 100644
--- a/libdw/dwarf_end.c
+++ b/libdw/dwarf_end.c
@@ -35,7 +35,6 @@
#include <stdlib.h>
#include <assert.h>
#include <string.h>
-#include <unistd.h>
#include "libdwP.h"
#include "cfi.h"
diff --git a/libdw/dwarf_setalt.c b/libdw/dwarf_setalt.c
index 9051b8e0..dc9b61cb 100644
--- a/libdw/dwarf_setalt.c
+++ b/libdw/dwarf_setalt.c
@@ -32,8 +32,6 @@
#include "libdwP.h"
-#include <unistd.h>
-
void
dwarf_setalt (Dwarf *main, Dwarf *alt)
{
diff --git a/libdw/libdw_find_split_unit.c b/libdw/libdw_find_split_unit.c
index da039e50..a22e7bc9 100644
--- a/libdw/libdw_find_split_unit.c
+++ b/libdw/libdw_find_split_unit.c
@@ -40,7 +40,6 @@
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
-#include <unistd.h>
void
try_split_file (Dwarf_CU *cu, const char *dwo_path)
diff --git a/libdwelf/ChangeLog b/libdwelf/ChangeLog
index d5800751..5d61aa85 100644
--- a/libdwelf/ChangeLog
+++ b/libdwelf/ChangeLog
@@ -1,3 +1,8 @@
+2022-10-21 Yonggang Luo <luoyonggang@gmail.com>
+
+ * dwelf_elf_begin.c: Don't include unistd.h.
+ * dwelf_strtab.c: Likewise.
+
2022-08-08 Andreas Schwab <schwab@suse.de>
* dwelf_elf_e_machine_string.c (dwelf_elf_e_machine_string): Add
diff --git a/libdwelf/dwelf_elf_begin.c b/libdwelf/dwelf_elf_begin.c
index c3cfe633..17a90fc9 100644
--- a/libdwelf/dwelf_elf_begin.c
+++ b/libdwelf/dwelf_elf_begin.c
@@ -34,8 +34,6 @@
#include "libdwflP.h"
#include "libelfP.h"
-#include <unistd.h>
-
NEW_VERSION (dwelf_elf_begin, ELFUTILS_0.177)
Elf *
dwelf_elf_begin (int fd)
diff --git a/libdwelf/dwelf_strtab.c b/libdwelf/dwelf_strtab.c
index 5ec8c295..c95f9467 100644
--- a/libdwelf/dwelf_strtab.c
+++ b/libdwelf/dwelf_strtab.c
@@ -37,7 +37,6 @@
#include <stddef.h>
#include <stdlib.h>
#include <string.h>
-#include <unistd.h>
#include "libdwelfP.h"
#include <system.h>
diff --git a/libdwfl/ChangeLog b/libdwfl/ChangeLog
index 5254ac45..6dd84a6f 100644
--- a/libdwfl/ChangeLog
+++ b/libdwfl/ChangeLog
@@ -1,5 +1,26 @@
2022-10-21 Yonggang Luo <luoyonggang@gmail.com>
+ * argp-std.c: Don't include unistd.h.
+ * core-file.c: Don't include unistd.h, endian.h, byteswap.h and
+ system.h.
+ * dwfl_build_id_find_debuginfo.c: Don't include unistd.h.
+ * dwfl_build_id_find_elf.c: Likewise.
+ * dwfl_end.c: Likewise.
+ * dwfl_frame.c: Likewise.
+ * dwfl_module.c: Likewise.
+ * dwfl_module_getdwarf.c: Likewise.
+ * dwfl_report_elf.c: Likewise.
+ * dwfl_segment_report_module.c: Don't include endian.h and unistd.h.
+ * find-debuginfo.c: Don't include unistd.h.
+ * gzip.c: Likewise.
+ * image-header.c: Don't include system.h, unistd.h and endian.h.
+ * link_map.c: Don't include byteswap.h and endian.h.
+ * linux-pid-attach.c: Don't include unistd.h.
+ * offline.c: Likewise.
+ * open.c: Likewise.
+
+2022-10-21 Yonggang Luo <luoyonggang@gmail.com>
+
* libdwfl_crc32.c: Remove LIB_SYSTEM_H define.
2022-09-20 Yonggang Luo <luoyonggang@gmail.com>
diff --git a/libdwfl/argp-std.c b/libdwfl/argp-std.c
index bc013aa0..1605fbfe 100644
--- a/libdwfl/argp-std.c
+++ b/libdwfl/argp-std.c
@@ -35,7 +35,6 @@
#include <stdlib.h>
#include <assert.h>
#include <fcntl.h>
-#include <unistd.h>
#define OPT_DEBUGINFO 0x100
diff --git a/libdwfl/core-file.c b/libdwfl/core-file.c
index 4418ef33..cd9b4f38 100644
--- a/libdwfl/core-file.c
+++ b/libdwfl/core-file.c
@@ -33,12 +33,6 @@
#include "libdwflP.h"
#include <gelf.h>
-#include <unistd.h>
-#include <endian.h>
-#include <byteswap.h>
-#include "system.h"
-
-
/* On failure return, we update *NEXT to point back at OFFSET. */
static inline Elf *
do_fail (int error, off_t *next, off_t offset)
diff --git a/libdwfl/dwfl_build_id_find_debuginfo.c b/libdwfl/dwfl_build_id_find_debuginfo.c
index 273e5e5f..856f2312 100644
--- a/libdwfl/dwfl_build_id_find_debuginfo.c
+++ b/libdwfl/dwfl_build_id_find_debuginfo.c
@@ -31,8 +31,6 @@
#endif
#include "libdwflP.h"
-#include <unistd.h>
-
int
dwfl_build_id_find_debuginfo (Dwfl_Module *mod,
diff --git a/libdwfl/dwfl_build_id_find_elf.c b/libdwfl/dwfl_build_id_find_elf.c
index 7b604d47..35bc8c9e 100644
--- a/libdwfl/dwfl_build_id_find_elf.c
+++ b/libdwfl/dwfl_build_id_find_elf.c
@@ -33,7 +33,6 @@
#include "libdwflP.h"
#include <inttypes.h>
#include <fcntl.h>
-#include <unistd.h>
#include "system.h"
diff --git a/libdwfl/dwfl_end.c b/libdwfl/dwfl_end.c
index b1840191..a1812407 100644
--- a/libdwfl/dwfl_end.c
+++ b/libdwfl/dwfl_end.c
@@ -31,7 +31,6 @@
#endif
#include "libdwflP.h"
-#include <unistd.h>
void
dwfl_end (Dwfl *dwfl)
diff --git a/libdwfl/dwfl_frame.c b/libdwfl/dwfl_frame.c
index 77e0c5cb..5ee71dd4 100644
--- a/libdwfl/dwfl_frame.c
+++ b/libdwfl/dwfl_frame.c
@@ -33,7 +33,6 @@
#include <system.h>
#include "libdwflP.h"
-#include <unistd.h>
/* Set STATE->pc_set from STATE->regs according to the backend. Return true on
success, false on error. */
diff --git a/libdwfl/dwfl_module.c b/libdwfl/dwfl_module.c
index e7dfdace..4fbff33e 100644
--- a/libdwfl/dwfl_module.c
+++ b/libdwfl/dwfl_module.c
@@ -33,7 +33,6 @@
#include "libdwflP.h"
#include "../libdw/cfi.h"
#include <search.h>
-#include <unistd.h>
static void
free_cu (struct dwfl_cu *cu)
diff --git a/libdwfl/dwfl_module_getdwarf.c b/libdwfl/dwfl_module_getdwarf.c
index 6f076057..498c7cd2 100644
--- a/libdwfl/dwfl_module_getdwarf.c
+++ b/libdwfl/dwfl_module_getdwarf.c
@@ -34,7 +34,6 @@
#include <inttypes.h>
#include <fcntl.h>
#include <string.h>
-#include <unistd.h>
#include "../libdw/libdwP.h" /* DWARF_E_* values are here. */
#include "../libelf/libelfP.h"
#include "system.h"
diff --git a/libdwfl/dwfl_report_elf.c b/libdwfl/dwfl_report_elf.c
index a5f0e5e5..581f4079 100644
--- a/libdwfl/dwfl_report_elf.c
+++ b/libdwfl/dwfl_report_elf.c
@@ -32,8 +32,6 @@
#include "libdwflP.h"
#include <fcntl.h>
-#include <unistd.h>
-
/* We start every ET_REL module at a moderately aligned boundary.
This keeps the low addresses easy to read compared to a layout
diff --git a/libdwfl/dwfl_segment_report_module.c b/libdwfl/dwfl_segment_report_module.c
index 28f87f10..287fc002 100644
--- a/libdwfl/dwfl_segment_report_module.c
+++ b/libdwfl/dwfl_segment_report_module.c
@@ -36,8 +36,6 @@
#include <elf.h>
#include <gelf.h>
#include <inttypes.h>
-#include <endian.h>
-#include <unistd.h>
#include <fcntl.h>
#include <system.h>
diff --git a/libdwfl/find-debuginfo.c b/libdwfl/find-debuginfo.c
index 449df5a1..7f7ab632 100644
--- a/libdwfl/find-debuginfo.c
+++ b/libdwfl/find-debuginfo.c
@@ -33,7 +33,6 @@
#include "libdwflP.h"
#include <stdio.h>
#include <fcntl.h>
-#include <unistd.h>
#include <sys/stat.h>
#include "system.h"
diff --git a/libdwfl/gzip.c b/libdwfl/gzip.c
index ba8ecfba..53013be3 100644
--- a/libdwfl/gzip.c
+++ b/libdwfl/gzip.c
@@ -33,8 +33,6 @@
#include "libdwflP.h"
#include "system.h"
-#include <unistd.h>
-
#ifdef LZMA
# define USE_INFLATE 1
# include <lzma.h>
diff --git a/libdwfl/image-header.c b/libdwfl/image-header.c
index f906068a..c777cc84 100644
--- a/libdwfl/image-header.c
+++ b/libdwfl/image-header.c
@@ -32,10 +32,6 @@
#endif
#include "libdwflP.h"
-#include "system.h"
-
-#include <unistd.h>
-#include <endian.h>
#if BYTE_ORDER == LITTLE_ENDIAN
# define LE16(x) (x)
diff --git a/libdwfl/link_map.c b/libdwfl/link_map.c
index c0207cd3..7ec7eca1 100644
--- a/libdwfl/link_map.c
+++ b/libdwfl/link_map.c
@@ -32,8 +32,6 @@
#include "../libdw/memory-access.h"
#include "system.h"
-#include <byteswap.h>
-#include <endian.h>
#include <fcntl.h>
/* This element is always provided and always has a constant value.
diff --git a/libdwfl/linux-pid-attach.c b/libdwfl/linux-pid-attach.c
index 09cba07b..de867857 100644
--- a/libdwfl/linux-pid-attach.c
+++ b/libdwfl/linux-pid-attach.c
@@ -38,7 +38,6 @@
#include <sys/stat.h>
#include <fcntl.h>
#include <dirent.h>
-#include <unistd.h>
#ifdef __linux__
diff --git a/libdwfl/offline.c b/libdwfl/offline.c
index 499663e3..e090b42b 100644
--- a/libdwfl/offline.c
+++ b/libdwfl/offline.c
@@ -34,7 +34,6 @@
#include "libdwflP.h"
#include <fcntl.h>
-#include <unistd.h>
/* Since dwfl_report_elf lays out the sections already, this will only be
called when the section headers of the debuginfo file are being
diff --git a/libdwfl/open.c b/libdwfl/open.c
index da8b59a3..68b755cd 100644
--- a/libdwfl/open.c
+++ b/libdwfl/open.c
@@ -35,8 +35,6 @@
#undef _
#include "libdwflP.h"
-#include <unistd.h>
-
#if !USE_BZLIB
# define __libdw_bunzip2(...) DWFL_E_BADELF
#endif