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

--- Comment #6 from Sourceware Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Alan Modra <amo...@sourceware.org>:

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

commit b64e0a281623be62ffb610bb3c401317a1154524
Author: Alan Modra <amo...@gmail.com>
Date:   Tue Aug 5 21:18:44 2025 +0930

    Remove bfd_check_format_lto

    Tidy changes to bfd_check_format_matches made by commit 9b854f169df9
    which added a bfd_plugin_specified_p test and commit f752be8f916e
    which added an lto_sections_removed arg.  Both of these changes are
    unnecessary if plugin_format is set to bfd_plugin_no before calling
    bfd_check_format.  bfd_plugin_no will prevent the plugin object_p
    function from returning a match (and in the first case from a segfault
    when loading plugins while a plugin is running).  The plugin object_p
    function already protected itself from recursive calls by setting
    bfd_plugin_no before loading a plugin, but commit 9b854f169df9 opened
    new bfds so they were unprotected.

    It isn't strictly necessary to test for bfd_plugin_no in
    bfd_check_format_matches but I kept the check to minimise functional
    changes.  Close inspection of the patch will notice I've added an
    is_linker_input test too.  That also isn't strictly necessary, I
    think, but the match_count test was for the linker.  See commit
    999d6dff80fa.

            PR 12291
            PR 12430
            PR 13298
            PR 33198
    bfd/
            * format.c (bfd_check_format_lto): Revert to bfd_check_format.
            (bfd_check_format_matches_lto): Revert to bfd_check_format_matches.
            Correct comments.  Manage both the lto_sections_removed and
            bfd_plugin_specified_p cases by testing for bfd_plugin_no.
            * plugin.c (bfd_plugin_get_symbols_in_object_only): Set
            plugin_format to bfd_plugin_no before checking new bfds.
            (try_load_plugin): Comment setting bfd_plugin_no.
            (bfd_plugin_specified_p): Delete.
            * plugin.h (bfd_plugin_specified_p): Delete.
            * bfd-in2.h: Regenerate.
    binutils/
            * objcopy.c (copy_archive): Replace bfd_check_format_lto calls
            with bfd_check_format using plugin_format set to bfd_plugin_no.
            (check_format_object): New function.
            (copy_file): Use it.

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

Reply via email to