Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp1649726ybt; Thu, 18 Jun 2020 13:52:14 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx86h6FV77MlweHaWn3g/lG8RHsfmF+Yx407opikqS6xfYePD3HNQYEp/fn3PNTfhDicjAc X-Received: by 2002:a50:f289:: with SMTP id f9mr94980edm.188.1592513534827; Thu, 18 Jun 2020 13:52:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1592513534; cv=none; d=google.com; s=arc-20160816; b=IWQWdP06Bh8jjxUnxrC1VTaqWGeO0kCfuQW92Xhd28pTXXxkP8eongzjh97nYUK/qa RMp//FZxt681/KH8GX4VciHccWap9/JtTXW5vuzyB3wm90yhACk0gTSmuwCHvCqAD0wk +BTHPfrnxP4HlDQ30Y0l58EuawXTl68Jo2dFCUdroOKcreRNWnxRq5YVG01TPL4tZfwk 66y59FypzBErGLqaPXk5iLza3gMvEQjjGOgN3mX9YFz/nm2wL5kdj2wfCh1iZ4fLWifu 0Y6In8II3Qp8bo/Jf4TtJu7NWoYm6tu6J+AnTEhevNdIu4ohgZGWpc4WhUnPlRJYA7yg 5Bag== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=rbH19GpOXLITCGBPzQQyWjanFJICisPHPIgfrJARMIo=; b=VeOEmuEGlQtcNz/kxiDM9d10Vw6FldR4DYkndYcewoufutLdy21286b0joxe5ghSnv 7gg1sgZm+A/tXkIo0zqB30sLWJq33a/YNHAOtRsgfMKhTIflk65vHoQNMHPsb1prJv7E Jh4gw/DinvtgQEflR3IOBKlED65igAT/vR1A9wcRtQBs/juVcBaQPgnMsTnfjM0HGeh5 gEFXYniyZZ4VFpQ8fEIWcND/VDaWwCV4P/HpMrqqfBMGAcNSJ1JlhJqCR6dc7XQnmQ3G HiY9aNgrHQghrtAzKbHinNZljDPxrP+Dqwnb4EJvR33+dU2bO6Opqb+PkZlk2sNOi9aU fRNA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=vmware.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id v10si2917882edy.534.2020.06.18.13.51.52; Thu, 18 Jun 2020 13:52:14 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=vmware.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728291AbgFRUmS (ORCPT + 99 others); Thu, 18 Jun 2020 16:42:18 -0400 Received: from ex13-edg-ou-001.vmware.com ([208.91.0.189]:4380 "EHLO EX13-EDG-OU-001.vmware.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731332AbgFRUjb (ORCPT ); Thu, 18 Jun 2020 16:39:31 -0400 Received: from sc9-mailhost2.vmware.com (10.113.161.72) by EX13-EDG-OU-001.vmware.com (10.113.208.155) with Microsoft SMTP Server id 15.0.1156.6; Thu, 18 Jun 2020 13:39:25 -0700 Received: from sc9-mailhost2.vmware.com (unknown [10.129.221.29]) by sc9-mailhost2.vmware.com (Postfix) with ESMTP id CCDE5B2656; Thu, 18 Jun 2020 16:39:28 -0400 (EDT) From: Matt Helsley To: CC: Josh Poimboeuf , Peter Zijlstra , Steven Rostedt , Julien Thierry , Kamalesh Babulal , Matt Helsley Subject: [RFC][PATCH v5 37/51] objtool: mcount: Simplify mcount name matching Date: Thu, 18 Jun 2020 13:38:23 -0700 Message-ID: <1e3e896fe04c5b4db32152ea4b7966ac22745f9d.1592510545.git.mhelsley@vmware.com> X-Mailer: git-send-email 2.25.4 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 7BIT Content-Type: text/plain; charset=US-ASCII Received-SPF: None (EX13-EDG-OU-001.vmware.com: mhelsley@vmware.com does not designate permitted sender hosts) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Setting altmcount only when processing ARM ELF files is not necessary -- we can make the code easier to read by always checking for the string. Signed-off-by: Matt Helsley --- tools/objtool/mcount.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/tools/objtool/mcount.c b/tools/objtool/mcount.c index ff52697613b1..7e621769c488 100644 --- a/tools/objtool/mcount.c +++ b/tools/objtool/mcount.c @@ -44,7 +44,6 @@ #define R_ARM_THM_CALL 10 static char gpfx; /* prefix for global symbol name (sometimes '_') */ -static const char *altmcount; /* alternate mcount symbol name */ extern int warn_on_notrace_sect; /* warn when section has mcount not being recorded */ static struct elf *lf; @@ -173,7 +172,7 @@ static struct symbol *get_mcount_sym(struct reloc *reloc) if (symname[0] == '.') ++symname; /* ppc64 hack */ if (strcmp(mcount, symname) == 0 || - (altmcount && strcmp(altmcount, symname) == 0) || + (strcmp("__gnu_mcount_nc", symname) == 0) || (strcmp(fentry, symname) == 0)) return sym; return NULL; @@ -567,7 +566,6 @@ static int do_file(char const *const fname) break; case EM_ARM: reltype = R_ARM_ABS32; - altmcount = "__gnu_mcount_nc"; make_nop = make_nop_arm; rel_type_nop = R_ARM_NONE; is_fake_mcount = arm_is_fake_mcount; -- 2.20.1