From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pj1-x102f.google.com (mail-pj1-x102f.google.com [IPv6:2607:f8b0:4864:20::102f]) by sourceware.org (Postfix) with ESMTPS id 849D23858C55 for ; Tue, 20 Sep 2022 08:43:27 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 849D23858C55 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-pj1-x102f.google.com with SMTP id y11so2272277pjv.4 for ; Tue, 20 Sep 2022 01:43:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date; bh=lYBEgAQjNgmv93kbkvWaoSui8DsMZ+ZTDYtGxDtXuWs=; b=M85foyQT9pXeWemHfVnofMrVCL1iNnDILUURgwILEzhS4pYtuPswH4s38M6TSCpH2P ZQroUujF/5WAbQO6ISOZf4XQnzoK0mSd8hYw0CJMTf57gfgvU7EcXDwygx7wnigtmAeg r0o0RHAgzsX5y2PW29P7M76ETrrXv0sjXSM/MHp/0inRNCineklwWZWtTGt7Sv4c1KHw 0E10HzhXrer8bBIh/ru3fOKWVvKS66jTQi+fn2U36PXwumnnKe2+7KETuzV7DF+o6fWv Am3JgrodCfirrEDG79CMXIyLZsfP18db2mEUTC/nw8zMspnexqKDeEE5/uKNDxyxiwhI UPBg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date; bh=lYBEgAQjNgmv93kbkvWaoSui8DsMZ+ZTDYtGxDtXuWs=; b=iAoy8b0KiisY+8MWg6HWromnT6EImSe5lbVobylIMOO5b2XtnCaItGzPntBORTDxTI 67ukHsljgo9ECqk8SFFliSzmNhUf6CSzvBM4D5dSIkWKMLWWa8aCGwvqJGpT+UJfemCc w5I8Y5lHc0GUsObh8d3KRvbXsMivkevnBhpREswWaRkD0TdVXPdFi27/2ycjINyHNUJH rL3oFvv3vkmzluH1eCNdYBqImXLFPEAdffbtof3CtAxfLprC9uJOhlvKpT6KqhYE1IHg kMwZXLdQZTUXlLPOuP+XsxUSJ9FJLsQzESS5kmhTrvzr9r68m7iZMUz1C4pKAj3oqXRw md6A== X-Gm-Message-State: ACrzQf035MBz0RGa9YuxDdHQK8U98RYYv3oOfb/roMIKvzb0oG1k/7ZN 2yb7kZ7JEOXwsFR+eWlOzvIG+VZnrTM= X-Google-Smtp-Source: AMsMyM7nA2fpXr9BhNmn6vN7q4VSNkWPA0YiFkR8n8KsiOFs6Gg75B4DDPv7+6i4FvNYWHh/vu56hA== X-Received: by 2002:a17:90a:e644:b0:200:2f9a:bd0a with SMTP id ep4-20020a17090ae64400b002002f9abd0amr2723574pjb.88.1663663405238; Tue, 20 Sep 2022 01:43:25 -0700 (PDT) Received: from localhost.localdomain ([103.94.185.75]) by smtp.googlemail.com with ESMTPSA id so16-20020a17090b1f9000b002009db534d1sm873372pjb.24.2022.09.20.01.43.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 20 Sep 2022 01:43:24 -0700 (PDT) From: Yonggang Luo To: elfutils-devel@sourceware.org Cc: Yonggang Luo Subject: [PATCH 2/7] move platform depended include into system.h Date: Tue, 20 Sep 2022 16:43:02 +0800 Message-Id: <20220920084307.1696-3-luoyonggang@gmail.com> X-Mailer: git-send-email 2.36.1.windows.1 In-Reply-To: <20220920084307.1696-1-luoyonggang@gmail.com> References: <20220920084307.1696-1-luoyonggang@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-10.3 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,GIT_PATCH_0,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: All of these files either #include directly or #include "libelfP.h" And now "libelfP.h also #include , so the platform depended include can be moved to system.h safely Signed-off-by: Yonggang Luo --- lib/system.h | 11 +++++++---- libebl/eblmachineflagname.c | 1 - libebl/eblobjnotetypename.c | 2 -- libebl/eblopenbackend.c | 1 - libelf/common.h | 3 --- libelf/elf32_checksum.c | 1 - libelf/elf32_getphdr.c | 2 -- libelf/elf32_getshdr.c | 2 -- libelf/elf32_updatefile.c | 3 --- libelf/elf32_updatenull.c | 2 -- libelf/elf32_xlatetof.c | 1 - libelf/elf32_xlatetom.c | 1 - libelf/elf_begin.c | 3 --- libelf/elf_cntl.c | 2 -- libelf/elf_compress.c | 2 -- libelf/elf_end.c | 1 - libelf/elf_error.c | 1 - libelf/elf_getarsym.c | 4 ---- libelf/elf_getdata.c | 2 -- libelf/elf_getdata_rawchunk.c | 2 -- libelf/elf_getshdrstrndx.c | 2 -- libelf/elf_readall.c | 2 -- libelf/elf_update.c | 2 -- libelf/gelf_xlate.c | 1 - libelf/libelfP.h | 1 + libelf/nlist.c | 1 - 26 files changed, 8 insertions(+), 48 deletions(-) diff --git a/lib/system.h b/lib/system.h index d3f42c91..48004df1 100644 --- a/lib/system.h +++ b/lib/system.h @@ -35,14 +35,17 @@ #include #include #include -#include -#include -#include -#include #include #include #include +/* System dependend headers */ +#include +#include +#include +#include +#include + #if defined(HAVE_ERROR_H) #include #elif defined(HAVE_ERR_H) diff --git a/libebl/eblmachineflagname.c b/libebl/eblmachineflagname.c index 02e11c65..5897735f 100644 --- a/libebl/eblmachineflagname.c +++ b/libebl/eblmachineflagname.c @@ -33,7 +33,6 @@ #include #include -#include #include diff --git a/libebl/eblobjnotetypename.c b/libebl/eblobjnotetypename.c index 473a1f2f..2ee1b228 100644 --- a/libebl/eblobjnotetypename.c +++ b/libebl/eblobjnotetypename.c @@ -31,8 +31,6 @@ # include #endif -#include - #include #include #include diff --git a/libebl/eblopenbackend.c b/libebl/eblopenbackend.c index c6657252..9ba8728b 100644 --- a/libebl/eblopenbackend.c +++ b/libebl/eblopenbackend.c @@ -38,7 +38,6 @@ #include #include -#include #include Ebl *i386_init (Elf *, GElf_Half, Ebl *); diff --git a/libelf/common.h b/libelf/common.h index 3718b3fd..4561854f 100644 --- a/libelf/common.h +++ b/libelf/common.h @@ -30,9 +30,6 @@ #ifndef _COMMON_H #define _COMMON_H 1 -#include -#include -#include #include #include diff --git a/libelf/elf32_checksum.c b/libelf/elf32_checksum.c index c5f27bbe..521668a7 100644 --- a/libelf/elf32_checksum.c +++ b/libelf/elf32_checksum.c @@ -32,7 +32,6 @@ #endif #include -#include #include #include #include diff --git a/libelf/elf32_getphdr.c b/libelf/elf32_getphdr.c index 99b4ac09..4bfca24b 100644 --- a/libelf/elf32_getphdr.c +++ b/libelf/elf32_getphdr.c @@ -34,10 +34,8 @@ #include #include #include -#include #include -#include #include "libelfP.h" #include "common.h" diff --git a/libelf/elf32_getshdr.c b/libelf/elf32_getshdr.c index 237d9122..fc696302 100644 --- a/libelf/elf32_getshdr.c +++ b/libelf/elf32_getshdr.c @@ -34,9 +34,7 @@ #include #include #include -#include -#include #include "libelfP.h" #include "common.h" diff --git a/libelf/elf32_updatefile.c b/libelf/elf32_updatefile.c index 1ff58900..46afa1f4 100644 --- a/libelf/elf32_updatefile.c +++ b/libelf/elf32_updatefile.c @@ -37,10 +37,7 @@ #include #include #include -#include -#include -#include #include "libelfP.h" diff --git a/libelf/elf32_updatenull.c b/libelf/elf32_updatenull.c index d0d4d1eb..6c06e5e4 100644 --- a/libelf/elf32_updatenull.c +++ b/libelf/elf32_updatenull.c @@ -32,12 +32,10 @@ #endif #include -#include #include #include #include -#include #include "libelfP.h" #include "elf-knowledge.h" diff --git a/libelf/elf32_xlatetof.c b/libelf/elf32_xlatetof.c index 082d833f..377659c8 100644 --- a/libelf/elf32_xlatetof.c +++ b/libelf/elf32_xlatetof.c @@ -32,7 +32,6 @@ #endif #include -#include #include #include "libelfP.h" diff --git a/libelf/elf32_xlatetom.c b/libelf/elf32_xlatetom.c index cb0bb8d5..fa3dc9a7 100644 --- a/libelf/elf32_xlatetom.c +++ b/libelf/elf32_xlatetom.c @@ -32,7 +32,6 @@ #endif #include -#include #include #include "libelfP.h" diff --git a/libelf/elf_begin.c b/libelf/elf_begin.c index 71eb3594..fe8c640a 100644 --- a/libelf/elf_begin.c +++ b/libelf/elf_begin.c @@ -39,11 +39,8 @@ #include #include #include -#include -#include #include -#include #include "libelfP.h" #include "common.h" diff --git a/libelf/elf_cntl.c b/libelf/elf_cntl.c index fd681789..04aa9132 100644 --- a/libelf/elf_cntl.c +++ b/libelf/elf_cntl.c @@ -31,8 +31,6 @@ # include #endif -#include - #include "libelfP.h" diff --git a/libelf/elf_compress.c b/libelf/elf_compress.c index df0144e8..d7f53af2 100644 --- a/libelf/elf_compress.c +++ b/libelf/elf_compress.c @@ -31,14 +31,12 @@ #endif #include -#include #include "libelfP.h" #include "common.h" #include #include #include -#include #include /* Cleanup and return result. Don't leak memory. */ diff --git a/libelf/elf_end.c b/libelf/elf_end.c index 160f0b88..5c451f36 100644 --- a/libelf/elf_end.c +++ b/libelf/elf_end.c @@ -34,7 +34,6 @@ #include #include #include -#include #include "libelfP.h" diff --git a/libelf/elf_error.c b/libelf/elf_error.c index 5364e685..e596108d 100644 --- a/libelf/elf_error.c +++ b/libelf/elf_error.c @@ -32,7 +32,6 @@ #endif #include -#include #include #include #include diff --git a/libelf/elf_getarsym.c b/libelf/elf_getarsym.c index 05ebf6a9..2203521f 100644 --- a/libelf/elf_getarsym.c +++ b/libelf/elf_getarsym.c @@ -32,16 +32,12 @@ #endif #include -#include -#include #include #include #include #include #include -#include -#include #include #include "libelfP.h" diff --git a/libelf/elf_getdata.c b/libelf/elf_getdata.c index a704aae3..5ebd270f 100644 --- a/libelf/elf_getdata.c +++ b/libelf/elf_getdata.c @@ -35,10 +35,8 @@ #include #include #include -#include #include "libelfP.h" -#include #include "common.h" #include "elf-knowledge.h" diff --git a/libelf/elf_getdata_rawchunk.c b/libelf/elf_getdata_rawchunk.c index 2f55cbb4..5a35ccdc 100644 --- a/libelf/elf_getdata_rawchunk.c +++ b/libelf/elf_getdata_rawchunk.c @@ -35,9 +35,7 @@ #include #include #include -#include -#include #include "libelfP.h" #include "common.h" diff --git a/libelf/elf_getshdrstrndx.c b/libelf/elf_getshdrstrndx.c index ad884fd3..2391317b 100644 --- a/libelf/elf_getshdrstrndx.c +++ b/libelf/elf_getshdrstrndx.c @@ -35,9 +35,7 @@ #include #include #include -#include -#include #include "libelfP.h" #include "common.h" diff --git a/libelf/elf_readall.c b/libelf/elf_readall.c index 0a3a233d..d0f9a28c 100644 --- a/libelf/elf_readall.c +++ b/libelf/elf_readall.c @@ -32,10 +32,8 @@ #endif #include -#include #include -#include #include "libelfP.h" #include "common.h" diff --git a/libelf/elf_update.c b/libelf/elf_update.c index 97ca9ca9..56af3a1c 100644 --- a/libelf/elf_update.c +++ b/libelf/elf_update.c @@ -33,8 +33,6 @@ #include #include -#include -#include #include #include "libelfP.h" diff --git a/libelf/gelf_xlate.c b/libelf/gelf_xlate.c index 6f8c57b7..d8ad0634 100644 --- a/libelf/gelf_xlate.c +++ b/libelf/gelf_xlate.c @@ -32,7 +32,6 @@ # include #endif -#include #include #include #include diff --git a/libelf/libelfP.h b/libelf/libelfP.h index 56331f45..d88a613c 100644 --- a/libelf/libelfP.h +++ b/libelf/libelfP.h @@ -39,6 +39,7 @@ #include #include +#include /* Helper Macros to write 32 bit and 64 bit functions. */ #define __elfw2_(Bits, Name) __elf##Bits##_##Name diff --git a/libelf/nlist.c b/libelf/nlist.c index 8593c1de..b3d60435 100644 --- a/libelf/nlist.c +++ b/libelf/nlist.c @@ -35,7 +35,6 @@ #include #include #include -#include #include "libelfP.h" -- 2.36.1.windows.1