Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp602367rwl; Fri, 7 Apr 2023 02:23:10 -0700 (PDT) X-Google-Smtp-Source: AKy350a9j/KBzzC3mBmpJ7A3ptAMFKXTOMWMh1ydQPeNfQLHOMHB21u/jCYFwev/As7pvzaqZWKQ X-Received: by 2002:a62:4ecd:0:b0:627:f659:a771 with SMTP id c196-20020a624ecd000000b00627f659a771mr1582039pfb.12.1680859389895; Fri, 07 Apr 2023 02:23:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1680859389; cv=none; d=google.com; s=arc-20160816; b=nhq7tTsZYT1u6gT7c1/VEBmHvjlQoU2qwoyPC25TOtT8PB62DIx4Xh+XBZef8AWMMx 4S89HJcgH56nUJroWyDgFqadlPEC0Zg8mzGgXEqwHqVrWrPXMlpk4qoXxt0XcZ7TBGxh jjliIJCmNBCRQIjBefVnxzu2I95RWasu5Ls8quzF61mS8jxmTpyNfdfKm1jjfSm3MFYk pYdL7tkJ0A3jP4kFfc7FeKineq6IEv1RUXujcOgeMlWg1pvHUDHqE5DgAuU2wrL1OVWA +zb/xxI9JRwpJwHf+IxzmpZvqSTYsGojm/g1NTwiR5zd0trXo1wPtK6rIJCMwxDexXmK BFyw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=8V6a3jQ06KMD9SizeC1GcSTq95RF9nr7oawQBs1mqNw=; b=IMbDUZPLUPTtvT5/F1WBNFNrt8gOOOeaD4+vOWcLqibxzUJg0651hKZlARMpYSFRdZ b8yK+R4FUG50C2lE1DMzJvw/TNs7s01A/DsZHbjGMY8PGO779zZz/19hVgv4upGb+MZl xfGTLmpfgaWDoiEP8s71oUvLNvPG5XcBE8I6nT+TiUSNLZUlOWpCnQcMianJVxXPEhT8 Siiwx70hyJB2lCXKbx9qyxxVb93SXrT1Xu5B9iIo90/go1mQfIOBw7P/5I1xjyRAqTsd wilYtz6SnVYSSi+JLIz+T3ge2N7Y56Brn7b5LhIH9rmMg4TbyGexC+IITfu+ElMZXqUM uC7w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=SmhaHTMK; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id w19-20020a627b13000000b00626007418c3si3210100pfc.289.2023.04.07.02.22.58; Fri, 07 Apr 2023 02:23:09 -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; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=SmhaHTMK; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240440AbjDGJKi (ORCPT + 99 others); Fri, 7 Apr 2023 05:10:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60676 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231652AbjDGJKh (ORCPT ); Fri, 7 Apr 2023 05:10:37 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DF7C8E9; Fri, 7 Apr 2023 02:10:36 -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 794BE64DCC; Fri, 7 Apr 2023 09:10:36 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id E2B41C433EF; Fri, 7 Apr 2023 09:10:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1680858635; bh=dywClRW4j4O7p5Ksngwq5/7eKvi5yJ/JMWGVgSMfKrg=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=SmhaHTMKberTU3jKu/cfFjAJAG4UHco3QrSttH7hJZqRCRyIcVo3F80q0nz6JkUvP vX7lMtkivLpN3WBMUTJ/kkpjy4fs7hbX5LX9uJDNFaMYlFnTc+EBZZtKnGT7hjSYUA W37a6TvPdIkIzB7uq7PgjTGyGqwPvFYU0JRzitIAQMywYcxpe/AJw8tmL+bIP83asE /BNe2ylBj+xj9lLo1/v1AnYPcyptpEts2o+V3b0T0qdviAbFEDBAoztYWwx0vsNuWz 33hwVAjpZNl0ZULCEw6Z6b0qRQJA7xc4px5V4LhwO28FNP3yD2G2kJ94dmr1UKTMiZ ZFjCeqObG6xSg== Received: by mail-ej1-f41.google.com with SMTP id a640c23a62f3a-9341434fe3cso188299566b.1; Fri, 07 Apr 2023 02:10:35 -0700 (PDT) X-Gm-Message-State: AAQBX9cZqEdfuaZZTmXE6nuPcNq3PZBW8ho1/c6HxZfYCq4CifaGRHCt BFLPQDn6VB+KU7PKavswXDnKD9pCCwIf1Fd5INQ= X-Received: by 2002:a05:6402:14d5:b0:501:e26e:502b with SMTP id f21-20020a05640214d500b00501e26e502bmr1687603edx.29.1680858634187; Fri, 07 Apr 2023 02:10:34 -0700 (PDT) MIME-Version: 1.0 References: <20230406025036.3022894-1-chenhuacai@loongson.cn> In-Reply-To: <20230406025036.3022894-1-chenhuacai@loongson.cn> From: Guo Ren Date: Fri, 7 Apr 2023 17:10:22 +0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH] LoongArch: module: set section addresses to 0x0 To: Huacai Chen Cc: Huacai Chen , loongarch@lists.linux.dev, Xuefeng Li , Xuerui Wang , Jiaxun Yang , linux-kernel@vger.kernel.org, loongson-kernel@lists.loongnix.cn, stable@vger.kernel.org, Chong Qiao Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-5.2 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,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 On Thu, Apr 6, 2023 at 10:51=E2=80=AFAM Huacai Chen wrote: > > 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"). Good point, maybe I would check RISC-V! Thx. Reviewed-by: Guo Ren > > 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/inc= lude/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 { > . =3D 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 > --=20 Best Regards Guo Ren