binutils-gdb/ld/testsuite
Alan Modra b209b5a6b8 SHF_LINK_ORDER fixup_link_order in ld
This moves the SHF_LINK_ORDER sorting from bfd_elf_final_link to
the linker which means generic ELF targets now support SHF_LINK_ORDER
and  we cope with odd cases that require resizing of output sections.
The patch also fixes two bugs in the current implementation,
introduced by commit cd6d537c48.  The pattern test used by that
commit meant that sections matching something like
"*(.IA_64.unwind* .gnu.linkonce.ia64unw.*)" would not properly sort a
mix of sections matching the two wildcards.  That commit also assumed
a stable qsort.

bfd/
	PR 27160
	* section.c (struct bfd_section): Remove pattern field.
	(BFD_FAKE_SECTION): Adjust to suit.
	* bfd-in2.h: Regenerate.
	* elflink.c (compare_link_order, elf_fixup_link_order): Delete.
	(bfd_elf_final_link): Don't call elf_fixup_link_order.
ld/
	PR 27160
	* ldlang.h (lang_output_section_statement_type): Add data field.
	(lang_input_section_type, lang_section_bst_type): Add pattern field.
	(statement_list): Declare.
	(lang_add_section): Adjust prototype.
	* emultempl/aarch64elf.em: Adjust lang_add_section calls.
	* emultempl/armelf.em: Likewise.
	* emultempl/beos.em: Likewise.
	* emultempl/cskyelf.em: Likewise.
	* emultempl/hppaelf.em: Likewise.
	* emultempl/m68hc1xelf.em: Likewise.
	* emultempl/metagelf.em: Likewise.
	* emultempl/mipself.em: Likewise.
	* emultempl/mmo.em: Likewise.
	* emultempl/msp430.em: Likewise.
	* emultempl/nios2elf.em: Likewise.
	* emultempl/pe.em: Likewise.
	* emultempl/pep.em: Likewise.
	* emultempl/ppc64elf.em: Likewise.
	* emultempl/spuelf.em: Likewise.
	* emultempl/vms.em: Likewise.
	* ldelf.c: Likewise.
	* ldelfgen.c: Include ldctor.h.
	(struct os_sections): New.
	(add_link_order_input_section, link_order_scan): New functions.
	(compare_link_order, fixup_link_order): New functions.
	(ldelf_map_segments): Call link_order_scan and fixup_link_order.
	* ldlang.c (statement_list): Make global.
	(output_section_callback_fast): Save pattern in tree node.
	(lang_add_section): Add pattern parameter, save in lang_input_section.
	(output_section_callback_tree_to_list): Adjust lang_add_section calls.
	(lang_insert_orphan, output_section_callback): Likewise.
	(ldlang_place_orphan): Likewise.
	(gc_section_callback): Don't set section->pattern
	* testsuite/ld-elf/pr26256-2a.d: Don't xfail generic.
	* testsuite/ld-elf/pr26256-3b.d: Likewise.
	* testsuite/ld-elf/pr26256-2b.d: Likewise.  notarget xgate.
2021-01-13 22:06:02 +10:30
..
config Update year range in copyright notice of binutils files 2021-01-01 10:31:05 +10:30
ld-aarch64 Update year range in copyright notice of binutils files 2021-01-01 10:31:05 +10:30
ld-alpha Update year range in copyright notice of binutils files 2021-01-01 10:31:05 +10:30
ld-arc Update year range in copyright notice of binutils files 2021-01-01 10:31:05 +10:30
ld-arm PR26822, How to prevent a STT_FILE with absolute path in the linked image 2021-01-04 18:58:15 +10:30
ld-auto-import Update year range in copyright notice of binutils files 2021-01-01 10:31:05 +10:30
ld-avr Update year range in copyright notice of binutils files 2021-01-01 10:31:05 +10:30
ld-bootstrap Update year range in copyright notice of binutils files 2021-01-01 10:31:05 +10:30
ld-bpf Update year range in copyright notice of binutils files 2021-01-01 10:31:05 +10:30
ld-cdtest Update year range in copyright notice of binutils files 2021-01-01 10:31:05 +10:30
ld-checks Update year range in copyright notice of binutils files 2021-01-01 10:31:05 +10:30
ld-cris Update year range in copyright notice of binutils files 2021-01-01 10:31:05 +10:30
ld-crx Update year range in copyright notice of binutils files 2021-01-01 10:31:05 +10:30
ld-csky CSKY: Change default linker script for elf toolchain. 2020-10-26 17:13:21 +08:00
ld-ctf libctf, ld: fix formatting of forwards to unions and enums 2021-01-05 14:53:40 +00:00
ld-cygwin Update year range in copyright notice of binutils files 2021-01-01 10:31:05 +10:30
ld-d10v Update year range in copyright notice of binutils files 2021-01-01 10:31:05 +10:30
ld-discard Update year range in copyright notice of binutils files 2021-01-01 10:31:05 +10:30
ld-dynamic Update year range in copyright notice of binutils files 2021-01-01 10:31:05 +10:30
ld-elf SHF_LINK_ORDER fixup_link_order in ld 2021-01-13 22:06:02 +10:30
ld-elfcomm Update year range in copyright notice of binutils files 2021-01-01 10:31:05 +10:30
ld-elfvers Update year range in copyright notice of binutils files 2021-01-01 10:31:05 +10:30
ld-elfvsb Update year range in copyright notice of binutils files 2021-01-01 10:31:05 +10:30
ld-elfweak Update year range in copyright notice of binutils files 2021-01-01 10:31:05 +10:30
ld-fastcall Update year range in copyright notice of binutils files 2021-01-01 10:31:05 +10:30
ld-frv Update year range in copyright notice of binutils files 2021-01-01 10:31:05 +10:30
ld-gc Update year range in copyright notice of binutils files 2021-01-01 10:31:05 +10:30
ld-h8300 Update year range in copyright notice of binutils files 2021-01-01 10:31:05 +10:30
ld-i386 ELF: Don't generate unused section symbols 2021-01-07 06:46:55 -08:00
ld-ia64 Update year range in copyright notice of binutils files 2021-01-01 10:31:05 +10:30
ld-ifunc ELF: Don't generate unused section symbols 2021-01-07 06:46:55 -08:00
ld-libs Update year range in copyright notice of binutils files 2021-01-01 10:31:05 +10:30
ld-linkonce Update year range in copyright notice of binutils files 2021-01-01 10:31:05 +10:30
ld-m68hc11 Update year range in copyright notice of binutils files 2021-01-01 10:31:05 +10:30
ld-m68k Update year range in copyright notice of binutils files 2021-01-01 10:31:05 +10:30
ld-mep Update year range in copyright notice of binutils files 2021-01-01 10:31:05 +10:30
ld-metag Update year range in copyright notice of binutils files 2021-01-01 10:31:05 +10:30
ld-mips-elf PR26822, How to prevent a STT_FILE with absolute path in the linked image 2021-01-04 18:58:15 +10:30
ld-misc Update year range in copyright notice of binutils files 2021-01-01 10:31:05 +10:30
ld-mmix Update year range in copyright notice of binutils files 2021-01-01 10:31:05 +10:30
ld-mn10300 Update year range in copyright notice of binutils files 2021-01-01 10:31:05 +10:30
ld-msp430-elf Update year range in copyright notice of binutils files 2021-01-01 10:31:05 +10:30
ld-nds32 Update year range in copyright notice of binutils files 2021-01-01 10:31:05 +10:30
ld-nios2
ld-or1k Update year range in copyright notice of binutils files 2021-01-01 10:31:05 +10:30
ld-pdp11 Update year range in copyright notice of binutils files 2021-01-01 10:31:05 +10:30
ld-pe Update year range in copyright notice of binutils files 2021-01-01 10:31:05 +10:30
ld-pie Update year range in copyright notice of binutils files 2021-01-01 10:31:05 +10:30
ld-plugin PR26822, How to prevent a STT_FILE with absolute path in the linked image 2021-01-04 18:58:15 +10:30
ld-powerpc Update year range in copyright notice of binutils files 2021-01-01 10:31:05 +10:30
ld-pru
ld-riscv-elf RISC-V: Fix riscv gas/ld testsuites failures for big endian. 2021-01-06 18:01:41 +08:00
ld-s12z Update year range in copyright notice of binutils files 2021-01-01 10:31:05 +10:30
ld-s390 Update year range in copyright notice of binutils files 2021-01-01 10:31:05 +10:30
ld-scripts sh-pe ld XPASSes 2021-01-08 00:32:43 +10:30
ld-selective Update year range in copyright notice of binutils files 2021-01-01 10:31:05 +10:30
ld-sh Update year range in copyright notice of binutils files 2021-01-01 10:31:05 +10:30
ld-shared Update year range in copyright notice of binutils files 2021-01-01 10:31:05 +10:30
ld-size Update year range in copyright notice of binutils files 2021-01-01 10:31:05 +10:30
ld-sparc sparc-sun-solaris2 and sparc64-sun-solaris2 config 2021-01-06 21:03:55 +10:30
ld-spu Update year range in copyright notice of binutils files 2021-01-01 10:31:05 +10:30
ld-srec Update year range in copyright notice of binutils files 2021-01-01 10:31:05 +10:30
ld-tic6x PR26822, How to prevent a STT_FILE with absolute path in the linked image 2021-01-04 18:58:15 +10:30
ld-tilegx Update year range in copyright notice of binutils files 2021-01-01 10:31:05 +10:30
ld-tilepro Update year range in copyright notice of binutils files 2021-01-01 10:31:05 +10:30
ld-undefined Update year range in copyright notice of binutils files 2021-01-01 10:31:05 +10:30
ld-unique Update year range in copyright notice of binutils files 2021-01-01 10:31:05 +10:30
ld-v850 Update year range in copyright notice of binutils files 2021-01-01 10:31:05 +10:30
ld-vax-elf Update year range in copyright notice of binutils files 2021-01-01 10:31:05 +10:30
ld-visium Update year range in copyright notice of binutils files 2021-01-01 10:31:05 +10:30
ld-vxworks Update year range in copyright notice of binutils files 2021-01-01 10:31:05 +10:30
ld-x86-64 elf/x86-64: Adjust R_AMD64_DIR64/R_AMD64_DIR32 for PE/x86-64 inputs 2021-01-12 05:19:24 -08:00
ld-xc16x Update year range in copyright notice of binutils files 2021-01-01 10:31:05 +10:30
ld-xstormy16 Update year range in copyright notice of binutils files 2021-01-01 10:31:05 +10:30
ld-xtensa PR26822, How to prevent a STT_FILE with absolute path in the linked image 2021-01-04 18:58:15 +10:30
ld-z8k Update year range in copyright notice of binutils files 2021-01-01 10:31:05 +10:30
ld-z80 Update year range in copyright notice of binutils files 2021-01-01 10:31:05 +10:30
lib Update year range in copyright notice of binutils files 2021-01-01 10:31:05 +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