]> git.ipfire.org Git - thirdparty/gcc.git/commit
Update LDPT_REGISTER_CLAIM_FILE_HOOK_V2 linker plugin hook
authorH.J. Lu <hjl.tools@gmail.com>
Wed, 21 Aug 2024 14:25:25 +0000 (07:25 -0700)
committerH.J. Lu <hjl.tools@gmail.com>
Thu, 22 Aug 2024 12:22:09 +0000 (05:22 -0700)
commita98dd536b1017c2b814a3465206c6c01b2890998
tree19b8de2322de48a824017c7521b382ca81d149eb
parentb07f8a301158e53717b8688cc8ea430b6f02574c
Update LDPT_REGISTER_CLAIM_FILE_HOOK_V2 linker plugin hook

This hook allows the BFD linker plugin to distinguish calls to
claim_file_handler that know the object is being used by the linker
(from ldmain.c:add_archive_element), from calls that don't know it's
being used by the linker (from elf_link_is_defined_archive_symbol); in
the latter case, the plugin should avoid including the unused LTO archive
members in link output.  To get the proper support for archives with LTO
common symbols, the linker fix

commit a6f8fe0a9e9cbe871652e46ba7c22d5e9fb86208
Author: H.J. Lu <hjl.tools@gmail.com>
Date:   Wed Aug 14 20:50:02 2024 -0700

    lto: Don't include unused LTO archive members in output

is required.

PR lto/116361
* lto-plugin.c (claim_file_handler_v2): Rename claimed to
can_be_claimed.  Include the LTO object only if it is known to
be included in link output.

Signed-off-by: H.J. Lu <hjl.tools@gmail.com>
lto-plugin/lto-plugin.c