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

Alan Modra amodra@gmail.com
Thu Mar 18 09:21:45 GMT 2021


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.

-- 
Alan Modra
Australia Development Lab, IBM


More information about the Binutils mailing list