Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp9575307rwd; Wed, 21 Jun 2023 09:04:06 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4mcmt/ruwlo7fhjUxCNDKkPl2X8aDqQfOnBWyaMqbYwWJNS7+8WcnUNfHGPOvn2x18sKSu X-Received: by 2002:a05:6a20:548c:b0:123:100e:c8ae with SMTP id i12-20020a056a20548c00b00123100ec8aemr3604907pzk.52.1687363446634; Wed, 21 Jun 2023 09:04:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687363446; cv=none; d=google.com; s=arc-20160816; b=qL9A6qYrmCl/Fx0c1nhS2EmR3UbOElQ8agKvEuNlSaFqU2iGZcUeE6xVYazf1EB5fR Jo5K1+hGDoNP44bd81XFP1Ho2EpoRfX/sLTe9u8CjJCiybA1hNNd8IHAZqLENyMCawRD KTTiNPw01V1Hb9ylH9XtGCtrcIT+d8RBV9d9vzU8k0Nw8LD1gvHL1UZ5oqO+lO+jIcDv uSDOkH7micAcn87PoUk+VVCAJfzT+L6Jc2DvJ8e0L7GmNqODUZqhrOx1KAZPKpyZ+mtJ zlNO5lNVYfmPrtDC0aKPCYc2jH0EIBrLwvMMhq28mjcncIeiZYuw49mG42tO2vonB0ci j2Xg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=4f+mcooyDvaZTWnXHhSUB7Xqh2JCpivVsAirCOtHWSU=; b=u2+MMnP6ll/x6WNXeG/m1k0Txx8SayIXKsHJkG0j+wxYL7JwUSeECXm7RAZNo1DEy3 A2u2mMXj0gMncnnYO/8Do3f4p/c2nwJ7yGBjZoWmQsNjoa/uKUMPSCgUbqOAB0wlSxc1 +V73kMu83g0IxsDsegrI86f9MN5LnS0G+9q8svybRzKn36rWKTScSSGPA8Zo4abUCxDi LRaWJfWeF0DMP/357BmNBb4J8OH5o8fIvlqeJuyKib+YRdU/L3/DZ7B6yabkGlFVbxCM 2W0Tu1CJZ4DmIO1q5Q72OzH9cymMd85V8++KWSx6Nku1/ftKd3dMYlghibKyXcSYvg1C 2FVA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=csgroup.eu Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id p19-20020a637413000000b00502f4fd0c16si4516231pgc.653.2023.06.21.09.03.51; Wed, 21 Jun 2023 09:04:06 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=csgroup.eu Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233357AbjFUPW5 (ORCPT + 99 others); Wed, 21 Jun 2023 11:22:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59200 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230195AbjFUPWe (ORCPT ); Wed, 21 Jun 2023 11:22:34 -0400 Received: from pegase1.c-s.fr (pegase1.c-s.fr [93.17.236.30]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 439EE2D7F for ; Wed, 21 Jun 2023 08:20:45 -0700 (PDT) Received: from localhost (mailhub3.si.c-s.fr [192.168.12.233]) by localhost (Postfix) with ESMTP id 4QmRz004c7z9sJj; Wed, 21 Jun 2023 17:20:44 +0200 (CEST) X-Virus-Scanned: amavisd-new at c-s.fr Received: from pegase1.c-s.fr ([192.168.12.234]) by localhost (pegase1.c-s.fr [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id pCGSmOT-fKYY; Wed, 21 Jun 2023 17:20:43 +0200 (CEST) Received: from messagerie.si.c-s.fr (messagerie.si.c-s.fr [192.168.25.192]) by pegase1.c-s.fr (Postfix) with ESMTP id 4QmRyx2PMJz9sJs; Wed, 21 Jun 2023 17:20:41 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by messagerie.si.c-s.fr (Postfix) with ESMTP id 4EE338B779; Wed, 21 Jun 2023 17:20:41 +0200 (CEST) X-Virus-Scanned: amavisd-new at c-s.fr Received: from messagerie.si.c-s.fr ([127.0.0.1]) by localhost (messagerie.si.c-s.fr [127.0.0.1]) (amavisd-new, port 10023) with ESMTP id dIDcK9DBKVGZ; Wed, 21 Jun 2023 17:20:41 +0200 (CEST) Received: from PO20335.IDSI0.si.c-s.fr (unknown [172.25.230.108]) by messagerie.si.c-s.fr (Postfix) with ESMTP id 24B988B763; Wed, 21 Jun 2023 17:20:41 +0200 (CEST) Received: from PO20335.IDSI0.si.c-s.fr (localhost [127.0.0.1]) by PO20335.IDSI0.si.c-s.fr (8.17.1/8.16.1) with ESMTPS id 35LFKbuK2124260 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT); Wed, 21 Jun 2023 17:20:37 +0200 Received: (from chleroy@localhost) by PO20335.IDSI0.si.c-s.fr (8.17.1/8.17.1/Submit) id 35LFKbQZ2124256; Wed, 21 Jun 2023 17:20:37 +0200 X-Authentication-Warning: PO20335.IDSI0.si.c-s.fr: chleroy set sender to christophe.leroy@csgroup.eu using -f From: Christophe Leroy To: Josh Poimboeuf , Peter Zijlstra Cc: Christophe Leroy , linux-kernel@vger.kernel.org, linuxppc-dev@lists.ozlabs.org Subject: [PATCH] objtool: Make 'sec-address' always on Date: Wed, 21 Jun 2023 17:20:31 +0200 Message-Id: X-Mailer: git-send-email 2.40.1 MIME-Version: 1.0 X-Developer-Signature: v=1; a=ed25519-sha256; t=1687360830; l=2749; i=christophe.leroy@csgroup.eu; s=20211009; h=from:subject:message-id; bh=cug9KrnhkD0tWNRN91NqNAgvx0YYURd13fBg+W5IvHQ=; b=MSMupOM8tiZHXuHmbGUr+49tsvsHOoMqLJJr6dQ9WAhib0c9wQaeZlV1OoHElkm//dypb0DWq 8Ers3uhG87CCZKBc1aSQNebBr5BBhwJHfoFpOCSe2UDbQpXq9wSto2C X-Developer-Key: i=christophe.leroy@csgroup.eu; a=ed25519; pk=HIzTzUj91asvincQGOFx6+ZF5AoUuP9GdOtQChs7Mm0= Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,NO_DNS_FOR_FROM, T_SCC_BODY_TEXT_LINE,T_SPF_HELO_TEMPERROR,T_SPF_TEMPERROR autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Most of the time objtool warnings are useless without the absolute address within the section. Today there is --sec-address option to get it printed, but that option is nowhere used and requires a change in Makefile to use it. Having the address inside the section at all time in addition to the address within the object doesn't hurt and will help. Remove the --sec-address option and print it at all time. Signed-off-by: Christophe Leroy --- tools/objtool/builtin-check.c | 1 - tools/objtool/include/objtool/builtin.h | 1 - tools/objtool/include/objtool/warn.h | 6 ++---- 3 files changed, 2 insertions(+), 6 deletions(-) diff --git a/tools/objtool/builtin-check.c b/tools/objtool/builtin-check.c index 7c175198d09f..d5024a95467a 100644 --- a/tools/objtool/builtin-check.c +++ b/tools/objtool/builtin-check.c @@ -91,7 +91,6 @@ static const struct option check_options[] = { OPT_BOOLEAN(0, "module", &opts.module, "object is part of a kernel module"), OPT_BOOLEAN(0, "mnop", &opts.mnop, "nop out mcount call sites"), OPT_BOOLEAN(0, "no-unreachable", &opts.no_unreachable, "skip 'unreachable instruction' warnings"), - OPT_BOOLEAN(0, "sec-address", &opts.sec_address, "print section addresses in warnings"), OPT_BOOLEAN(0, "stats", &opts.stats, "print statistics"), OPT_END(), diff --git a/tools/objtool/include/objtool/builtin.h b/tools/objtool/include/objtool/builtin.h index 2a108e648b7a..af79618cf6ab 100644 --- a/tools/objtool/include/objtool/builtin.h +++ b/tools/objtool/include/objtool/builtin.h @@ -35,7 +35,6 @@ struct opts { bool mnop; bool module; bool no_unreachable; - bool sec_address; bool stats; }; diff --git a/tools/objtool/include/objtool/warn.h b/tools/objtool/include/objtool/warn.h index b1c920dc9516..2db9717d0558 100644 --- a/tools/objtool/include/objtool/warn.h +++ b/tools/objtool/include/objtool/warn.h @@ -21,7 +21,6 @@ static inline char *offstr(struct section *sec, unsigned long offset) bool is_text = (sec->sh.sh_flags & SHF_EXECINSTR); struct symbol *sym = NULL; char *str; - int len; if (is_text) sym = find_func_containing(sec, offset); @@ -30,9 +29,8 @@ static inline char *offstr(struct section *sec, unsigned long offset) if (sym) { str = malloc(strlen(sym->name) + strlen(sec->name) + 40); - len = sprintf(str, "%s+0x%lx", sym->name, offset - sym->offset); - if (opts.sec_address) - sprintf(str+len, " (%s+0x%lx)", sec->name, offset); + sprintf(str, "%s+0x%lx (%s+0x%lx)", sym->name, + offset - sym->offset, sec->name, offset); } else { str = malloc(strlen(sec->name) + 20); sprintf(str, "%s+0x%lx", sec->name, offset); -- 2.40.1