binutils-gdb/ld/testsuite
H.J. Lu bb9a951fab Don't claim a fat IR object if no IR object should be claimed
When the linker sees an input object containing nothing but IR during
rescan, it should ignore it (LTO phase is over).  But if the input object
is a fat IR object, which has non-IR code as well, it should be used to
resolve references as if it did not contain any IR at all.  This patch
adds lto_type to bfd and linker avoids claiming a fat IR object if no IR
object should be claimed.

bfd/

	PR ld/23935
	* archive.c (_bfd_compute_and_write_armap): Check bfd_get_lto_type
	instead of lto_slim_object.
	* elflink.c (elf_link_add_object_symbols): Likewise.
	* bfd.c (bfd_lto_object_type): New.
	(bfd): Remove lto_slim_object and add lto_type.
	(bfd_get_lto_type): New function.
	* elf.c (lto_section): Removed.
	(_bfd_elf_make_section_from_shdr): Don't set lto_slim_object.
	* format.c: (lto_section): New.
	(bfd_set_lto_type): New function.
	(bfd_check_format_matches): Call bfd_set_lto_type.
	* bfd-in2.h: Regenerated.

binutils/

	PR ld/23935
	* nm.c (display_rel_file): Check bfd_get_lto_type instead of
	lto_slim_object.

ld/

	PR ld/23935
	* ldmain.c (add_archive_element): Don't claim a fat IR object if
	no IR object should be claimed.
	* testsuite/ld-plugin/lto.exp (pr20103): Adjust fat IR test.
	Add PR ld/23935 test.
	* testsuite/ld-plugin/pr23935a.c: New file.
	* testsuite/ld-plugin/pr23935b.c: Likewise.
2024-03-26 07:17:17 -07:00
..
config ld: Support LD_UNDER_TEST environment variable 2024-03-19 07:07:54 -07:00
ld-aarch64 Update year range in copyright notice of binutils files 2024-01-04 22:58:12 +10:30
ld-alpha Update year range in copyright notice of binutils files 2024-01-04 22:58:12 +10:30
ld-arc Update year range in copyright notice of binutils files 2024-01-04 22:58:12 +10:30
ld-arm Re: elf_backend_finish_dynamic_symbol returning false 2024-02-15 21:28:07 +10:30
ld-auto-import Update year range in copyright notice of binutils files 2024-01-04 22:58:12 +10:30
ld-avr Update year range in copyright notice of binutils files 2024-01-04 22:58:12 +10:30
ld-bootstrap Update year range in copyright notice of binutils files 2024-01-04 22:58:12 +10:30
ld-bpf Update year range in copyright notice of binutils files 2024-01-04 22:58:12 +10:30
ld-cdtest Update year range in copyright notice of binutils files 2024-01-04 22:58:12 +10:30
ld-checks Update year range in copyright notice of binutils files 2024-01-04 22:58:12 +10:30
ld-cris Update year range in copyright notice of binutils files 2024-01-04 22:58:12 +10:30
ld-crx Update year range in copyright notice of binutils files 2024-01-04 22:58:12 +10:30
ld-csky
ld-ctf Update year range in copyright notice of binutils files 2024-01-04 22:58:12 +10:30
ld-cygwin Update year range in copyright notice of binutils files 2024-01-04 22:58:12 +10:30
ld-d10v Update year range in copyright notice of binutils files 2024-01-04 22:58:12 +10:30
ld-discard Update year range in copyright notice of binutils files 2024-01-04 22:58:12 +10:30
ld-dynamic Update year range in copyright notice of binutils files 2024-01-04 22:58:12 +10:30
ld-elf elf: Rename is_standard_elf to uses_elf_em 2024-01-26 07:32:03 -08:00
ld-elfcomm Update year range in copyright notice of binutils files 2024-01-04 22:58:12 +10:30
ld-elfvers Update year range in copyright notice of binutils files 2024-01-04 22:58:12 +10:30
ld-elfweak Update year range in copyright notice of binutils files 2024-01-04 22:58:12 +10:30
ld-fastcall Update year range in copyright notice of binutils files 2024-01-04 22:58:12 +10:30
ld-frv Update year range in copyright notice of binutils files 2024-01-04 22:58:12 +10:30
ld-gc Update year range in copyright notice of binutils files 2024-01-04 22:58:12 +10:30
ld-h8300 Update year range in copyright notice of binutils files 2024-01-04 22:58:12 +10:30
ld-i386 x86: Don't check R_386_NONE nor R_X86_64_NONE 2024-01-09 06:39:42 -08:00
ld-ia64 Update year range in copyright notice of binutils files 2024-01-04 22:58:12 +10:30
ld-ifunc ld: Adjust x86 and x86-64 tests for -z mark-plt 2024-01-06 07:10:15 -08:00
ld-kvx Update year range in copyright notice of binutils files 2024-01-04 22:58:12 +10:30
ld-libs Update year range in copyright notice of binutils files 2024-01-04 22:58:12 +10:30
ld-linkonce Update year range in copyright notice of binutils files 2024-01-04 22:58:12 +10:30
ld-loongarch-elf LoongArch: Add relaxation for R_LARCH_CALL36 2024-03-19 14:14:47 +08:00
ld-m68hc11 Update year range in copyright notice of binutils files 2024-01-04 22:58:12 +10:30
ld-m68k Update year range in copyright notice of binutils files 2024-01-04 22:58:12 +10:30
ld-mep Update year range in copyright notice of binutils files 2024-01-04 22:58:12 +10:30
ld-metag Update year range in copyright notice of binutils files 2024-01-04 22:58:12 +10:30
ld-mips-elf Re: elf_backend_finish_dynamic_symbol returning false 2024-02-15 21:28:07 +10:30
ld-misc Update year range in copyright notice of binutils files 2024-01-04 22:58:12 +10:30
ld-mmix Update year range in copyright notice of binutils files 2024-01-04 22:58:12 +10:30
ld-mn10300 Update year range in copyright notice of binutils files 2024-01-04 22:58:12 +10:30
ld-msp430-elf Update year range in copyright notice of binutils files 2024-01-04 22:58:12 +10:30
ld-nds32 Update year range in copyright notice of binutils files 2024-01-04 22:58:12 +10:30
ld-nios2
ld-or1k Update year range in copyright notice of binutils files 2024-01-04 22:58:12 +10:30
ld-pdp11 Update year range in copyright notice of binutils files 2024-01-04 22:58:12 +10:30
ld-pe Update year range in copyright notice of binutils files 2024-01-04 22:58:12 +10:30
ld-pie Update year range in copyright notice of binutils files 2024-01-04 22:58:12 +10:30
ld-plugin Don't claim a fat IR object if no IR object should be claimed 2024-03-26 07:17:17 -07:00
ld-powerpc Update year range in copyright notice of binutils files 2024-01-04 22:58:12 +10:30
ld-pru
ld-riscv-elf RISC-V: Initial ld.bfd support for TLSDESC. 2024-02-29 15:02:55 +08:00
ld-s12z Update year range in copyright notice of binutils files 2024-01-04 22:58:12 +10:30
ld-s390 s390: Avoid reloc overflows on undefined weak symbols 2024-02-27 14:07:17 +01:00
ld-scripts Fix implementation of SUBALIGN. 2024-02-28 16:36:37 +00:00
ld-selective Update year range in copyright notice of binutils files 2024-01-04 22:58:12 +10:30
ld-sframe Update year range in copyright notice of binutils files 2024-01-04 22:58:12 +10:30
ld-sh Update year range in copyright notice of binutils files 2024-01-04 22:58:12 +10:30
ld-shared Update year range in copyright notice of binutils files 2024-01-04 22:58:12 +10:30
ld-size Update year range in copyright notice of binutils files 2024-01-04 22:58:12 +10:30
ld-sparc Update year range in copyright notice of binutils files 2024-01-04 22:58:12 +10:30
ld-spu Update year range in copyright notice of binutils files 2024-01-04 22:58:12 +10:30
ld-srec Update year range in copyright notice of binutils files 2024-01-04 22:58:12 +10:30
ld-tic6x Make is_relocatable_executable only affect dynamic section syms 2024-02-24 11:53:03 +10:30
ld-tilegx Update year range in copyright notice of binutils files 2024-01-04 22:58:12 +10:30
ld-tilepro Update year range in copyright notice of binutils files 2024-01-04 22:58:12 +10:30
ld-undefined Update year range in copyright notice of binutils files 2024-01-04 22:58:12 +10:30
ld-unique Update year range in copyright notice of binutils files 2024-01-04 22:58:12 +10:30
ld-v850 Update year range in copyright notice of binutils files 2024-01-04 22:58:12 +10:30
ld-vax-elf Update year range in copyright notice of binutils files 2024-01-04 22:58:12 +10:30
ld-visium Update year range in copyright notice of binutils files 2024-01-04 22:58:12 +10:30
ld-vsb Update year range in copyright notice of binutils files 2024-01-04 22:58:12 +10:30
ld-vxworks Update year range in copyright notice of binutils files 2024-01-04 22:58:12 +10:30
ld-x86-64 x86-64: Add R_X86_64_CODE_6_GOTTPOFF 2024-02-08 03:45:43 -08:00
ld-xstormy16 Update year range in copyright notice of binutils files 2024-01-04 22:58:12 +10:30
ld-xtensa Update year range in copyright notice of binutils files 2024-01-04 22:58:12 +10:30
ld-z8k Update year range in copyright notice of binutils files 2024-01-04 22:58:12 +10:30
ld-z80 Update year range in copyright notice of binutils files 2024-01-04 22:58:12 +10:30
lib Update year range in copyright notice of binutils files 2024-01-04 22:58:12 +10:30
ChangeLog-2004
ChangeLog-2005
ChangeLog-2006
ChangeLog-2007
ChangeLog-2008
ChangeLog-2009
ChangeLog-2010
ChangeLog-2011
ChangeLog-2012
ChangeLog-2013
ChangeLog-2014
ChangeLog-2015
ChangeLog-9303