binutils-gdb/ld/testsuite
Andrew Burgess 9d7b48dc6e AVR/ld: Propagate link-relax elf header flag correctly.
The AVR target has an elf header flag to indicate if an object was
assembler ready for linker relaxation.  If a partial link is performed
then it is important that the link-relax flag in the output object is
set correctly, otherwise, during the final link, we might try to perform
linker relaxation on code that was not assembled suitably.

As the link-relax elf header covers the entire object file we must be
conservative when setting the flag in the output object, so, for a
partial link, any input object that does not have the link-relax flag
set will cause the output object to also not have the link-relax flag
set.

This conservative approach could be softened in future, we only need to
disable the link relax flag if an input file is not marked link-relax
ready, and the input file contains a relaxable section.  However, I've
left this optimisation for a later day.

For the final link I've overloaded the use of the link-relax elf header
flag, in a final executable, the flag now indicates if the executable
was built with linker relaxation on or not.

ld/ChangeLog:

	* emultempl/avrelf.em: Add include of elf/avr.h.
	(avr_finish): New function.
	(LDEMUL_FINISH): Added.

ld/testsuite/ChangeLog:

	* ld-avr/relax-elf-flags-01.d: New file.
	* ld-avr/relax-elf-flags-02.d: New file.
	* ld-avr/relax-elf-flags-03.d: New file.
	* ld-avr/relax-elf-flags-04.d: New file.
	* ld-avr/relax-elf-flags-05.d: New file.
	* ld-avr/relax-elf-flags-06.d: New file.
	* ld-avr/relax-elf-flags-07.d: New file.
	* ld-avr/relax-elf-flags-08.d: New file.
	* ld-avr/relax-elf-flags-a.s: New file.
	* ld-avr/relax-elf-flags-b.s: New file.
2014-12-23 15:45:11 +00:00
..
config
ld-aarch64 [AArch64] Cortex-A53 erratum 835769 linker workaround 2014-10-24 11:39:35 +01:00
ld-alpha Update ld-alpha tests for secureplt 2014-11-25 13:41:30 -08:00
ld-arm Calculate ARM arch attribute after relaxation 2014-11-21 11:54:39 +08:00
ld-auto-import
ld-avr AVR/ld: Propagate link-relax elf header flag correctly. 2014-12-23 15:45:11 +00:00
ld-bootstrap
ld-cdtest
ld-checks
ld-cris Display symbol version when dumping dynrelocs 2014-11-25 06:47:44 -08:00
ld-crx
ld-cygwin
ld-d10v
ld-discard
ld-elf Don't PROVIDE over top of common symbols 2014-12-23 23:36:50 +10:30
ld-elfcomm
ld-elfvers Display symbol version when dumping dynrelocs 2014-11-25 06:47:44 -08:00
ld-elfvsb
ld-elfweak
ld-fastcall
ld-frv
ld-gc
ld-h8300
ld-i386 Optimize out i386/x86-64 JUMP_SLOT relocation 2014-11-25 05:05:39 -08:00
ld-ia64
ld-ifunc Always load function pointer into a stack variable 2014-11-20 11:29:45 -08:00
ld-libs
ld-linkonce
ld-m68hc11
ld-m68k
ld-mep
ld-metag
ld-mips-elf Fix all failing FPXX tests for tx39-elf. 2014-12-19 14:20:17 +00:00
ld-misc
ld-mmix Move ELF section headers to end of object file 2014-09-11 00:15:51 +09:30
ld-mn10300
ld-nds32
ld-nios2
ld-pe
ld-pie
ld-plugin Find lto plugin when using gcc-5.0 2014-09-22 19:04:48 +09:30
ld-powerpc Use a symbol flag bit to mark linker defined symbols 2014-12-23 23:36:50 +10:30
ld-s390
ld-scripts Fix ld tests with sysroot=/ and --enable-targets=all and test --print-sysroot 2014-10-17 13:11:42 +02:00
ld-selective
ld-sh Sort relocs output by ld -r 2014-12-04 17:37:58 +10:30
ld-shared
ld-size
ld-sparc
ld-spu
ld-srec
ld-tic6x Move ELF section headers to end of object file 2014-09-11 00:15:51 +09:30
ld-tilegx
ld-tilepro
ld-undefined
ld-unique ld/testsuite/ld-unique: Fix running unique tests on ARM 2014-10-30 11:06:43 +00:00
ld-v850
ld-vax-elf
ld-versados
ld-visium Add Visium support to ld 2014-12-06 16:45:22 +01:00
ld-vxworks
ld-x86-64 Handle weak alias for PIE with copy reloc 2014-12-13 23:39:56 -08:00
ld-xc16x
ld-xstormy16
ld-xtensa
lib Add Visium support to ld 2014-12-06 16:45:22 +01:00
ChangeLog AVR/ld: Propagate link-relax elf header flag correctly. 2014-12-23 15:45:11 +00:00
ChangeLog-2004
ChangeLog-2005
ChangeLog-2006
ChangeLog-2007
ChangeLog-2008
ChangeLog-2009
ChangeLog-2010
ChangeLog-2011
ChangeLog-2012
ChangeLog-2013
ChangeLog-9303