binutils-gdb/ld/testsuite
Tamar Christina 652afeef24 AArch64: Fix LD crash on weak and undefined TLS symbols. (PR/24602).
This patch fixes a few linker crashes due to TLS code reaching an assert when it
shouldn't.

The first scenario is with weak TLS symbols that remain weak during linking.  In
this case the mid-end would not have seen a TLS symbol and so wouldn't have
allocated the TLS section.  We currently assert here and the linker crashes with
a not very useful message.

This patch changes this to return the value 0 for the TLS symbol in question
emulating what lld and gold and other BFD targets do.  However because weak TLS
is implementation defined and we don't define any behavior for it I also emit a
warning to the user to inform them of such.

Secondly when a strong TLS reference is undefined. The linker crashes even after
it correctly reported that there is an undefined reference.  This changes it so
that it gracefully exits and reports a useful error.

bfd/ChangeLog:

	PR ld/24601
	* elfnn-aarch64.c (aarch64_relocate): Handle weak TLS and undefined TLS.
	Also Pass input_bfd to _bfd_aarch64_elf_resolve_relocation.
	* elfxx-aarch64.c (_bfd_aarch64_elf_resolve_relocation): Use it.
	* elfxx-aarch64.h (_bfd_aarch64_elf_resolve_relocation): Emit warning
	for weak TLS.

ld/ChangeLog:

	PR ld/24601
	* testsuite/ld-aarch64/aarch64-elf.exp (undef-tls, weak-tls): New.
	* testsuite/ld-aarch64/undef-tls.d: New test.
	* testsuite/ld-aarch64/undef-tls.s: New test.
	* testsuite/ld-aarch64/weak-tls.d: New test.
	* testsuite/ld-aarch64/weak-tls.s: New test.
2019-08-22 11:43:15 +01:00
..
config Use better test for usable compiler in ld testsuite. 2019-04-24 12:14:56 -07:00
ld-aarch64 AArch64: Fix LD crash on weak and undefined TLS symbols. (PR/24602). 2019-08-22 11:43:15 +01:00
ld-alpha Fix alpha testsuite regression 2019-06-14 10:23:20 +09:30
ld-arc [ARC] Add linker relaxation. 2019-07-24 16:33:29 +03:00
ld-arm Arm: Fix performance issue with thumb-2 tailcalls 2019-08-20 16:35:28 +01:00
ld-auto-import Use better test for usable compiler in ld testsuite. 2019-04-24 12:14:56 -07:00
ld-avr Fix PR 24571 - Relaxation does not shorten jmp or call to target at pc-relative range boundary 2019-05-21 12:48:06 +05:30
ld-bootstrap Update year range in copyright notice of binutils files 2019-01-01 22:06:53 +10:30
ld-bpf ld: use a specific linker script in BPF targets 2019-08-07 13:57:30 +02:00
ld-cdtest Update year range in copyright notice of binutils files 2019-01-01 22:06:53 +10:30
ld-checks Update year range in copyright notice of binutils files 2019-01-01 22:06:53 +10:30
ld-cris Dynamic TLS section symbols 2019-07-13 09:57:50 +09:30
ld-crx Update year range in copyright notice of binutils files 2019-01-01 22:06:53 +10:30
ld-csky Add support for the C_SKY series of processors. 2018-07-30 12:24:14 +01:00
ld-cygwin Use better test for usable compiler in ld testsuite. 2019-04-24 12:14:56 -07:00
ld-d10v Update year range in copyright notice of binutils files 2019-01-01 22:06:53 +10:30
ld-discard Support tcl procedure calls in run_dump_test xfail 2019-05-30 00:52:08 +09:30
ld-elf Add support for a MIPS specific .MIPS.xhash section. 2019-08-09 11:06:37 +01:00
ld-elfcomm Use better test for usable compiler in ld testsuite. 2019-04-24 12:14:56 -07:00
ld-elfvers Use better test for usable compiler in ld testsuite. 2019-04-24 12:14:56 -07:00
ld-elfvsb Use better test for usable compiler in ld testsuite. 2019-04-24 12:14:56 -07:00
ld-elfweak Use better test for usable compiler in ld testsuite. 2019-04-24 12:14:56 -07:00
ld-fastcall Update year range in copyright notice of binutils files 2019-01-01 22:06:53 +10:30
ld-frv Update year range in copyright notice of binutils files 2019-01-01 22:06:53 +10:30
ld-gc Use better test for usable compiler in ld testsuite. 2019-04-24 12:14:56 -07:00
ld-h8300 Update year range in copyright notice of binutils files 2019-01-01 22:06:53 +10:30
ld-i386 Change the output of readelf's note display so that the "Data size" column header is left justified. 2019-08-08 17:04:31 +01:00
ld-ia64 Update year range in copyright notice of binutils files 2019-01-01 22:06:53 +10:30
ld-ifunc Use better test for usable compiler in ld testsuite. 2019-04-24 12:14:56 -07:00
ld-libs Update year range in copyright notice of binutils files 2019-01-01 22:06:53 +10:30
ld-linkonce Update year range in copyright notice of binutils files 2019-01-01 22:06:53 +10:30
ld-m68hc11 Update year range in copyright notice of binutils files 2019-01-01 22:06:53 +10:30
ld-m68k run_dump_test source in build directory 2019-01-08 18:50:54 +10:30
ld-mep Update year range in copyright notice of binutils files 2019-01-01 22:06:53 +10:30
ld-metag Update year range in copyright notice of binutils files 2019-01-01 22:06:53 +10:30
ld-mips-elf Add support for a MIPS specific .MIPS.xhash section. 2019-08-09 11:06:37 +01:00
ld-misc Update year range in copyright notice of binutils files 2019-01-01 22:06:53 +10:30
ld-mmix Update year range in copyright notice of binutils files 2019-01-01 22:06:53 +10:30
ld-mn10300 Use better test for usable compiler in ld testsuite. 2019-04-24 12:14:56 -07:00
ld-msp430-elf MSP430 Linker: Define __crt0_init_bss/__crt0_movedata symbols when .lower or .either prefixed sections are present. 2019-04-17 15:05:08 +01:00
ld-nds32 Update year range in copyright notice of binutils files 2019-01-01 22:06:53 +10:30
ld-nios2 Run more ld tests when not native 2017-01-02 23:48:08 +10:30
ld-or1k Update year range in copyright notice of binutils files 2019-01-01 22:06:53 +10:30
ld-pe Use better test for usable compiler in ld testsuite. 2019-04-24 12:14:56 -07:00
ld-pie Use better test for usable compiler in ld testsuite. 2019-04-24 12:14:56 -07:00
ld-plugin Ajdust lto-3r and lto-5r tests for powerpc64 2019-07-26 10:02:34 +09:30
ld-powerpc PowerPC tlsie test fix 2019-08-02 12:41:05 +09:30
ld-pru Fix binary compatibility between GCC and the TI compiler for the PRU target. 2018-05-09 11:39:32 +01:00
ld-riscv-elf RISC-V: Fix lui relaxation issue with code at address 0. 2019-08-15 12:01:13 -07:00
ld-s12z Update year range in copyright notice of binutils files 2019-01-01 22:06:53 +10:30
ld-s390 Dynamic TLS section symbols 2019-07-13 09:57:50 +09:30
ld-scripts Move ld-scripts size tests 2019-07-23 18:22:01 +09:30
ld-selective Update year range in copyright notice of binutils files 2019-01-01 22:06:53 +10:30
ld-sh Use better test for usable compiler in ld testsuite. 2019-04-24 12:14:56 -07:00
ld-shared Use better test for usable compiler in ld testsuite. 2019-04-24 12:14:56 -07:00
ld-size Use better test for usable compiler in ld testsuite. 2019-04-24 12:14:56 -07:00
ld-sparc Dynamic TLS section symbols 2019-07-13 09:57:50 +09:30
ld-spu Update year range in copyright notice of binutils files 2019-01-01 22:06:53 +10:30
ld-srec ld: use a specific linker script in BPF targets 2019-08-07 13:57:30 +02:00
ld-tic6x Update year range in copyright notice of binutils files 2019-01-01 22:06:53 +10:30
ld-tilegx Update year range in copyright notice of binutils files 2019-01-01 22:06:53 +10:30
ld-tilepro Update year range in copyright notice of binutils files 2019-01-01 22:06:53 +10:30
ld-undefined ld: use a specific linker script in BPF targets 2019-08-07 13:57:30 +02:00
ld-unique Use better test for usable compiler in ld testsuite. 2019-04-24 12:14:56 -07:00
ld-v850 Update year range in copyright notice of binutils files 2019-01-01 22:06:53 +10:30
ld-vax-elf Update year range in copyright notice of binutils files 2019-01-01 22:06:53 +10:30
ld-visium Update year range in copyright notice of binutils files 2019-01-01 22:06:53 +10:30
ld-vxworks Update year range in copyright notice of binutils files 2019-01-01 22:06:53 +10:30
ld-x86-64 x86-64: Move PIC check for PC-relative relocations back 2019-08-16 14:25:58 -07:00
ld-xc16x Update year range in copyright notice of binutils files 2019-01-01 22:06:53 +10:30
ld-xstormy16 Update year range in copyright notice of binutils files 2019-01-01 22:06:53 +10:30
ld-xtensa bfd: xtensa: fix shrink_dynamic_reloc_sections for export-dynamic 2019-03-29 10:02:10 -07:00
ld-z8k Update year range in copyright notice of binutils files 2019-01-01 22:06:53 +10:30
lib s12z genelf.em 2019-05-30 01:01:42 +09: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