Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp1157498pxb; Fri, 1 Apr 2022 06:13:36 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyyX4RI1ykwjJwoe37lcEJZJFYTtp4LFCfePUk6ZrsNt6pk0NlO4/7CYUNZnwO6aepcjz0r X-Received: by 2002:a17:906:4408:b0:6da:bec1:2808 with SMTP id x8-20020a170906440800b006dabec12808mr9265678ejo.543.1648818815650; Fri, 01 Apr 2022 06:13:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1648818815; cv=none; d=google.com; s=arc-20160816; b=eGukVOBmgpLZeIrm8m9azDRYdcqyCnAVYnHGjFvo/8XzmDlmLbvorOESXlpXmEg7jJ 4AvfeGNOZSU8cxP+Go0Zk8xjsKwFowDg1C7PYOUB8/Rp471TIu3br1u0UIHd4LBV+DqN A6kU5gMXMsbCBge81Ae9Za6kVeVaScqHSA7imfJXi63pmqGA4chML4d1yqH9Ui/4Y0W2 WE4FGEyy1dle+gtBO5PDd3Nvw21TULOqiyI1gQ97ZU+mqyEifnjKS5UKQVxN8jchlfD/ BQdlPueFxtSSmXJg8X32PmQnBet1NMa9OJgs5jjruiLC+l5SymC5c6km3Hj6SPApe4nE sUOQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id; bh=uEOaxwh8urYTCaE8kXuik45LstMEK7hLn/psaAkDgS4=; b=SuJI8wK1egTy9Iv/aoQi5mnU8mbcWi5phtSMn7La+fEOtLtLga5b6LEP6ip3Gu01ug 0HlxQnMFq8PabX1LthtlXR5yEJVjqmwRCNFiRWA610+a10wR2hysyo0xRGnuNAn79kAW h38N7jjUC7Ke/LsODD9HDZ6hthlLfEac/7/TgHPjt6ikJ+OqjkJq37uLs0+xFSwjY08c i2ZEq3nCF9MbXb6gR8KGDfzglU2PePh9SxbQWhIsAMoQYzZku+Qs/31TpxpmIjZ44U5q I7u8LOgGQ+DbAg76198bXPSu+5uXmbPEjv1undLpPWjFn0TkImnv44Ym1oOYerwRfkU6 603Q== 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; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id kf6-20020a17090776c600b006df76385d59si1518717ejc.505.2022.04.01.06.13.08; Fri, 01 Apr 2022 06:13:35 -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; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234558AbiCaKRF (ORCPT + 99 others); Thu, 31 Mar 2022 06:17:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49724 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232350AbiCaKRD (ORCPT ); Thu, 31 Mar 2022 06:17:03 -0400 Received: from szxga08-in.huawei.com (szxga08-in.huawei.com [45.249.212.255]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8BFDAD92 for ; Thu, 31 Mar 2022 03:15:16 -0700 (PDT) Received: from dggpemm500021.china.huawei.com (unknown [172.30.72.55]) by szxga08-in.huawei.com (SkyGuard) with ESMTP id 4KTfLR6pDZz1GDHw; Thu, 31 Mar 2022 18:14:55 +0800 (CST) Received: from dggpemm500013.china.huawei.com (7.185.36.172) by dggpemm500021.china.huawei.com (7.185.36.109) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.21; Thu, 31 Mar 2022 18:15:09 +0800 Received: from [127.0.0.1] (10.67.108.67) by dggpemm500013.china.huawei.com (7.185.36.172) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.21; Thu, 31 Mar 2022 18:15:09 +0800 Message-ID: Date: Thu, 31 Mar 2022 18:15:09 +0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.7.0 Subject: Re: [PATCH] ARM: module: Add all unwind tables when load module Content-Language: en-US To: "Russell King (Oracle)" CC: , , , , , References: <20220325011252.55844-1-chenzhongjin@huawei.com> From: Chen Zhongjin In-Reply-To: Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 7bit X-Originating-IP: [10.67.108.67] X-ClientProxiedBy: dggems704-chm.china.huawei.com (10.3.19.181) To dggpemm500013.china.huawei.com (7.185.36.172) X-CFilter-Loop: Reflected X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,NICE_REPLY_A, RCVD_IN_DNSWL_MED,RCVD_IN_MSPIKE_H5,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham 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 Hi Russell, Thanks for comment! I've pushed v2 patch with your advises. >> >> - memset(maps, 0, sizeof(maps)); >> + INIT_LIST_HEAD(&table_list->mod_list); >> + mod->arch.init_table = NULL; >> >> for (s = sechdrs; s < sechdrs_end; s++) { >> - const char *secname = secstrs + s->sh_name; >> + const unsigned int sectype = s->sh_type; > Please loose this local variable. Also I moved "txtname" inside func params. + const char *txtname = strcmp(".ARM.exidx", secname) == 0 ? + ".text" : secname + strlen(".ARM.exidx"); + const Elf_Shdr *txt_sec = find_mod_section(hdr, sechdrs, txtname); >>> + const Elf_Shdr *txt_sec = find_mod_section(hdr, sechdrs, + strcmp(".ARM.exidx", secname) ? + secname + strlen(".ARM.exidx") : ".text");