From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp.polymtl.ca (smtp.polymtl.ca [132.207.4.11]) by sourceware.org (Postfix) with ESMTPS id 5C89E3858D33; Sat, 1 Jul 2023 02:12:40 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 5C89E3858D33 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=polymtl.ca Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=polymtl.ca Received: from simark.ca (simark.ca [158.69.221.121]) (authenticated bits=0) by smtp.polymtl.ca (8.14.7/8.14.7) with ESMTP id 3612CWNB007776 (version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 30 Jun 2023 22:12:36 -0400 DKIM-Filter: OpenDKIM Filter v2.11.0 smtp.polymtl.ca 3612CWNB007776 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=polymtl.ca; s=default; t=1688177557; bh=+ZgCl4yKdE7FtEac0LdUgqDLw4KcR4q9sr48f3wNuEU=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=BkgnYul+2uXPpoUaLK3YojB6oMmUgOkRtoiqrcDT54SMyH16wUvoOCOPNHpZjWaSU hA1K2GRt/MYfYpxVvITlIFOLbN/h8CWaJOb4uw4z3shlCeefx+naMCmipkDfARjVXe 2tmXK6yjULI+3BGiKf9MOHgnEF4yGpe/uCBiYZuc= Received: from [10.0.0.170] (modemcable238.237-201-24.mc.videotron.ca [24.201.237.238]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPSA id C38111E0AC; Fri, 30 Jun 2023 22:12:31 -0400 (EDT) Message-ID: Date: Fri, 30 Jun 2023 22:12:31 -0400 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.12.0 Subject: Re: [PATCH v4 3/7] bfd: Improve nm and objdump without section header To: "H.J. Lu" , binutils@sourceware.org Cc: Alan Modra , Florian Weimer , Kaylee Blake , "gdb-patches@sourceware.org" References: <20230606175846.399377-1-hjl.tools@gmail.com> <20230606175846.399377-4-hjl.tools@gmail.com> Content-Language: fr From: Simon Marchi In-Reply-To: <20230606175846.399377-4-hjl.tools@gmail.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Poly-FromMTA: (simark.ca [158.69.221.121]) at Sat, 1 Jul 2023 02:12:32 +0000 X-Spam-Status: No, score=-3031.3 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,RCVD_IN_DNSWL_LOW,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_PASS,SPF_PASS,TXREP,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 server2.sourceware.org List-Id: On 6/6/23 13:58, H.J. Lu wrote: > When there is no section header in an executable or shared library, we > reconstruct dynamic symbol table from the PT_DYNAMIC segment, which > contains DT_HASH/DT_GNU_HASH/DT_MIPS_XHASH, DT_STRTAB, DT_SYMTAB, > DT_STRSZ, and DT_SYMENT entries, to improve nm and objdump. For DT_HASH, > the number of dynamic symbol table entries equals the number of chains. > For DT_GNU_HASH/DT_MIPS_XHASH, only defined symbols with non-STB_LOCAL > indings are in hash table. Since DT_GNU_HASH/DT_MIPS_XHASH place all > symbols with STB_LOCAL binding before symbols with other bindings and > all undefined symbols defined ones in dynamic symbol table, the highest > symbol index in DT_GNU_HASH/DT_MIPS_XHASH is the highest dynamic symbol > table index. We can also get symbol version from DT_VERSYM, DT_VERDEF > and DT_VERNEED entries. > > dt_symtab, dt_versym, dt_verdef, dt_verneed, dt_symtab_count, > dt_verdef_count, dt_verneed_count and dt_strtab are added to > elf_obj_tdata to store dynamic symbol table information. Hi, This broke a GDB test: gdb/ $ make check TESTS="gdb.base/eu-strip-infcall.exp" FAIL: gdb.base/eu-strip-infcall.exp: gdb_breakpoint: set breakpoint at main Looking at gdb/testsuite/gdb.log, before: (gdb) file /home/smarchi/build/binutils-gdb/gdb/testsuite/outputs/gdb.base/eu-strip-infcall/eu-strip-infcall Reading symbols from /home/smarchi/build/binutils-gdb/gdb/testsuite/outputs/gdb.base/eu-strip-infcall/eu-strip-infcall... Reading symbols from /home/smarchi/build/binutils-gdb/gdb/testsuite/outputs/gdb.base/eu-strip-infcall/eu-strip-infcall.debug... and after: (gdb) file /home/smarchi/build/binutils-gdb/gdb/testsuite/outputs/gdb.base/eu-strip-infcall/eu-strip-infcall Reading symbols from /home/smarchi/build/binutils-gdb/gdb/testsuite/outputs/gdb.base/eu-strip-infcall/eu-strip-infcall... warning: `/home/smarchi/build/binutils-gdb/gdb/testsuite/outputs/gdb.base/eu-strip-infcall/eu-strip-infcall.debug': can't read symbols: file format not recognized. (No debugging symbols found in /home/smarchi/build/binutils-gdb/gdb/testsuite/outputs/gdb.base/eu-strip-infcall/eu-strip-infcall) Can you please check if it's a problem with your patch, or if it's really a malformed file? Thanks, Simon