From: Simon Marchi via Gdb-patches <gdb-patches@sourceware.org>
To: "H.J. Lu" <hjl.tools@gmail.com>, binutils@sourceware.org
Cc: Alan Modra <amodra@gmail.com>,
Florian Weimer <fweimer@redhat.com>,
Kaylee Blake <klkblake@gmail.com>,
"gdb-patches@sourceware.org" <gdb-patches@sourceware.org>
Subject: Re: [PATCH v4 3/7] bfd: Improve nm and objdump without section header
Date: Fri, 30 Jun 2023 22:12:31 -0400 [thread overview]
Message-ID: <e7e469d3-d7a3-4076-0998-7341f4c55728@polymtl.ca> (raw)
In-Reply-To: <20230606175846.399377-4-hjl.tools@gmail.com>
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
next parent reply other threads:[~2023-07-01 2:13 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20230606175846.399377-1-hjl.tools@gmail.com>
[not found] ` <20230606175846.399377-4-hjl.tools@gmail.com>
2023-07-01 2:12 ` Simon Marchi via Gdb-patches [this message]
2023-07-07 15:26 ` H.J. Lu via Gdb-patches
2023-07-10 3:30 ` Simon Marchi via Gdb-patches
2023-07-13 5:02 ` Alan Modra via Gdb-patches
2023-07-13 5:34 ` Fangrui Song
2023-07-13 21:58 ` Mark Wielaard
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=e7e469d3-d7a3-4076-0998-7341f4c55728@polymtl.ca \
--to=gdb-patches@sourceware.org \
--cc=amodra@gmail.com \
--cc=binutils@sourceware.org \
--cc=fweimer@redhat.com \
--cc=hjl.tools@gmail.com \
--cc=klkblake@gmail.com \
--cc=simon.marchi@polymtl.ca \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox