Received: by 2002:a25:683:0:0:0:0:0 with SMTP id 125csp1544496ybg; Tue, 2 Jun 2020 12:56:35 -0700 (PDT) X-Google-Smtp-Source: ABdhPJziW6sGnoBfDuknsLbybVzYACsvalJhHJhbANvK/XDcymzfoQMm/p/t53dHy5osKmU16xkt X-Received: by 2002:a17:906:35cf:: with SMTP id p15mr24869895ejb.520.1591127795704; Tue, 02 Jun 2020 12:56:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1591127795; cv=none; d=google.com; s=arc-20160816; b=DUVH5gx61YyLNStfYxhPlEtsqKMZgxa5w3BcTYD8t+MHWSLSB+XNvw6MqMHZ9N7C1o WBbF2QBorf5Cob9faLL2w/cNf9VTgWOCne2Yy0rag52vlpQUaHn/UrP1xzcpmC9CpUMZ YEpoE1lLhR774crp9/7Fk9IiJJwRR4dAcAEz1arWTtvbQUNHM7d49AoX/GBRtqALIlKn Hipa7VClRu0oWX50UvNkGX5zJDJAE92n3kR2Y6EOukS4F43DsfAS//0EYoo2F1uZAi0V OBn9jzETKGMMa+afdyIxYYSbDxrqAcl1mUzuOZZAKOvprnws6ZpMKLPbfMNNwlwpEuQ6 8tjw== 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=38WsjW+n3RnWjmOTvV6JdFWnKZMyPXay8xdiO5+MzfM=; b=gplXVEwNi+xfHv5fnBKpq5E1M2Oqxvv2wVkhCE87b6XxKLaCu+SQSvG7JrnbSg+p2j pz01SASm3Eis/kHsblVDB6l/ZgfX+l8KSH8uizt6ICfiVlelUK/odlFllD2CExxb2jYL 8OMuYJ7lPmYhU4GFgNfxR/VNUQsY+TRBmOQF0tgXsG2xbYs2EkPkHJ1CkpoAPWqtwHFV fswaoCYo+cnlfFZUZgE4Sn57y6MOA82GToNspflBCnWN0YOw5bS8wVJR4tYy1YxtApnl L/pYHjmEcuv/wj07sC9NuqI4ezqg1/WZ62eBnbER0c9Ww6zbvfAf3owIyagLGRcKK/Sf Ok0Q== 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 nh7si1919244ejb.155.2020.06.02.12.56.11; Tue, 02 Jun 2020 12:56:35 -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 S1728783AbgFBTxK (ORCPT + 99 others); Tue, 2 Jun 2020 15:53:10 -0400 Received: from ex13-edg-ou-002.vmware.com ([208.91.0.190]:29399 "EHLO EX13-EDG-OU-002.vmware.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728758AbgFBTxF (ORCPT ); Tue, 2 Jun 2020 15:53:05 -0400 Received: from sc9-mailhost3.vmware.com (10.113.161.73) by EX13-EDG-OU-002.vmware.com (10.113.208.156) with Microsoft SMTP Server id 15.0.1156.6; Tue, 2 Jun 2020 12:51:10 -0700 Received: from sc9-mailhost3.vmware.com (unknown [10.200.192.49]) by sc9-mailhost3.vmware.com (Postfix) with ESMTP id A408740BEE; Tue, 2 Jun 2020 12:51:10 -0700 (PDT) From: Matt Helsley To: CC: Josh Poimboeuf , Peter Zijlstra , Steven Rostedt , Sami Tolvanen , Julien Thierry , Kamalesh Babulal , Matt Helsley Subject: [RFC][PATCH v4 31/32] objtool: mcount: Remove endian wrappers Date: Tue, 2 Jun 2020 12:50:24 -0700 Message-ID: X-Mailer: git-send-email 2.25.1 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-002.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 Now that they're no longer used we can remove these endian wrappers. Signed-off-by: Matt Helsley --- tools/objtool/recordmcount.c | 63 ------------------------------------ 1 file changed, 63 deletions(-) diff --git a/tools/objtool/recordmcount.c b/tools/objtool/recordmcount.c index 6980c0a8bdc3..aa2f6a64bff0 100644 --- a/tools/objtool/recordmcount.c +++ b/tools/objtool/recordmcount.c @@ -149,53 +149,6 @@ static int make_nop_arm64(struct section *txts, size_t const offset) return 0; } -/* w8rev, w8nat, ...: Handle endianness. */ - -static uint64_t w8rev(uint64_t const x) -{ - return ((0xff & (x >> (0 * 8))) << (7 * 8)) - | ((0xff & (x >> (1 * 8))) << (6 * 8)) - | ((0xff & (x >> (2 * 8))) << (5 * 8)) - | ((0xff & (x >> (3 * 8))) << (4 * 8)) - | ((0xff & (x >> (4 * 8))) << (3 * 8)) - | ((0xff & (x >> (5 * 8))) << (2 * 8)) - | ((0xff & (x >> (6 * 8))) << (1 * 8)) - | ((0xff & (x >> (7 * 8))) << (0 * 8)); -} - -static uint32_t w4rev(uint32_t const x) -{ - return ((0xff & (x >> (0 * 8))) << (3 * 8)) - | ((0xff & (x >> (1 * 8))) << (2 * 8)) - | ((0xff & (x >> (2 * 8))) << (1 * 8)) - | ((0xff & (x >> (3 * 8))) << (0 * 8)); -} - -static uint32_t w2rev(uint16_t const x) -{ - return ((0xff & (x >> (0 * 8))) << (1 * 8)) - | ((0xff & (x >> (1 * 8))) << (0 * 8)); -} - -static uint64_t w8nat(uint64_t const x) -{ - return x; -} - -static uint32_t w4nat(uint32_t const x) -{ - return x; -} - -static uint32_t w2nat(uint16_t const x) -{ - return x; -} - -static uint64_t (*w8)(uint64_t); -static uint32_t (*w)(uint32_t); -static uint32_t (*w2)(uint16_t); - /* Names of the sections that could contain calls to mcount. */ static int is_mcounted_section_name(char const *const txtname) { @@ -579,22 +532,12 @@ static int do_file(char const *const fname) goto out; } - w = w4nat; - w2 = w2nat; - w8 = w8nat; switch (lf->ehdr.e_ident[EI_DATA]) { - static unsigned int const endian = 1; default: fprintf(stderr, "unrecognized ELF data encoding %d: %s\n", lf->ehdr.e_ident[EI_DATA], fname); goto out; case ELFDATA2LSB: - if (*(unsigned char const *)&endian != 1) { - /* objtool is big endian, file.o is little endian. */ - w = w4rev; - w2 = w2rev; - w8 = w8rev; - } ideal_nop4_arm = ideal_nop4_arm_le; bl_mcount_arm = bl_mcount_arm_le; push_arm = push_arm_le; @@ -602,12 +545,6 @@ static int do_file(char const *const fname) push_bl_mcount_thumb = push_bl_mcount_thumb_le; break; case ELFDATA2MSB: - if (*(unsigned char const *)&endian != 0) { - /* objtool is little endian, file.o is big endian. */ - w = w4rev; - w2 = w2rev; - w8 = w8rev; - } ideal_nop4_arm = ideal_nop4_arm_be; bl_mcount_arm = bl_mcount_arm_be; push_arm = push_arm_be; -- 2.20.1