From patchwork Tue May 9 06:55:52 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tiezhu Yang X-Patchwork-Id: 91399 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp2678227vqo; Tue, 9 May 2023 00:09:48 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6SLikE3shjhJ1BObG9SM+RvAWBCfOM9ydIx+KKJqdwDL5VQ18CGPMQfBd9euJUGUOkCNPo X-Received: by 2002:a05:6a20:9f4d:b0:eb:a859:cace with SMTP id ml13-20020a056a209f4d00b000eba859cacemr14342571pzb.41.1683616187857; Tue, 09 May 2023 00:09:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1683616187; cv=none; d=google.com; s=arc-20160816; b=BycedvgUIbknkXQKfp6RnGQtceyas0PPFf+5Zo4Ex5xCb3Y4dNvar1eBAZA2tfdNOX Qb0t5W1N12Xt478ldJ/4sS9LP/G2y+WHy6T4HiW9l/0svE6HSgieDGp0HrJ1h2Lx6mfC FrNn/A1bJh6beEufYyOrMNKDxufPyi5Ddq33/Xba4q7OAm65Y+Xk9SV419+S762W2Fw8 bxiyv9TGlKw5y7h3HfJpW1RhHDVls3NHIjwEIBEgRqdK4bZRYDsfsPMbHXMrxfKjCfvC LY41J34l0O1k4WQtNXOi2XeNl7lSmew9gnP4ILzy303wKHeXQiz5IC3CcowvZQ4mZkYP vnXw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:message-id:date:subject:cc:to:from; bh=UlQmMKu5zfOGCmDWxkKCb1bajxV/GViWCjGvsiQwSiQ=; b=jDkY8pyzd0jq/8Ad6MSjsw4q7YjcgziSODj1/hwYsISS2HOm1FyWunYdvoYqfSHCci TFB+n33sRFk9raFFEv/wjLAUaCyp2laUhdh2YqoY/Mq+znLdptULnQdR4rL6DpGq67qk 9ZVqI88yrsOu1WvigZt0ohDIT5TEE9OXRtM5oYCd7W+u2Wjt2cKnXzV58sxDHi6NAYFH NU3x1413LAcsv8X/xz6IioxvVu4VrWLe8joYPk1/XktGwkPw5o+XVZjnHXIUSihxsvpi OT7nK85e1EQxztwBeUuooysZa9daKv+7AsKXQsc4Vw3FS00GylE4gtRnnHjtqsOKQ4BY 4Ybw== 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 Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id e25-20020a633719000000b0050aad8e18a5si836868pga.545.2023.05.09.00.09.32; Tue, 09 May 2023 00:09:47 -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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235107AbjEIG4K (ORCPT + 99 others); Tue, 9 May 2023 02:56:10 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57842 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235109AbjEIGz4 (ORCPT ); Tue, 9 May 2023 02:55:56 -0400 Received: from loongson.cn (mail.loongson.cn [114.242.206.163]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id E81F54ECE; Mon, 8 May 2023 23:55:54 -0700 (PDT) Received: from loongson.cn (unknown [113.200.148.30]) by gateway (Coremail) with SMTP id _____8BxrOp57llkjN4GAA--.11631S3; Tue, 09 May 2023 14:55:53 +0800 (CST) Received: from linux.localdomain (unknown [113.200.148.30]) by localhost.localdomain (Coremail) with SMTP id AQAAf8BxoOR47llkUDtSAA--.16572S2; Tue, 09 May 2023 14:55:53 +0800 (CST) From: Tiezhu Yang To: Peter Zijlstra , Ingo Molnar , Arnaldo Carvalho de Melo , Mark Rutland , Alexander Shishkin , Jiri Olsa , Namhyung Kim , Ian Rogers , Adrian Hunter Cc: linux-perf-users@vger.kernel.org, loongarch@lists.linux.dev, linux-kernel@vger.kernel.org, loongson-kernel@lists.loongnix.cn Subject: [PATCH] perf symbol: Add LoongArch case in get_plt_sizes() Date: Tue, 9 May 2023 14:55:52 +0800 Message-Id: <1683615352-10794-1-git-send-email-yangtiezhu@loongson.cn> X-Mailer: git-send-email 2.1.0 X-CM-TRANSID: AQAAf8BxoOR47llkUDtSAA--.16572S2 X-CM-SenderInfo: p1dqw3xlh2x3gn0dqz5rrqw2lrqou0/ X-Coremail-Antispam: 1Uk129KBjvdXoW7Jr4DWFWxGr1UGF4Utw47Jwb_yoWkGwb_ta 4fuF40yw1UArWvyrWDCrW5uFWruayrZFs5uFyDWw4xCa1ftF45WF47Zr93uF15Zw1Yvr9x Jwn2q3yfArs8GjkaLaAFLSUrUUUUYb8apTn2vfkv8UJUUUU8wcxFpf9Il3svdxBIdaVrn0 xqx4xG64xvF2IEw4CE5I8CrVC2j2Jv73VFW2AGmfu7bjvjm3AaLaJ3UjIYCTnIWjp_UUUY W7kC6x804xWl14x267AKxVWUJVW8JwAFc2x0x2IEx4CE42xK8VAvwI8IcIk0rVWrJVCq3w AFIxvE14AKwVWUXVWUAwA2ocxC64kIII0Yj41l84x0c7CEw4AK67xGY2AK021l84ACjcxK 6xIIjxv20xvE14v26r4j6ryUM28EF7xvwVC0I7IYx2IY6xkF7I0E14v26r4j6F4UM28EF7 xvwVC2z280aVAFwI0_Cr1j6rxdM28EF7xvwVC2z280aVCY1x0267AKxVWxJr0_GcWln4kS 14v26r1q6r43M2AIxVAIcxkEcVAq07x20xvEncxIr21l57IF6xkI12xvs2x26I8E6xACxx 1l5I8CrVACY4xI64kE6c02F40Ex7xfMcIj6xIIjxv20xvE14v26r1q6rW5McIj6I8E87Iv 67AKxVW8JVWxJwAm72CE4IkC6x0Yz7v_Jr0_Gr1lF7xvr2IYc2Ij64vIr41lc7CjxVAaw2 AFwI0_Jw0_GFyl42xK82IYc2Ij64vIr41l4I8I3I0E4IkC6x0Yz7v_Jr0_Gr1l4IxYO2xF xVAFwI0_Jw0_GFylx2IqxVAqx4xG67AKxVWUJVWUGwC20s026x8GjcxK67AKxVWUGVWUWw C2zVAF1VAY17CE14v26r1q6r43MIIYrxkI7VAKI48JMIIF0xvE2Ix0cI8IcVAFwI0_Gr0_ Xr1lIxAIcVC0I7IYx2IY6xkF7I0E14v26r4j6F4UMIIF0xvE42xK8VAvwI8IcIk0rVWUJV WUCwCI42IY6I8E87Iv67AKxVW8JVWxJwCI42IY6I8E87Iv6xkF7I0E14v26r4j6r4UJbIY CTnIWIevJa73UjIFyTuYvjxUstxhDUUUU X-Spam-Status: No, score=1.4 required=5.0 tests=BAYES_00,RCVD_IN_SBL_CSS, SPF_HELO_PASS,SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.6 X-Spam-Level: * 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1765399527799231857?= X-GMAIL-MSGID: =?utf-8?q?1765399527799231857?= We can see the following definitions in bfd/elfnn-loongarch.c: #define PLT_HEADER_INSNS 8 #define PLT_HEADER_SIZE (PLT_HEADER_INSNS * 4) #define PLT_ENTRY_INSNS 4 #define PLT_ENTRY_SIZE (PLT_ENTRY_INSNS * 4) so plt header size is 32 and plt entry size is 16 on LoongArch, let us add LoongArch case in get_plt_sizes(). Link: https://sourceware.org/git/?p=binutils-gdb.git;a=blob;f=bfd/elfnn-loongarch.c Signed-off-by: Tiezhu Yang Reviewed-by: Leo Yan --- This is based on 6.4-rc1 tools/perf/util/symbol-elf.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tools/perf/util/symbol-elf.c b/tools/perf/util/symbol-elf.c index b2ed9cc..5d409c2 100644 --- a/tools/perf/util/symbol-elf.c +++ b/tools/perf/util/symbol-elf.c @@ -411,6 +411,10 @@ static bool get_plt_sizes(struct dso *dso, GElf_Ehdr *ehdr, GElf_Shdr *shdr_plt, *plt_header_size = 32; *plt_entry_size = 16; return true; + case EM_LOONGARCH: + *plt_header_size = 32; + *plt_entry_size = 16; + return true; case EM_SPARC: *plt_header_size = 48; *plt_entry_size = 12;