binutils-gdb/ld/testsuite
Alan Modra f02cb05882 Always descend into output section statements in lang_do_assignments
See https://sourceware.org/ml/binutils/2016-07/msg00091.html
This patch stop --gc-sections elf_gc_sweep_symbol localizing symbols
that ought to remain global.

The difficulty with always descending into output section statements
is that symbols defined by the script in such statements don't have
a bfd section when lang_do_assignments runs early in the link process.
There are two approaches to curing this problem.  Either we can
create the bfd section early, or we can use a special section.  This
patch takes the latter approach and uses bfd_und_section.  (Creating
bfd sections early results in changed output section order, and thus
lots of testsuite failures.  You can't create all output sections
early to ensure proper ordering as KEEP then stops empty sections
from being stripped.)

The wrinkle with this approach is that some code that runs at
gc-sections time needs to be made aware of the odd defined symbols
using bfd_und_section.

bfd/
	* elf64-x86-64.c (elf_x86_64_convert_load_reloc): Handle symbols
	defined temporarily with bfd_und_section.
	* elflink.c (_bfd_elf_gc_keep): Don't set SEC_KEEP for bfd_und_section.
	* elfxx-mips.c (mips_elf_local_pic_function_p): Exclude defined
	symbols with bfd_und_section.
ld/
	* ldlang.c (lang_do_assignments_1): Descend into output section
	statements that do not yet have bfd sections.  Set symbol section
	temporarily for symbols defined in such statements to the undefined
	section.  Don't error on data or reloc statements until final phase.
	* ldexp.c (exp_fold_tree_1 <etree_assign>): Handle bfd_und_section
	in expld.section.
	* testsuite/ld-mmix/bpo-10.d: Adjust.
	* testsuite/ld-mmix/bpo-11.d: Adjust.
2016-10-11 18:13:04 +10:30
..
config
ld-aarch64 [AArch64] Print spaces after commas in addresses 2016-09-21 17:11:52 +01:00
ld-alpha Place .shstrtab section after .symtab and .strtab, thus restoring monotonically increasing section offsets. 2016-08-19 09:16:30 +01:00
ld-arc [ARC] Fix parsing dtpoff relocation expression. 2016-09-14 14:04:34 +02:00
ld-arm [ARM] PR ld/20608 Relocation truncated to fit: R_ARM_THM_JUMP24 for relocation to PLT entry 2016-09-28 01:41:00 +02:00
ld-auto-import
ld-avr Fix PR ld/20545 - relaxation bugs in avr backend 2016-09-06 12:28:37 +05:30
ld-bootstrap
ld-cdtest
ld-checks
ld-cris Place .shstrtab section after .symtab and .strtab, thus restoring monotonically increasing section offsets. 2016-08-19 09:16:30 +01:00
ld-crx
ld-cygwin
ld-d10v
ld-discard
ld-elf Add is_generic_elf to ld/ld-lib.exp 2016-10-07 10:52:13 +10:30
ld-elfcomm
ld-elfvers
ld-elfvsb
ld-elfweak
ld-fastcall
ld-frv
ld-gc Restrict linker garbage collection personality test to cfi enabled targets. 2016-07-27 12:01:09 +01:00
ld-h8300
ld-i386 i386: Issue an error on non-PIC call to IFUNC in PIC object 2016-08-29 08:14:45 -07:00
ld-ia64 Place .shstrtab section after .symtab and .strtab, thus restoring monotonically increasing section offsets. 2016-08-19 09:16:30 +01:00
ld-ifunc i386: Issue an error on non-PIC call to IFUNC in PIC object 2016-08-29 08:14:45 -07:00
ld-libs
ld-linkonce
ld-m68hc11
ld-m68k
ld-mep
ld-metag
ld-mips-elf Place .shstrtab section after .symtab and .strtab, thus restoring monotonically increasing section offsets. 2016-08-19 09:16:30 +01:00
ld-misc
ld-mmix Always descend into output section statements in lang_do_assignments 2016-10-11 18:13:04 +10:30
ld-mn10300
ld-nds32
ld-nios2
ld-pe
ld-pie
ld-plugin
ld-powerpc PowerPC .gnu.attributes 2016-09-26 18:04:57 +09:30
ld-s390 S/390: Move binary start to 16M. 2016-10-10 17:09:03 +02:00
ld-scripts
ld-selective
ld-sh Place .shstrtab section after .symtab and .strtab, thus restoring monotonically increasing section offsets. 2016-08-19 09:16:30 +01:00
ld-shared
ld-size
ld-sparc Place .shstrtab section after .symtab and .strtab, thus restoring monotonically increasing section offsets. 2016-08-19 09:16:30 +01:00
ld-spu
ld-srec
ld-tic6x Place .shstrtab section after .symtab and .strtab, thus restoring monotonically increasing section offsets. 2016-08-19 09:16:30 +01:00
ld-tilegx
ld-tilepro
ld-undefined Fix thinko in new weak undefined function test 2016-08-18 20:28:29 +09:30
ld-unique
ld-v850
ld-vax-elf
ld-versados
ld-visium
ld-vxworks
ld-x86-64 Resolve size relocation with copy relocation 2016-09-06 13:34:44 -07:00
ld-xc16x
ld-xstormy16
ld-xtensa Place .shstrtab section after .symtab and .strtab, thus restoring monotonically increasing section offsets. 2016-08-19 09:16:30 +01:00
ld-z8k
lib Add is_generic_elf to ld/ld-lib.exp 2016-10-07 10:52:13 +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