From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from loongson.cn (mail.loongson.cn [114.242.206.163]) by sourceware.org (Postfix) with ESMTP id 3DEAF3858D39 for ; Mon, 27 Mar 2023 09:39:04 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 3DEAF3858D39 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=loongson.cn Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=loongson.cn Received: from loongson.cn (unknown [113.200.148.30]) by gateway (Coremail) with SMTP id _____8Axu5c3ZCFk1VASAA--.27970S3; Mon, 27 Mar 2023 17:39:03 +0800 (CST) Received: from [10.130.0.191] (unknown [113.200.148.30]) by localhost.localdomain (Coremail) with SMTP id AQAAf8Cxeb03ZCFkRBkOAA--.7370S3; Mon, 27 Mar 2023 17:39:03 +0800 (CST) Subject: Re: [PATCH] gdb/elfread.c: Add plt symbol check for _PROCEDURE_LINKAGE_TABLE_ To: Tom Tromey Cc: gdb-patches@sourceware.org References: <20230323075908.23013-1-lihui@loongson.cn> <87pm8ydt03.fsf@tromey.com> From: Hui Li Message-ID: Date: Mon, 27 Mar 2023 17:39:03 +0800 User-Agent: Mozilla/5.0 (X11; Linux mips64; rv:68.0) Gecko/20100101 Thunderbird/68.7.0 MIME-Version: 1.0 In-Reply-To: <87pm8ydt03.fsf@tromey.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit X-CM-TRANSID:AQAAf8Cxeb03ZCFkRBkOAA--.7370S3 X-CM-SenderInfo: 5olk3xo6or00hjvr0hdfq/ X-Coremail-Antispam: 1Uk129KBjvdXoWrZw18Cr43uFW8Jw4fKF4Uurg_yoWDuFcEvF sxCasxW3yDWrn7KFZakr45ZanrCa1rAry8tr1kJr1Ivryavws8Wr4DWryxtr17Xa10y3s0 v3sxtay8u3sI9jkaLaAFLSUrUUUUUb8apTn2vfkv8UJUUUU8wcxFpf9Il3svdxBIdaVrn0 xqx4xG64xvF2IEw4CE5I8CrVC2j2Jv73VFW2AGmfu7bjvjm3AaLaJ3UjIYCTnIWjp_UUUY 47kC6x804xWl14x267AKxVWUJVW8JwAFc2x0x2IEx4CE42xK8VAvwI8IcIk0rVWrJVCq3w AFIxvE14AKwVWUJVWUGwA2ocxC64kIII0Yj41l84x0c7CEw4AK67xGY2AK021l84ACjcxK 6xIIjxv20xvE14v26r4j6ryUM28EF7xvwVC0I7IYx2IY6xkF7I0E14v26r4j6F4UM28EF7 xvwVC2z280aVAFwI0_Gr1j6F4UJwA2z4x0Y4vEx4A2jsIEc7CjxVAFwI0_Cr1j6rxdM2AI xVAIcxkEcVAq07x20xvEncxIr21l57IF6xkI12xvs2x26I8E6xACxx1l5I8CrVACY4xI64 kE6c02F40Ex7xfMcIj6xIIjxv20xvE14v26r106r15McIj6I8E87Iv67AKxVWUJVW8JwAm 72CE4IkC6x0Yz7v_Jr0_Gr1lF7xvr2IY64vIr41lc7I2V7IY0VAS07AlzVAYIcxG8wCF04 k20xvY0x0EwIxGrwCFx2IqxVCFs4IE7xkEbVWUJVW8JwC20s026c02F40E14v26r1j6r18 MI8I3I0E7480Y4vE14v26r106r1rMI8E67AF67kF1VAFwI0_Jrv_JF1lIxkGc2Ij64vIr4 1lIxAIcVC0I7IYx2IY67AKxVWUJVWUCwCI42IY6xIIjxv20xvEc7CjxVAFwI0_Jr0_Gr1l IxAIcVCF04k26cxKx2IYs7xG6r1j6r1xMIIF0xvEx4A2jsIE14v26r1j6r4UMIIF0xvEx4 A2jsIEc7CjxVAFwI0_Jr0_GrUvcSsGvfC2KfnxnUUI43ZEXa7IU1wL05UUUUU== X-Spam-Status: No, score=-4.9 required=5.0 tests=BAYES_00,KAM_DMARC_STATUS,NICE_REPLY_A,SPF_HELO_PASS,SPF_PASS,TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: On 2023/3/25 上午12:16, Tom Tromey wrote: >>>>>> Hui Li writes: > >> This is because some architectures such as LoongArch define the symbol >> _PROCEDURE_LINKAGE_TABLE_ at the start of the .plt section. Add plt >> symbol check for _PROCEDURE_LINKAGE_TABLE_ to improved the judgment of >> plt symbol and to get correct target function address of STT_GNU_IFUNC. > > It would be helpful to know how precisely things go wrong. > The patch itself seems reasonable enough -- hacky maybe but not out of > the ordinary way -- but I don't understand how it relates to the problem. > Like, why does ignoring this symbol here affect the results? > > Tom > Thanks for your review. This is a minor fix for one of the subfunction about ifunc. The principle of ifunc and its implementation in gdb are not explained in detail. So it's hard to understand how it relates to the problem. I change the commit message to explain this process in detail, and send V2. https://sourceware.org/pipermail/gdb-patches/2023-March/198303.html Thanks. Hui