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

--- Comment #16 from Sourceware Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by H.J. Lu <h...@sourceware.org>:

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

commit 717a38e9a02109fcbcb18bb2ec3aa251e2ad0a0d
Author: H.J. Lu <hjl.to...@gmail.com>
Date:   Sun May 4 05:12:46 2025 +0800

    strip: Add GCC LTO IR support

    Add GCC LTO IR support to strip by copying GCC LTO IR input as unknown
    object file.  Don't enable LTO plugin in strip unless all LTO sections
    should be removed, assuming all LTO sections will be removed with
    -R .gnu.lto_.*.  Add linker LTO tests for strip with --strip-unneeded
    and GCC LTO IR inputs.

    binutils/

            PR binutils/21479
            * objcopy.c: Include "plugin-api.h" and "plugin.h".
            (lto_sections_removed): New.
            (command_line_switch): Add OPTION_PLUGIN.
            (strip_options): Likewise.
            (strip_usage): Display "--plugin NAME".
            (copy_unknown_file): New function.
            (copy_unknown_object): Call copy_unknown_file.
            (copy_archive): Copy input LTO IR member as unknown object.
            (copy_file): Set input target to "plugin" for strip if it is
            unset unless all LTO sections should be removed.  Copy input
            LTO IR file as unknown file.
            (strip_main): Call bfd_plugin_set_program_name. Handle
            OPTION_PLUGIN.  Set lto_sections_removed to true if all GCC
            LTO sections should be removed.
            * doc/binutils.texi: Document --plugin for strip.

    ld/

            PR binutils/21479
            * testsuite/ld-plugin/lto-binutils.exp: New file.
            * testsuite/ld-plugin/strip-1a-fat.c: Likewise.
            * testsuite/ld-plugin/strip-1a-fat.rd: Likewise.
            * testsuite/ld-plugin/strip-1b-fat.c: Likewise.
            * testsuite/ld-plugin/strip-1b-fat.rd: Likewise.
            * testsuite/ld-plugin/strip-1a.c: Likewise.
            * testsuite/ld-plugin/strip-1b.c: Likewise.
            * testsuite/lib/ld-lib.exp (run_cc_link_tests): Add optional
            trailing ld options.

    Signed-off-by: H.J. Lu <hjl.to...@gmail.com>

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

Reply via email to