aboutsummaryrefslogtreecommitdiff
path: root/gdb/python
diff options
context:
space:
mode:
authorH.J. Lu <hjl.tools@gmail.com>2025-05-04 05:12:46 +0800
committerH.J. Lu <hjl.tools@gmail.com>2025-05-14 15:09:40 +0800
commit717a38e9a02109fcbcb18bb2ec3aa251e2ad0a0d (patch)
tree8acd270b7aa29a4f2e400d2659ff2192bad44d90 /gdb/python
parent6ebd38072de4a77a2d28f04a79b64ab570532e98 (diff)
downloadbinutils-717a38e9a02109fcbcb18bb2ec3aa251e2ad0a0d.zip
binutils-717a38e9a02109fcbcb18bb2ec3aa251e2ad0a0d.tar.gz
binutils-717a38e9a02109fcbcb18bb2ec3aa251e2ad0a0d.tar.bz2
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.tools@gmail.com>
Diffstat (limited to 'gdb/python')
0 files changed, 0 insertions, 0 deletions