gcc/include
Joseph Myers c49d51fa81 Implement LDPT_REGISTER_CLAIM_FILE_HOOK_V2 linker plugin hook [PR109128]
This is one part of the fix for PR109128, along with a corresponding
binutils's linker change.  Without this patch, what happens in the
linker, when an unused object in a .a file has offload data, is that
elf_link_is_defined_archive_symbol calls bfd_link_plugin_object_p,
which ends up calling the plugin's claim_file_handler, which then
records the object as one with offload data. That is, the linker never
decides to use the object in the first place, but use of this _p
interface (called as part of trying to decide whether to use the
object) results in the plugin deciding to use its offload data (and a
consequent mismatch in the offload data present at runtime).

The new hook allows the 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 recording the object as one
with offload data.

	PR middle-end/109128

	include/
	* plugin-api.h (ld_plugin_claim_file_handler_v2)
	(ld_plugin_register_claim_file_v2)
	(LDPT_REGISTER_CLAIM_FILE_HOOK_V2): New.
	(struct ld_plugin_tv): Add tv_register_claim_file_v2.

	lto-plugin/
	* lto-plugin.c (register_claim_file_v2): New.
	(claim_file_handler_v2): New.
	(claim_file_handler): Wrap claim_file_handler_v2.
	(onload): Handle LDPT_REGISTER_CLAIM_FILE_HOOK_V2.
2023-05-11 10:08:50 +02:00
..
cuda Update copyright years. 2023-01-16 11:52:17 +01:00
gdb Update copyright years. 2023-01-16 11:52:17 +01:00
ansidecl.h Update copyright years. 2023-01-16 11:52:17 +01:00
btf.h Update copyright years. 2023-01-16 11:52:17 +01:00
ChangeLog Daily bump. 2023-04-29 00:16:48 +00:00
ChangeLog-9103
ChangeLog.jit
COPYING
COPYING3
ctf.h Synchronize include/ctf.h with upstream binutils/libctf. 2023-04-28 14:20:24 +01:00
demangle.h Update copyright years. 2023-01-16 11:52:17 +01:00
dwarf2.def Update copyright years. 2023-01-16 11:52:17 +01:00
dwarf2.h Update copyright years. 2023-01-16 11:52:17 +01:00
dyn-string.h Update copyright years. 2023-01-16 11:52:17 +01:00
environ.h Update copyright years. 2023-01-16 11:52:17 +01:00
fibheap.h Update copyright years. 2023-01-16 11:52:17 +01:00
filenames.h Update copyright years. 2023-01-16 11:52:17 +01:00
floatformat.h Update copyright years. 2023-01-16 11:52:17 +01:00
fnmatch.h Update copyright years. 2023-01-16 11:52:17 +01:00
gcc-c-fe.def Update copyright years. 2023-01-16 11:52:17 +01:00
gcc-c-interface.h Update copyright years. 2023-01-16 11:52:17 +01:00
gcc-cp-fe.def Update copyright years. 2023-01-16 11:52:17 +01:00
gcc-cp-interface.h Update copyright years. 2023-01-16 11:52:17 +01:00
gcc-interface.h Update copyright years. 2023-01-16 11:52:17 +01:00
getopt.h Update copyright years. 2023-01-16 11:52:17 +01:00
gomp-constants.h amdgcn, libgomp: Manually allocated stacks 2023-02-02 11:47:03 +00:00
hashtab.h Update copyright years. 2023-01-16 11:52:17 +01:00
hsa.h Import HSA header files from AMD 2020-12-09 11:10:40 +00:00
hsa_ext_amd.h Import HSA header files from AMD 2020-12-09 11:10:40 +00:00
hsa_ext_image.h Import HSA header files from AMD 2020-12-09 11:10:40 +00:00
leb128.h Update copyright years. 2023-01-16 11:52:17 +01:00
libiberty.h Update copyright years. 2023-01-16 11:52:17 +01:00
longlong.h Update copyright years. 2023-01-16 11:52:17 +01:00
lto-symtab.h Update copyright years. 2023-01-16 11:52:17 +01:00
md5.h Update copyright years. 2023-01-16 11:52:17 +01:00
objalloc.h Update copyright years. 2023-01-16 11:52:17 +01:00
obstack.h Update copyright years. 2023-01-16 11:52:17 +01:00
partition.h Update copyright years. 2023-01-16 11:52:17 +01:00
plugin-api.h Implement LDPT_REGISTER_CLAIM_FILE_HOOK_V2 linker plugin hook [PR109128] 2023-05-11 10:08:50 +02:00
safe-ctype.h Update copyright years. 2023-01-16 11:52:17 +01:00
sha1.h Update copyright years. 2023-01-16 11:52:17 +01:00
simple-object.h Update copyright years. 2023-01-16 11:52:17 +01:00
sort.h Update copyright years. 2023-01-16 11:52:17 +01:00
splay-tree.h Update copyright years. 2023-01-16 11:52:17 +01:00
symcat.h Update copyright years. 2023-01-16 11:52:17 +01:00
timeval-utils.h Update copyright years. 2023-01-16 11:52:17 +01:00
vtv-change-permission.h Update copyright years. 2023-01-16 11:52:17 +01:00
xregex.h
xregex2.h Update copyright years. 2023-01-16 11:52:17 +01:00
xtensa-config.h Update copyright years. 2023-01-16 11:52:17 +01:00
xtensa-dynconfig.h gcc: xtensa: add data alignment properties to dynconfig 2023-04-19 12:39:10 -07:00