[PATCH v2] elf: Handle .gnu.debuglto_.debug_* sections

H.J. Lu hjl.tools@gmail.com
Thu Mar 18 14:08:19 GMT 2021


On Thu, Mar 18, 2021 at 2:21 AM Alan Modra <amodra@gmail.com> wrote:
>
> On Wed, Mar 17, 2021 at 03:43:57PM -0700, H.J. Lu via Binutils wrote:
> > commit 994b25132814f4c2be93ce53a616a74139c4cf3c
> > Author: H.J. Lu <hjl.tools@gmail.com>
> > Date:   Sun Jan 17 20:01:16 2021 -0800
> >
> >     ld/elf: Ignore section symbols when matching linkonce with comdat
> >
> > ignored section symbols when comparing symbols in 2 sections.  Since all
> > references to debugging sections are done with section symbols, symbols
> > in debugging sections are ignored and we fail to match symbols in comdat
> > debugging sections.  Also .gnu.debuglto_.debug_* sections aren't treated
> > as debugging sections.
> >
> > 1. Treate .gnu.debuglto_.debug_ section as debugging section unless it
> > is marked with SHF_EXCLUDE.
>
> This part is OK.
>
> > 2. Ignore section symbols only when matching non-debugging sections or
> > linkonce section with comdat section.
>
> This part has a problem.  elf_create_symbuf stashes away symbols of
> interest for an object file, and that set of symbols might be used for
> multiple invocations of bfd_elf_match_symbols_in_sections.  You can't
> vary the set of symbols stashed based on section, since that would
> give the right answer for the first section but possibly wrong answers
> for subsequent sections.  Any per-section logic must go in
> bfd_elf_match_symbols_in_sections.

Here is the v2 patch to revert commit 994b2513281 in elf_create_symbuf
and put per-section logic in bfd_elf_match_symbols_in_sections.

OK for master?

Thanks.

-- 
H.J.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: v2-0001-elf-Handle-.gnu.debuglto_.debug_-sections.patch
Type: text/x-patch
Size: 7605 bytes
Desc: not available
URL: <https://sourceware.org/pipermail/binutils/attachments/20210318/e39b50e8/attachment-0001.bin>


More information about the Binutils mailing list