From patchwork Sun Apr 5 03:53:18 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: WANG Rui X-Patchwork-Id: 132699 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from vm01.sourceware.org (localhost [127.0.0.1]) by sourceware.org (Postfix) with ESMTP id F257B4BA903E for ; Sun, 5 Apr 2026 03:54:38 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org F257B4BA903E X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mail.loongson.cn (mail.loongson.cn [114.242.206.163]) by sourceware.org (Postfix) with ESMTP id 79F8F4BA2E20 for ; Sun, 5 Apr 2026 03:54:07 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 79F8F4BA2E20 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=loongson.cn Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=loongson.cn ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 79F8F4BA2E20 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=114.242.206.163 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1775361248; cv=none; b=ArWFCGaVqqCw2XS7Y/YpT/qe+fSK0dgwlINR69vf+0AxFELsa5/+6HcmfgGZciybLefUjH0/kADwTShYTswYXIJjUg8SRbUQOPRmSfE867FH6ZzHDT6Eiq2skGf3eZrYpeV79a9zuHBR1lkqYvSyhQkIDygCWJX2gMD6mQV+ijs= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1775361248; c=relaxed/simple; bh=5kV+tPN5ipcRFgmNHgXAmm5K+NVaULoBm8ktOeNgHZ4=; h=From:To:Subject:Date:Message-ID:MIME-Version; b=Zyz0eQdHmiS0XfqN+HCZTw63g6LQJaxjwTaRNDNAcPpRrDU4ZMDGhSqM0dJCfaOlJKGuNK5zsh68DWYK53TOuoFMkJKcbIxT36fmfY1pDc8Pf22zDRMf2u8JFzWXNfmvGUhPKpKeSqx0BEbWk+uFLpwsgq2liVLTTo5dcOC7JZs= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 79F8F4BA2E20 Received: from loongson.cn (unknown [223.64.120.66]) by gateway (Coremail) with SMTP id _____8DxccDd3NFpixgiAA--.36673S3; Sun, 05 Apr 2026 11:54:05 +0800 (CST) Received: from localhost (unknown [223.64.120.66]) by front1 (Coremail) with SMTP id qMiowJBxDOHK3NFpP1JlAA--.44692S4; Sun, 05 Apr 2026 11:54:02 +0800 (CST) From: WANG Rui To: libc-alpha@sourceware.org Cc: Adhemerval Zanella , Dev Jain , Florian Weimer , Wilco Dijkstra , Xi Ruoyao , WANG Xuerui , caiyinyu , mengqinggang , Huacai Chen , hjl.tools@gmail.com, WANG Rui Subject: [PATCH v8 2/6] elf: Remove redundant _dl_map_segments declaration from dl-load.h Date: Sun, 5 Apr 2026 11:53:18 +0800 Message-ID: <20260405035323.558335-3-wangrui@loongson.cn> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260405035323.558335-1-wangrui@loongson.cn> References: <20260405035323.558335-1-wangrui@loongson.cn> MIME-Version: 1.0 X-CM-TRANSID: qMiowJBxDOHK3NFpP1JlAA--.44692S4 X-CM-SenderInfo: pzdqw2txl6z05rqj20fqof0/ X-Coremail-Antispam: 1Uk129KBj93XoWxJr4kZry7Jw4kWrW8CFW5XFc_yoW8Cw45pF 1Yk34rKFn3Cw4ruayDKa17Ka13Zrn5tw15Wry3W397Xrn7Wr4xXF4fK3WY9a4fJrZ5t3WS vF9rKr15ZF4FkrXCm3ZEXasCq-sJn29KB7ZKAUJUUUU7529EdanIXcx71UUUUU7KY7ZEXa sCq-sGcSsGvfJ3Ic02F40EFcxC0VAKzVAqx4xG6I80ebIjqfuFe4nvWSU5nxnvy29KBjDU 0xBIdaVrnRJUUUBYb4IE77IF4wAFF20E14v26r1j6r4UM7CY07I20VC2zVCF04k26cxKx2 IYs7xG6rWj6s0DM7CIcVAFz4kK6r1q6r4UM28lY4IEw2IIxxk0rwA2F7IY1VAKz4vEj48v e4kI8wA2z4x0Y4vE2Ix0cI8IcVAFwI0_Gr0_Xr1l84ACjcxK6xIIjxv20xvEc7CjxVAFwI 0_Gr0_Cr1l84ACjcxK6I8E87Iv67AKxVW8JVWxJwA2z4x0Y4vEx4A2jsIEc7CjxVAFwI0_ Gr0_Gr1UM2kKe7AKxVWUXVWUAwAS0I0E0xvYzxvE52x082IY62kv0487Mc804VCY07AIYI kI8VC2zVCFFI0UMc02F40EFcxC0VAKzVAqx4xG6I80ewAv7VC0I7IYx2IY67AKxVWUtVWr XwAv7VC2z280aVAFwI0_Gr0_Cr1lOx8S6xCaFVCjc4AY6r1j6r4UM4x0Y48IcxkI7VAKI4 8JMxkF7I0En4kS14v26r126r1DMxAIw28IcxkI7VAKI48JMxC20s026xCaFVCjc4AY6r1j 6r4UMxCIbckI1I0E14v26r1Y6r17MI8I3I0E5I8CrVAFwI0_Jr0_Jr4lx2IqxVCjr7xvwV AFwI0_JrI_JrWlx4CE17CEb7AF67AKxVWUtVW8ZwCIc40Y0x0EwIxGrwCI42IY6xIIjxv2 0xvE14v26r4j6ryUMIIF0xvE2Ix0cI8IcVCY1x0267AKxVW8JVWxJwCI42IY6xAIw20EY4 v20xvaj40_Jr0_JF4lIxAIcVC2z280aVAFwI0_Gr0_Cr1lIxAIcVC2z280aVCY1x0267AK xVW8JVW8JrUvcSsGvfC2KfnxnUUI43ZEXa7IU1mii3UUUUU== X-Spam-Status: No, score=-11.8 required=5.0 tests=BAYES_00, GIT_PATCH_0, KAM_DMARC_STATUS, 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 sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libc-alpha-bounces~patchwork=sourceware.org@sourceware.org The function `_dl_map_segments` is defined in ``, which provides the canonical implementation (optionally overridden by sysdeps variants). All call sites include `` directly, so declaring `_dl_map_segments` in `dl-load.h` is unnecessary. Keeping a static prototype in `dl-load.h` can trigger -Wunused-function errors when the header is included by translation units that do not include `` and do not reference `_dl_map_segments`. Since glibc builds with `-Werror`, this results in build failures [1]. Remove the redundant declaration from `dl-load.h` to avoid these spurious warnings and keep the declaration colocated with the definition as intended. [1] https://ci.linaro.org/job/tcwg_glibc_build--master-aarch64-precommit/4624/artifact/artifacts/artifacts.precommit/notify/mail-body.txt Reviewed-by: Wilco Dijkstra Signed-off-by: WANG Rui --- elf/dl-load.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/elf/dl-load.h b/elf/dl-load.h index dbc29b335e8..897c4034c5e 100644 --- a/elf/dl-load.h +++ b/elf/dl-load.h @@ -109,14 +109,15 @@ _dl_postprocess_loadcmd (struct link_map *l, const ElfW(Ehdr) *header, The file defines this function. The canonical implementation in elf/dl-map-segments.h might be replaced by a sysdeps - version. */ + version. + static const char *_dl_map_segments (struct link_map *l, int fd, const ElfW(Ehdr) *header, int type, const struct loadcmd loadcmds[], size_t nloadcmds, const size_t maplength, bool has_holes, - struct link_map *loader); + struct link_map *loader); */ /* All the error message strings _dl_map_segments might return are listed here so that different implementations in different sysdeps