]> git.ipfire.org Git - thirdparty/elfutils.git/commitdiff
move platform depended include into system.h of libelf
authorYonggang Luo <luoyonggang@gmail.com>
Sat, 15 Oct 2022 16:36:20 +0000 (00:36 +0800)
committerMark Wielaard <mark@klomp.org>
Sun, 16 Oct 2022 20:34:17 +0000 (22:34 +0200)
All of these files either #include <system.h> directly or #include "libelfP.h"
And now "libelfP.h also #include <system.h>, so the platform depended include
can be moved to system.h safely

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
24 files changed:
lib/ChangeLog
lib/system.h
libelf/ChangeLog
libelf/common.h
libelf/elf32_checksum.c
libelf/elf32_getphdr.c
libelf/elf32_getshdr.c
libelf/elf32_updatefile.c
libelf/elf32_updatenull.c
libelf/elf32_xlatetof.c
libelf/elf32_xlatetom.c
libelf/elf_begin.c
libelf/elf_cntl.c
libelf/elf_compress.c
libelf/elf_end.c
libelf/elf_getarsym.c
libelf/elf_getdata.c
libelf/elf_getdata_rawchunk.c
libelf/elf_getshdrstrndx.c
libelf/elf_readall.c
libelf/elf_update.c
libelf/gelf_xlate.c
libelf/libelfP.h
libelf/nlist.c

index 36c3131ff6a95d3b06f53478889691aa6c4404de..e4f00a8f4968000082c1f35fd774b4a153b6075e 100644 (file)
@@ -1,3 +1,13 @@
+2022-10-16  Yonggang Luo  <luoyonggang@gmail.com>
+
+       * system.h: Add sys/mman.h as system dependend header.
+       * common.h: Remove ar.h, byteswap.h and endian.h.
+       * elf32_checksum.c: Remove endian.h.
+       * elf32_getphdr.c: Remove unistd.h and system.h.
+       * elf32_getshdr.c: Remove unistd.h.h and system.h.
+       * elf32_updatefile.c: Remove unistd.h, sys/mman.h and system.h.
+       * elf32_updatenull.c: Remove endian.h and system.h.
+
 2022-08-05  Mark Wielaard  <mark@klomp.org>
 
        * dynamicsizehash_concurrent.c (resize_helper): Add documentation.
index d3f42c91913002aadd1740cfcae4ac8b98a4a452..48004df19e99877d97c8076ea14b998ef8dc3235 100644 (file)
 #include <errno.h>
 #include <stddef.h>
 #include <stdint.h>
-#include <sys/param.h>
-#include <endian.h>
-#include <byteswap.h>
-#include <unistd.h>
 #include <string.h>
 #include <stdarg.h>
 #include <stdlib.h>
 
+/* System dependend headers */
+#include <byteswap.h>
+#include <endian.h>
+#include <sys/mman.h>
+#include <sys/param.h>
+#include <unistd.h>
+
 #if defined(HAVE_ERROR_H)
 #include <error.h>
 #elif defined(HAVE_ERR_H)
index 558d795eb6bcb3d660490d141afbfdc1c89dcb99..1c6c492111397c9b95c0a1b0e0b2090c916cc4ed 100644 (file)
@@ -1,3 +1,28 @@
+2022-10-16  Yonggang Luo  <luoyonggang@gmail.com>
+
+       * common.h: Remove ar.h, byteswap.h and endian.h.
+       * elf32_checksum.c: Remove endian.h.
+       * elf32_getphdr.c: Remove unistd.h and system.h.
+       * elf32_getshdr.c: Remove unistd.h.h and system.h.
+       * elf32_updatefile.c: Remove unistd.h, sys/mman.h and system.h.
+       * elf32_updatenull.c: Remove endian.h and system.h.
+       * elf32_xlatetof.c: Remove endian.h.
+       * elf32_xlatetom.c: Likewise.
+       * elf_begin.c: Remove unistd.h, sys/mman.h and system.h.
+       * elf_cntl.c: Remove unistd.h.
+       * elf_compress.c: Remove system.h and unistd.h.
+       * elf_end.c: Remove sys.mman.h.
+       * elf_getarsym.c: Remove byteswap.h, endian.h, unistd.h and
+       system.h.
+       * elf_getdata.c: Remove unistd.h and system.h.
+       * elf_getdata_rawchunk.c: Remove unistd.h and system.h.
+       * elf_getshdrstrndx.c: Likewise.
+       * elf_readall.c: Likewise.
+       * elf_update.c: Remove unistd.h and sys/mman.h.
+       * gelf_xlate.c: Remove byteswap.h.
+       * libelfP.h: Add system.h.
+       * nlist.c: Remove unistd.h.
+
 2022-08-28  Mark Wielaard  <mark@klomp.org>
 
        * elf_begin.c (__libelf_next_arhdr_wrlock): Add OCT_FIELD macro,
index 3718b3fd036ec2b8e48b6b4ab21031163610c665..4561854fb3f7bb451b3d38b88af8258d0f02d3e1 100644 (file)
@@ -30,9 +30,6 @@
 #ifndef _COMMON_H
 #define _COMMON_H       1
 
-#include <ar.h>
-#include <byteswap.h>
-#include <endian.h>
 #include <stdlib.h>
 #include <string.h>
 
index c5f27bbe2ef4ab03b53b4b785e3f872fa17ff736..521668a7485c4311e2c0e026d336ad7b49ac2e00 100644 (file)
@@ -32,7 +32,6 @@
 #endif
 
 #include <assert.h>
-#include <endian.h>
 #include <stdbool.h>
 #include <stddef.h>
 #include <string.h>
index 99b4ac09a85fe2c622d8d4a2344529226c3350ce..4bfca24b8d06e708087da4dc927f77d0cb2d2f9b 100644 (file)
 #include <errno.h>
 #include <stdbool.h>
 #include <stdlib.h>
-#include <unistd.h>
 #include <assert.h>
 
-#include <system.h>
 #include "libelfP.h"
 #include "common.h"
 
index 237d912261ee23cbe81be216eeabc373fc6c65c6..fc696302b8b69ff39c13e114cd6a06a675d1c9f3 100644 (file)
@@ -34,9 +34,7 @@
 #include <assert.h>
 #include <errno.h>
 #include <stdbool.h>
-#include <unistd.h>
 
-#include <system.h>
 #include "libelfP.h"
 #include "common.h"
 
index 1ff589004f76745b4a2ac9626aa8722df241e299..46afa1f4e275732c293701090967850c78393e70 100644 (file)
 #include <stdbool.h>
 #include <stdlib.h>
 #include <string.h>
-#include <unistd.h>
-#include <sys/mman.h>
 
-#include <system.h>
 #include "libelfP.h"
 
 
index d0d4d1eb6f33f7562fc71eb58172fa1b7f8627e2..6c06e5e4bc02fe5650f092b540090e79ad4aa910 100644 (file)
 #endif
 
 #include <assert.h>
-#include <endian.h>
 #include <libelf.h>
 #include <stdbool.h>
 #include <string.h>
 
-#include <system.h>
 #include "libelfP.h"
 #include "elf-knowledge.h"
 
index 082d833feae9020c8ebed8c99e696deb3dd3f31e..377659c8955594c2411768a071c65bc3e47f79c4 100644 (file)
@@ -32,7 +32,6 @@
 #endif
 
 #include <assert.h>
-#include <endian.h>
 #include <string.h>
 
 #include "libelfP.h"
index cb0bb8d524037549a9707b3c132f32ec5aacd422..fa3dc9a724a1565ef1a08121895c0e25797f0275 100644 (file)
@@ -32,7 +32,6 @@
 #endif
 
 #include <assert.h>
-#include <endian.h>
 #include <string.h>
 
 #include "libelfP.h"
index 71eb3594f11744c4be35e65ee546210c0023dca3..fe8c640a8107d941deed62ec9cee8fcf012e585c 100644 (file)
 #include <stdbool.h>
 #include <stddef.h>
 #include <string.h>
-#include <unistd.h>
-#include <sys/mman.h>
 #include <sys/stat.h>
 
-#include <system.h>
 #include "libelfP.h"
 #include "common.h"
 
index fd681789ff5f818f4c8a8fee29e042f8ecdf1427..04aa913205160cba1e6c36ec7dec33cec2894c24 100644 (file)
@@ -31,8 +31,6 @@
 # include <config.h>
 #endif
 
-#include <unistd.h>
-
 #include "libelfP.h"
 
 
index df0144e88188b525c10131da1e0f55e96e1a2495..d7f53af2a60401ab0f14707a3f37d0dfbe769859 100644 (file)
 #endif
 
 #include <libelf.h>
-#include <system.h>
 #include "libelfP.h"
 #include "common.h"
 
 #include <stddef.h>
 #include <stdlib.h>
 #include <string.h>
-#include <unistd.h>
 #include <zlib.h>
 
 /* Cleanup and return result.  Don't leak memory.  */
index 160f0b885b0a6be2b98c852bc129403e8542ba3d..5c451f36daddd6ac33a43fd69911e1af6a6b4e92 100644 (file)
@@ -34,7 +34,6 @@
 #include <assert.h>
 #include <stddef.h>
 #include <stdlib.h>
-#include <sys/mman.h>
 
 #include "libelfP.h"
 
index 05ebf6a91ef7fa1ce4a2da07caa352deaa656c42..2203521fa50c63b86a11b2ee2aba8f9776476b2f 100644 (file)
 #endif
 
 #include <assert.h>
-#include <byteswap.h>
-#include <endian.h>
 #include <errno.h>
 #include <stdbool.h>
 #include <stdint.h>
 #include <stdlib.h>
 #include <string.h>
-#include <unistd.h>
 
-#include <system.h>
 #include <dl-hash.h>
 #include "libelfP.h"
 
index a704aae3ae2bd10867d1e4961319ac94e810445a..5ebd270f80820b2350140f10d804970938e498c2 100644 (file)
 #include <errno.h>
 #include <stddef.h>
 #include <string.h>
-#include <unistd.h>
 
 #include "libelfP.h"
-#include <system.h>
 #include "common.h"
 #include "elf-knowledge.h"
 
index 2f55cbb472fa7d9f35d104b89fb4e4162acc7a6e..5a35ccdc6b2bf8cc80075448ad8b515be97ddb67 100644 (file)
@@ -35,9 +35,7 @@
 #include <errno.h>
 #include <stdlib.h>
 #include <string.h>
-#include <unistd.h>
 
-#include <system.h>
 #include "libelfP.h"
 #include "common.h"
 
index ad884fd3844702a52718b7b630eedcd5b4311b24..2391317bffe0c4e1c45e603c6d90d16eb70946f9 100644 (file)
@@ -35,9 +35,7 @@
 #include <errno.h>
 #include <gelf.h>
 #include <stddef.h>
-#include <unistd.h>
 
-#include <system.h>
 #include "libelfP.h"
 #include "common.h"
 
index 0a3a233d4d2700f4694ef5ecfe997fe9cc804053..d0f9a28cc59ea192165391babb31eed951a771ed 100644 (file)
 #endif
 
 #include <errno.h>
-#include <unistd.h>
 #include <sys/stat.h>
 
-#include <system.h>
 #include "libelfP.h"
 #include "common.h"
 
index 97ca9ca943e2dcc70ca985cec2eaf97d8333d78c..56af3a1cc204067e04e7466fa356387d85fae942 100644 (file)
@@ -33,8 +33,6 @@
 
 #include <libelf.h>
 #include <fcntl.h>
-#include <unistd.h>
-#include <sys/mman.h>
 #include <sys/stat.h>
 
 #include "libelfP.h"
index 6f8c57b7bb0dc89fdc6a95b8e10f3f9594aff970..d8ad0634433043ee9d69e4ff3912feaea15f5a47 100644 (file)
@@ -32,7 +32,6 @@
 # include <config.h>
 #endif
 
-#include <byteswap.h>
 #include <stdint.h>
 #include <string.h>
 #include <stdlib.h>
index 56331f4526e25490d6d2f267fcd4b74e3ee4272e..d88a613cc9d530b3c7e4801e8cead1f4e764d86b 100644 (file)
@@ -39,6 +39,7 @@
 #include <stdio.h>
 #include <string.h>
 
+#include <system.h>
 
 /* Helper Macros to write 32 bit and 64 bit functions.  */
 #define __elfw2_(Bits, Name) __elf##Bits##_##Name
index 8593c1de842a49aa18d97b11f03c4b0aaf770aaa..b3d604353a52c53df06908776ddd489f7e764b00 100644 (file)
@@ -35,7 +35,6 @@
 #include <gelf.h>
 #include <libelf.h>
 #include <nlist.h>
-#include <unistd.h>
 
 #include "libelfP.h"