Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp1543184rwl; Wed, 5 Apr 2023 19:52:30 -0700 (PDT) X-Google-Smtp-Source: AKy350b/Qi/I2dDCU2BhmlJYaHpNJasBOFKJ+Dmz/CnbtDn2aW2HnRCL3sWf0LvgWiVilIbXA1Z0 X-Received: by 2002:a17:903:1c7:b0:19e:8267:9590 with SMTP id e7-20020a17090301c700b0019e82679590mr10356739plh.41.1680749550112; Wed, 05 Apr 2023 19:52:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1680749550; cv=none; d=google.com; s=arc-20160816; b=cVmACbrVCePC8Bqa5j3d7vJrP65WigaPMhHU/+MgBY91e+GpbgPMxMvHKtimMowCcb Kxyt2nn2fIHHhJ2AVWZ5dpfYaD6immS58jbmYNKx0ZG8gZ9+2w6N5vlzfoUtAZpuHR4R MoMmH6CZRa5T4khka/peQ9xSPx9xxp79h6gjYtD08xi1UXwt9onMnyVi0/KJ8I8G/l7U OZeMwezAClcOMc8uUHpXKYPMRfUxEIqOuxJGqRZSmQf7RUFh94OFAkC8XjHVLv5pPCT4 e4LBzETbRXkP8BOW0o59woDHNRCzFiFEgRdmbfWMWN18wixyq0s8uIRCg4hGZjSPsV5Q xb7A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=v5cCqKhmi6E6I5oHA+2JZrTa8rkU8njbbvm/6KQaPXw=; b=Dn6OVScIcijQhQh0iI3fVVK/lYvFuoxDkFkw6gFc4EJqAWjT3txx4fmVWBkMwioeye XYnux6H7RiPF/E+dxutxco2eKcMsrgthxEXNluw3loQicJzHKFaETj8oqAJr0WVc2r4d G6WKuAQe+c6cpXxeS5W5sGakIYHN+m9IADkg/wdwhKu+NHtlOu765tEqgvfnMrOP1NXQ mla84bOSaZKaRl5YFaSFzy7uL4yAQYVNp/yOztUJAERj4QHeVH/tNHLjHx0QEVJTpn6f JsBScif3/ss7D/r+oGAffDmaDKIzG7PluxSiU3BDqczMJ4IajVSOUngTMKEdeckvQEyq sGNw== 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id y17-20020a170902b49100b001a4f2975d0dsi472468plr.448.2023.04.05.19.52.18; Wed, 05 Apr 2023 19:52:30 -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 S235221AbjDFCwB (ORCPT + 99 others); Wed, 5 Apr 2023 22:52:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44738 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234889AbjDFCvm (ORCPT ); Wed, 5 Apr 2023 22:51:42 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7C41FAD2C; Wed, 5 Apr 2023 19:51:03 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 84095638A8; Thu, 6 Apr 2023 02:51:01 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 73A1BC433EF; Thu, 6 Apr 2023 02:50:58 +0000 (UTC) From: Huacai Chen To: Huacai Chen Cc: loongarch@lists.linux.dev, Xuefeng Li , Guo Ren , Xuerui Wang , Jiaxun Yang , linux-kernel@vger.kernel.org, loongson-kernel@lists.loongnix.cn, Huacai Chen , stable@vger.kernel.org, Chong Qiao Subject: [PATCH] LoongArch: module: set section addresses to 0x0 Date: Thu, 6 Apr 2023 10:50:36 +0800 Message-Id: <20230406025036.3022894-1-chenhuacai@loongson.cn> X-Mailer: git-send-email 2.39.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-4.8 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, RCVD_IN_DNSWL_HI,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 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 These got*, plt* and .text.ftrace_trampoline sections specified for LoongArch have non-zero addressses. Non-zero section addresses in a relocatable ELF would confuse GDB when it tries to compute the section offsets and it ends up printing wrong symbol addresses. Therefore, set them to zero, which mirrors the change in commit 5d8591bc0fbaeb6ded ("arm64 module: set plt* section addresses to 0x0"). Cc: stable@vger.kernel.org Signed-off-by: Chong Qiao Signed-off-by: Huacai Chen --- arch/loongarch/include/asm/module.lds.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/arch/loongarch/include/asm/module.lds.h b/arch/loongarch/include/asm/module.lds.h index 438f09d4ccf4..88554f92e010 100644 --- a/arch/loongarch/include/asm/module.lds.h +++ b/arch/loongarch/include/asm/module.lds.h @@ -2,8 +2,8 @@ /* Copyright (C) 2020-2022 Loongson Technology Corporation Limited */ SECTIONS { . = ALIGN(4); - .got : { BYTE(0) } - .plt : { BYTE(0) } - .plt.idx : { BYTE(0) } - .ftrace_trampoline : { BYTE(0) } + .got 0 : { BYTE(0) } + .plt 0 : { BYTE(0) } + .plt.idx 0 : { BYTE(0) } + .ftrace_trampoline 0 : { BYTE(0) } } -- 2.39.1