From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id ED766C433F5 for ; Thu, 31 Mar 2022 10:39:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=UiDEW3J7S6aw8UntW2uk8rNJhwlYGfrJz6mgKBUtCL4=; b=sbAE72usxYEZ/x zEe0t4toEh50jOc8tdLWYM4BC5Z5bQcYVEYuxEQ9W/TJp4n9C83wADxvAqG7TqZqwkk8q8gDuHxPy A+QWQoaj/lYKNpsyBU5eGAE/i5ITCNWmo9VXF/ha/ixVeX8+MtGoIeDdvNwn2/0JaEavxtPOY7plq NhAtxIG+2OTNxYeHg4/HSTRpa5pk44kFuHqkF1rRaC+4zPfad/SaNZlWajfo7eSNHIfhhkOYfxZ5Y G1fz9PhEp+awk8sWcjVZaG6OawyyvMiQXpaO7nB+WjrcZKJeEuTph77j1G/Nh82+frbQcAxEDNBGQ gBFRV1re0kFOFMuQGVyw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nZsCK-001sbW-OI; Thu, 31 Mar 2022 10:38:36 +0000 Received: from pandora.armlinux.org.uk ([2001:4d48:ad52:32c8:5054:ff:fe00:142]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nZsCH-001say-Im for linux-arm-kernel@lists.infradead.org; Thu, 31 Mar 2022 10:38:35 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=armlinux.org.uk; s=pandora-2019; h=Sender:In-Reply-To:Content-Type: MIME-Version:References:Message-ID:Subject:Cc:To:From:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=C4gut2Gs2tGGDwpbtPOp9BY91dLh0/JG5xCqO02wx44=; b=Dt92fm314sS//aZxisN4PUWhMl vfJ3J5MC94SPvvjqlBPfKm/v9OtaBueD3VRlJhHzLPc3UU0q1m6ygf5aSkKZ/AFW6nkItDUV8fuQg BUUtN4YkXSySDxDyubwtqloBZGxI1+kC7c8Y4WL0l4eCzXqY8WnYxXGh3Ad5C5h2iNflXrBK+m22b PVTUHE8yojBGUoI5ccqMFiZnJvHEriVrt6qwauRsKuPLG3E13zp5BWiZQZJO20WDksYwEEHAVefFX 2Psy9ny0luN197a2+UUEObCjRY9rIvlrkD4tI8kyGRn1NK5Bi8jyUUlU4TknWlN4HOMeAltmq74C8 rxpq47FQ==; Received: from shell.armlinux.org.uk ([fd8f:7570:feb6:1:5054:ff:fe00:4ec]:58046) by pandora.armlinux.org.uk with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1nZsCD-0004eE-EX; Thu, 31 Mar 2022 11:38:29 +0100 Received: from linux by shell.armlinux.org.uk with local (Exim 4.94.2) (envelope-from ) id 1nZsCC-0007XP-Eq; Thu, 31 Mar 2022 11:38:28 +0100 Date: Thu, 31 Mar 2022 11:38:28 +0100 From: "Russell King (Oracle)" To: Chen Zhongjin Cc: alexander.sverdlin@nokia.com, ardb@kernel.org, linus.walleij@linaro.org, nico@fluxnic.net, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2] ARM: module: Add all unwind tables when load module Message-ID: References: <20220331090909.113387-1-chenzhongjin@huawei.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20220331090909.113387-1-chenzhongjin@huawei.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220331_033833_656661_6BF777BA X-CRM114-Status: GOOD ( 11.31 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Thu, Mar 31, 2022 at 05:09:09PM +0800, Chen Zhongjin wrote: > for (s = sechdrs; s < sechdrs_end; s++) { > const char *secname = secstrs + s->sh_name; > + const Elf_Shdr *txt_sec = find_mod_section(hdr, sechdrs, > + strcmp(".ARM.exidx", secname) ? > + secname + strlen(".ARM.exidx") : ".text"); In addition to my comments on the above... > > - if (!(s->sh_flags & SHF_ALLOC)) > + if (!(s->sh_flags & SHF_ALLOC) || > + s->sh_type != ELF_SECTION_UNWIND) Please align "s->sh_type" with the ! on the line above (don't use a tab for this!) > continue; > > - if (strcmp(".ARM.exidx.init.text", secname) == 0) > - maps[ARM_SEC_INIT].unw_sec = s; > - else if (strcmp(".ARM.exidx", secname) == 0) > - maps[ARM_SEC_CORE].unw_sec = s; > - else if (strcmp(".ARM.exidx.exit.text", secname) == 0) > - maps[ARM_SEC_EXIT].unw_sec = s; > - else if (strcmp(".ARM.exidx.text.unlikely", secname) == 0) > - maps[ARM_SEC_UNLIKELY].unw_sec = s; > - else if (strcmp(".ARM.exidx.text.hot", secname) == 0) > - maps[ARM_SEC_HOT].unw_sec = s; > - else if (strcmp(".init.text", secname) == 0) > - maps[ARM_SEC_INIT].txt_sec = s; > - else if (strcmp(".text", secname) == 0) > - maps[ARM_SEC_CORE].txt_sec = s; > - else if (strcmp(".exit.text", secname) == 0) > - maps[ARM_SEC_EXIT].txt_sec = s; > - else if (strcmp(".text.unlikely", secname) == 0) > - maps[ARM_SEC_UNLIKELY].txt_sec = s; > - else if (strcmp(".text.hot", secname) == 0) > - maps[ARM_SEC_HOT].txt_sec = s; > + if (txt_sec) { > + struct unwind_table *table = > + unwind_table_add(s->sh_addr, > + s->sh_size, > + txt_sec->sh_addr, > + txt_sec->sh_size); blank line here please. > + list_add(&table->mod_list, &unwind_list->mod_list); and here. Otherwise, looks good. Thanks. -- RMK's Patch system: https://www.armlinux.org.uk/developer/patches/ FTTP is here! 40Mbps down 10Mbps up. Decent connectivity at last! _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel