From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id 5UOkKbOLn2SihRIAWB0awg (envelope-from ) for ; Fri, 30 Jun 2023 22:13:07 -0400 Authentication-Results: simark.ca; dkim=pass (1024-bit key; secure) header.d=sourceware.org header.i=@sourceware.org header.a=rsa-sha256 header.s=default header.b=RB+iZNF8; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id 9B3E81E0BB; Fri, 30 Jun 2023 22:13:07 -0400 (EDT) Received: from sourceware.org (server2.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id 823661E0AC for ; Fri, 30 Jun 2023 22:13:05 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id A66443858C74 for ; Sat, 1 Jul 2023 02:13:04 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org A66443858C74 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1688177584; bh=+ZgCl4yKdE7FtEac0LdUgqDLw4KcR4q9sr48f3wNuEU=; h=Date:Subject:To:Cc:References:In-Reply-To:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From:Reply-To:From; b=RB+iZNF8hrSqnHfeexFjM3onSDkLRL6DPW1To4ApMRahzCcspcR96h/rWspiBxkp3 rT9noe18G6gvuUhBU6B/HL4YJswBnuohIP8b/yFXgvjw294Ny/Iq6ire0NEHJ7rW38 hzuLzCRA1ZnFDqI0j+e8RFc8Lj5P7T23BmtqWvmo= 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 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 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 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 X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: Simon Marchi via Gdb-patches Reply-To: Simon Marchi Errors-To: gdb-patches-bounces+public-inbox=simark.ca@sourceware.org Sender: "Gdb-patches" 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