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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 51CBBC636D6 for ; Thu, 23 Feb 2023 15:07:21 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234951AbjBWPHT (ORCPT ); Thu, 23 Feb 2023 10:07:19 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47736 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234920AbjBWPHQ (ORCPT ); Thu, 23 Feb 2023 10:07:16 -0500 Received: from mx0a-0031df01.pphosted.com (mx0a-0031df01.pphosted.com [205.220.168.131]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8C07F521F2; Thu, 23 Feb 2023 07:07:15 -0800 (PST) Received: from pps.filterd (m0279864.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 31NB47gA007103; Thu, 23 Feb 2023 15:07:01 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-type : content-transfer-encoding; s=qcppdkim1; bh=GDNka6M/kPLwaWkxju0tDmKqAgBvnoKPJ+TjKT+Ve4I=; b=fFAfr7fcPkBXkJn/aJw77kXO1gkAWhfZgTrox0NWcKdVnuJ+fE7Ywa6r/6Dma6Tx60jX Qsre3hae01DseHBYyr3GgdTPHwc9JIj6rawygFEgWBCAi+WpQzopphwbyCTRG5y89RWi HtmZd34F2I/2HAgqp0IWogI7+9xCCYCKzeq3Z1PZrdxjlkcpGCVFfssa3UcnOOeRDs6l L9xmBMhlvLhJVljNLMvTF0lVuqvlWGHKcTG7vVbjUCo5XAr/XkrF+XVYDpteeFDKIPL7 OYXPwHXok7hCQSVux+ze5P2uow4/CXF6cRe1g4n/GbOHJpgbMguZ/IzEjB1DnpbzqxZW aw== Received: from nalasppmta05.qualcomm.com (Global_NAT1.qualcomm.com [129.46.96.20]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3nwy9a1pj7-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 23 Feb 2023 15:07:01 +0000 Received: from nalasex01b.na.qualcomm.com (nalasex01b.na.qualcomm.com [10.47.209.197]) by NALASPPMTA05.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTPS id 31NF70Ik000655 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 23 Feb 2023 15:07:00 GMT Received: from hu-mohs-hyd.qualcomm.com (10.80.80.8) by nalasex01b.na.qualcomm.com (10.47.209.197) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.41; Thu, 23 Feb 2023 07:06:53 -0800 From: Mohammad Rafi Shaik To: , , , , , , , , , , , , , , , , , , , , CC: Srinivasa Rao Mandadapu , Mohammad Rafi Shaik , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Mukesh Ojha Subject: [PATCH v5 1/2] remoteproc: elf_loader: Update resource table name check Date: Thu, 23 Feb 2023 20:35:58 +0530 Message-ID: <20230223150559.2429562-2-quic_mohs@quicinc.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230223150559.2429562-1-quic_mohs@quicinc.com> References: <20230223150559.2429562-1-quic_mohs@quicinc.com> MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8bit X-Originating-IP: [10.80.80.8] X-ClientProxiedBy: nasanex01b.na.qualcomm.com (10.46.141.250) To nalasex01b.na.qualcomm.com (10.47.209.197) X-QCInternal: smtphost X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 X-Proofpoint-GUID: 1bhT_twODnB9QPh_CSQKbMC1Qn44TuN7 X-Proofpoint-ORIG-GUID: 1bhT_twODnB9QPh_CSQKbMC1Qn44TuN7 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.219,Aquarius:18.0.930,Hydra:6.0.562,FMLib:17.11.170.22 definitions=2023-02-23_09,2023-02-23_01,2023-02-09_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 bulkscore=0 clxscore=1011 malwarescore=0 spamscore=0 priorityscore=1501 impostorscore=0 lowpriorityscore=0 adultscore=0 phishscore=0 mlxscore=0 mlxlogscore=999 suspectscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2212070000 definitions=main-2302230123 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Srinivasa Rao Mandadapu Qualcomm DSP binary is prepared by combining different ELFs'. This patch differentiates the section header name of ELF within the same existing section headers of the same ELF. Example readelf output of DSP binary: [60] .start.ac_bin_process PROGBITS [61] .resource_table.ac_bin_process PROGBITS [62] .comment.ac_bin_process PROGBITS Signed-off-by: Srinivasa Rao Mandadapu Signed-off-by: Mohammad Rafi Shaik Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Mukesh Ojha --- drivers/remoteproc/remoteproc_elf_loader.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/remoteproc/remoteproc_elf_loader.c b/drivers/remoteproc/remoteproc_elf_loader.c index 5a412d7b6e0b..77330d6f43d0 100644 --- a/drivers/remoteproc/remoteproc_elf_loader.c +++ b/drivers/remoteproc/remoteproc_elf_loader.c @@ -272,7 +272,7 @@ find_table(struct device *dev, const struct firmware *fw) u64 offset = elf_shdr_get_sh_offset(class, shdr); u32 name = elf_shdr_get_sh_name(class, shdr); - if (strcmp(name_table + name, ".resource_table")) + if (!strstarts(name_table + name, ".resource_table")) continue; table = (struct resource_table *)(elf_data + offset); -- 2.25.1