Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp913074ybb; Fri, 10 Apr 2020 12:42:32 -0700 (PDT) X-Google-Smtp-Source: APiQypLKXF/2Ai1cPg0emrMvK/LRt1g7RqSfzs3OcyTXpYWp2YVt0jmg9sBe1DiD/Dy4gJuExqcf X-Received: by 2002:ae9:e210:: with SMTP id c16mr5342586qkc.179.1586547752509; Fri, 10 Apr 2020 12:42:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1586547752; cv=none; d=google.com; s=arc-20160816; b=uN9UGJtkmEk2nLqR/paIkqQfNv1y/6iKWspbYiGRB0hjaA96jH8QyGZJ+K+saKTvIx H4XdsyPkBTmAjEXaaxeO6q4qQK+O/rSAlzDkFtPvKwrUw3KOsPvYl9Y/viMUwGr20EPf 4gAejrPpd0P+z7B1fKIXP/YZI0uzSho2hC95nor2kdw6DF4Oo4cwZPeSzycVX4wQVImA gEtMHMvzCvPUfzGayziA1bc3TWk6XB/j8Gws9SO/cXUT22vY4n5uRetgMM8LvMDAEgVU Rywohctw3OZ9Tcn/kW4LEbojcf6pjs7EdOxHNgURQcDYyd/UsK7X6C8wwfFmVXNdvlmo lcmQ== 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=2z+5zFHZprhMwB/l/U5AKJZvYiPrcwBTN2BCp6ZldPI=; b=U/zdolW6RHlXqrPE/9XsvW9vvj8R9ANFoE5NJWGj4QIWYu/hfeiLSN4NW/Gg+hl+ym dngU47Bn0d8YwJGaMg3LG+5ggujr1bEghowq7FJyKwMFz/latYZjYEmJy+Y5pGvjxIpK +bRIZn+4jZQQlKsQ6pr69n8dQ+SFexZklsX3D7yPRK/nE51AHKk1x3Q1QIt6SUkhA96Z f/vdpLfBQoY6wYk3GF6k6cu1zgLF66st08pMz9Cp1VN5ZA10xBMbCGmBrAkoO4xFYbrW S0eO8v5+lJmSRUCFMRFXBO9WnQQuVOcFMoMparh6MErVJecyoMwmJuoroSgbnPtN5Sig J1FA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=NONE dis=NONE) header.from=vmware.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id p9si1142666qkh.125.2020.04.10.12.42.17; Fri, 10 Apr 2020 12:42:32 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=NONE dis=NONE) header.from=vmware.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726858AbgDJTlc (ORCPT + 99 others); Fri, 10 Apr 2020 15:41:32 -0400 Received: from ex13-edg-ou-002.vmware.com ([208.91.0.190]:36243 "EHLO EX13-EDG-OU-002.vmware.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726783AbgDJTl3 (ORCPT ); Fri, 10 Apr 2020 15:41:29 -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; Fri, 10 Apr 2020 12:39:39 -0700 Received: from sc9-mailhost3.vmware.com (unknown [10.166.69.226]) by sc9-mailhost2.vmware.com (Postfix) with ESMTP id 68E18B2D1A; Fri, 10 Apr 2020 15:39:43 -0400 (EDT) From: Matt Helsley To: CC: Josh Poimboeuf , Peter Zijlstra , Julien Thierry , Ingo Molnar , Steven Rostedt , Miroslav Benes , Matt Helsley Subject: [RFC][PATCH 36/36] objtool: mcount: Remove wordsized endian wrappers Date: Fri, 10 Apr 2020 12:35:59 -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 50834b065e16..fd66e26f21a8 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