Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp1649372ybt; Thu, 18 Jun 2020 13:51:39 -0700 (PDT) X-Google-Smtp-Source: ABdhPJypleGg8/WmWYlZxpPeqb6qWR31Z65I156c0cpUagkiFeJztJR6H5MfyIFxh+VsCHJaBZUA X-Received: by 2002:a17:906:5c0a:: with SMTP id e10mr511712ejq.389.1592513499299; Thu, 18 Jun 2020 13:51:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1592513499; cv=none; d=google.com; s=arc-20160816; b=oNiHZatQ3+tszhd0G+T2ZydZJQxW0E5jfYzSwMY6DRtPLlvncraJbFqzLA4XYTBRhz /0vTZAKhSUmVJWLxXXexIcmUxPD8HphBn4RBO88jb82/23xl+faRrzrtbMq0ePiMv8d5 ytr2vVaS4poU2/jUHb+Y7t1RyrzDeZpEHtf/gPVapg0MS0QO+LL/bsjvdzdF/V90mzr9 W8Ib35i4bBUmKrcYbSm7co5CMQU/tto723yOt7z+hyVOh643kIJpysVWQ+qe7z2ecZxg JD0Bxh7EYvHD7/TFWiDsFyw+18phLFiCiUrMt2Yy3JZcrRpiPK06oakM2ptvd0fbmV+E uVlw== 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=5ZdS1gnbRSL7uXZJEm+hHXdNClReSCGVJ2NR9xlKevU=; b=xpumi0LXnfclHTzb9Uf0WJApVxZj8maLNWxWCcmgK6xNfGYwkrjOeXB//0I9RDLqPp We9HmOxxcen+SEP5QxYUowimcL6xW5OO0PRw/1t/h5dd04rEUgGEzG1QIrJgi9O26gBA SmyMXl4/6JwXc6KaH/XKaE4X7qARCNN9pTziZruyJgKigDRkrHJn8jINTR+iknlTdd1G QJq+v2tHjhmHkhq70Nw3IqJYoS59m0rkxrBpj4QZ75wUbeEu09xeYM0H9Inru8qLdmKE HX2sAtZP0iSIGz8Ft2tKfzRB5rJNVEUmYTOGUKgF9ri9Sr3p3Iv353t0EpCvonjlffr1 zBMg== 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 a2si2700656edk.226.2020.06.18.13.51.16; Thu, 18 Jun 2020 13:51:39 -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 S1731828AbgFRUmC (ORCPT + 99 others); Thu, 18 Jun 2020 16:42:02 -0400 Received: from ex13-edg-ou-002.vmware.com ([208.91.0.190]:36734 "EHLO EX13-EDG-OU-002.vmware.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730903AbgFRUjf (ORCPT ); Thu, 18 Jun 2020 16:39:35 -0400 Received: from sc9-mailhost2.vmware.com (10.113.161.72) by EX13-EDG-OU-002.vmware.com (10.113.208.156) with Microsoft SMTP Server id 15.0.1156.6; Thu, 18 Jun 2020 13:39:24 -0700 Received: from sc9-mailhost2.vmware.com (unknown [10.129.221.29]) by sc9-mailhost2.vmware.com (Postfix) with ESMTP id 33D4DB265B; Thu, 18 Jun 2020 16:39:27 -0400 (EDT) From: Matt Helsley To: CC: Josh Poimboeuf , Peter Zijlstra , Steven Rostedt , Julien Thierry , Kamalesh Babulal , Matt Helsley Subject: [RFC][PATCH v5 35/51] objtool: mcount: Remove endian wrappers Date: Thu, 18 Jun 2020 13:38:21 -0700 Message-ID: <72408e62826ff1ef26568104cd63dd1851a96dd4.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-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 7f4d18e83e24..ff52697613b1 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) { @@ -571,22 +524,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; @@ -594,12 +537,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