https://sourceware.org/bugzilla/show_bug.cgi?id=33047

--- Comment #3 from Sourceware Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Nick Alcock <n...@sourceware.org>:

https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=002957be18e3b34e3e4863279335f58ae357cee5

commit 002957be18e3b34e3e4863279335f58ae357cee5
Author: Nick Alcock <nick.alc...@oracle.com>
Date:   Fri May 30 15:26:26 2025 +0100

    libctf: dedup: improve hiding of conflicting types in the same dict

    If types are conflicting, they are usually moved into separate child dicts
    -- but not always.  If they are added to the same dict by the cu-mapping
    mechanism (as used e.g. for multi-TU kernel modules), we can easily end
    up adding multiple conflicting types with the same name to the same dict.

    The mechanism used for turning on the non-root-visible flag in order to do
    this had a kludge attached which always hid types with the same name,
    whether or not they were conflicting.  This is unnecessary and can hide
    types that should not be hidden, as well as hiding bugs.  Remove it, and
    replace it with two different approaches:

     - for everything but cu-mapped links (the in-memory first phase of a link
       with ctf_link_add_cu_mapping in force), check for duplicate names if
       types are conflicting, and mark them as hidden if the names are found.
       This will never happen in normal links (in an upcoming commit we will
       suppress doing even this much in such cases).

     - for cu-mapped links, the only case that merges multiple distinct target
       dicts into one, we apply a big hammer and simply hide everything!  The
       non-root flag will be ignored in the next link phase anyway (which
dedups
       the cu-mapped pieces against each other), and this way we can be sure
       that merging multiple types cannot incur name clashes at this stage.

    The result seems to work: the only annoyance is that when enums with
    conflicting enumerators are found in a single cu-mapped child (so, really
    multiple merged children), you may end up with every instance of that enum
    being hidden for reasons of conflictingness.  I don't see a real way to
    avoid that.

    libctf/
            PR libctf/33047
            * ctf-dedup.c (ctf_dedup_emit_type): Only consider non
            conflicting types.  Improve type hiding in the presence of clashing
            enumerators.  Hide everything when doing a cu-mapped link: they
will
            be unhidden by the next link pass if nonconflicting.

-- 
You are receiving this mail because:
You are on the CC list for the bug.

Reply via email to