binutils-gdb/ld/testsuite
Maciej W. Rozycki 1cb83cac9a MIPS/BFD: Fix TLS relocation resolution for regular executables
Correct an issue with commit 0f20cc3522 ("TLS support for MIPS"),
<https://sourceware.org/ml/binutils/2005-02/msg00607.html>, where a
condition used to determine whether to use a dynamic symbol for GD, LD
and IE TLS dynamic relocations against a symbol that has been defined
locally has been incorrectly reversed.

It's executables rather than dynamic shared objects where no symbol is
required, because such symbols cannot be preempted and therefore their
values (thread pointer offsets) are fixed at the static link time as is
the associated module ID of the main executable, so the original
condition should have been `shared' instead of `!shared'.  This wrong
condition was then later converted from `!shared' to `!bfd_link_pic',
with commit 0e1862bb40 ("Add output_type to bfd_link_info").

Use the correct `bfd_link_dll' condition then, and adjust code for the
dynamic symbol index possibly being -1 as with symbols that have been
forced local, removing unnecessary dynamic relocations from dynamic
regular executables.  PIE executables are unaffected as the existing
condition excluded them by chance due to the conversion mentioned above.

Adjust test cases accordingly.

	bfd/
	* elfxx-mips.c (mips_tls_got_relocs): Use `bfd_link_dll' rather
	than `!bfd_link_pic' in determining the dynamic symbol index.
	Avoid the index of -1.
	(mips_elf_initialize_tls_slots): Likewise.  Flatten code by
	moving `dyn' to the beginning of the function block.

	ld/
	* testsuite/ld-mips-elf/tlsdyn-o32.d: Update test for dynamic
	relocation removal.
	* testsuite/ld-mips-elf/tlsdyn-o32.got: Likewise.
	* testsuite/ld-mips-elf/tlsdyn-o32-1.d: Likewise.
	* testsuite/ld-mips-elf/tlsdyn-o32-1.got: Likewise.
	* testsuite/ld-mips-elf/tlsdyn-o32-2.d: Likewise.
	* testsuite/ld-mips-elf/tlsdyn-o32-2.got: Likewise.
	* testsuite/ld-mips-elf/tlsdyn-o32-3.d: Likewise.
	* testsuite/ld-mips-elf/tlsdyn-o32-3.got: Likewise.
2018-07-11 17:44:45 +01:00
..
config ld: Skip unsupported static executable tests 2018-01-29 04:55:23 -08:00
ld-aarch64 [BFD][AARCH64]Properly truncate no overflow checking relocation value for load/store immediate. 2018-06-20 14:47:37 +01:00
ld-alpha Define various symbols conditionally in shared libraries 2018-06-08 20:17:34 +09:30
ld-arc ld error/warning messages 2018-02-26 10:51:12 +10:30
ld-arm [ARM] Update bfd's Tag_CPU_arch knowledge 2018-07-02 11:22:20 +01:00
ld-auto-import Update year range in copyright notice of binutils files 2018-01-03 17:49:56 +10:30
ld-avr Update year range in copyright notice of binutils files 2018-01-03 17:49:56 +10:30
ld-bootstrap Fix parens in ld bootstrap.exp 2018-06-26 21:28:05 +09:30
ld-cdtest Update year range in copyright notice of binutils files 2018-01-03 17:49:56 +10:30
ld-checks Update year range in copyright notice of binutils files 2018-01-03 17:49:56 +10:30
ld-cris ELF dynsyms 2018-06-14 11:32:01 +09:30
ld-crx Update year range in copyright notice of binutils files 2018-01-03 17:49:56 +10:30
ld-cygwin Update year range in copyright notice of binutils files 2018-01-03 17:49:56 +10:30
ld-d10v Update year range in copyright notice of binutils files 2018-01-03 17:49:56 +10:30
ld-discard xgate testsuite fixes 2018-07-10 23:59:59 +09:30
ld-elf Revise "ld testsuite use of notarget" 2018-07-11 16:39:04 +09:30
ld-elfcomm Remove sh5 and sh64 support 2018-04-16 15:29:39 +09:30
ld-elfvers various i386-aout and i386-coff target removal 2018-04-18 09:34:19 +09:30
ld-elfvsb various i386-aout and i386-coff target removal 2018-04-18 09:34:19 +09:30
ld-elfweak various i386-aout and i386-coff target removal 2018-04-18 09:34:19 +09:30
ld-fastcall Update year range in copyright notice of binutils files 2018-01-03 17:49:56 +10:30
ld-frv Define various symbols conditionally in shared libraries 2018-06-08 20:17:34 +09:30
ld-gc Revise "ld testsuite use of notarget" 2018-07-11 16:39:04 +09:30
ld-h8300 Remove h8300-coff support 2018-04-16 15:17:57 +09:30
ld-i386 x86: Remove x86 ISA properties with empty bits 2018-07-05 09:24:18 -07:00
ld-ia64 Define various symbols conditionally in shared libraries 2018-06-08 20:17:34 +09:30
ld-ifunc ld testsuite use of notarget 2018-07-10 23:58:29 +09:30
ld-libs Update year range in copyright notice of binutils files 2018-01-03 17:49:56 +10:30
ld-linkonce various i386-aout and i386-coff target removal 2018-04-18 09:34:19 +09:30
ld-m68hc11 Update year range in copyright notice of binutils files 2018-01-03 17:49:56 +10:30
ld-m68k Define various symbols conditionally in shared libraries 2018-06-08 20:17:34 +09:30
ld-mep Update year range in copyright notice of binutils files 2018-01-03 17:49:56 +10:30
ld-metag Define various symbols conditionally in shared libraries 2018-06-08 20:17:34 +09:30
ld-mips-elf MIPS/BFD: Fix TLS relocation resolution for regular executables 2018-07-11 17:44:45 +01:00
ld-misc ld testsuite use of notarget 2018-07-10 23:58:29 +09:30
ld-mmix ld error/warning messages 2018-02-26 10:51:12 +10:30
ld-mn10300 Update year range in copyright notice of binutils files 2018-01-03 17:49:56 +10:30
ld-msp430-elf Update year range in copyright notice of binutils files 2018-01-03 17:49:56 +10:30
ld-nds32 Update year range in copyright notice of binutils files 2018-01-03 17:49:56 +10:30
ld-nios2 Run more ld tests when not native 2017-01-02 23:48:08 +10:30
ld-pe ld testsuite use of notarget 2018-07-10 23:58:29 +09:30
ld-pie Update year range in copyright notice of binutils files 2018-01-03 17:49:56 +10:30
ld-plugin ld: Set non_ir_ref_regular for --undefined SYMBOL 2018-07-04 06:29:13 -07:00
ld-powerpc Error for mismatched powerpc ABI tags 2018-07-05 10:21:37 +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: Handle out-of-range calls to undefined weak. 2018-06-03 15:42:29 -07:00
ld-s12z Add support for the Freescale s12z processor. 2018-05-18 15:26:18 +01:00
ld-s390 Define various symbols conditionally in shared libraries 2018-06-08 20:17:34 +09:30
ld-scripts Revise "ld testsuite use of notarget" 2018-07-11 16:39:04 +09:30
ld-selective Remove sh5 and sh64 support 2018-04-16 15:29:39 +09:30
ld-sh Define various symbols conditionally in shared libraries 2018-06-08 20:17:34 +09:30
ld-shared various i386-aout and i386-coff target removal 2018-04-18 09:34:19 +09:30
ld-size various i386-aout and i386-coff target removal 2018-04-18 09:34:19 +09:30
ld-sparc Define various symbols conditionally in shared libraries 2018-06-08 20:17:34 +09:30
ld-spu Update year range in copyright notice of binutils files 2018-01-03 17:49:56 +10:30
ld-srec Remove sh5 and sh64 support 2018-04-16 15:29:39 +09:30
ld-tic6x ld: Adjust tic6x tests 2018-05-21 20:41:24 -07:00
ld-tilegx Update year range in copyright notice of binutils files 2018-01-03 17:49:56 +10:30
ld-tilepro Update year range in copyright notice of binutils files 2018-01-03 17:49:56 +10:30
ld-undefined [ARM] FDPIC: Update testsuite so that many tests pass with arm*-uclinuxfdpiceabi. 2018-04-25 21:13:14 +00:00
ld-unique ld testsuite use of notarget 2018-07-10 23:58:29 +09:30
ld-v850 Update year range in copyright notice of binutils files 2018-01-03 17:49:56 +10:30
ld-vax-elf Update year range in copyright notice of binutils files 2018-01-03 17:49:56 +10:30
ld-visium Update year range in copyright notice of binutils files 2018-01-03 17:49:56 +10:30
ld-vxworks Update year range in copyright notice of binutils files 2018-01-03 17:49:56 +10:30
ld-x86-64 x86: Remove x86 ISA properties with empty bits 2018-07-05 09:24:18 -07:00
ld-xc16x Update year range in copyright notice of binutils files 2018-01-03 17:49:56 +10:30
ld-xstormy16 Update year range in copyright notice of binutils files 2018-01-03 17:49:56 +10:30
ld-xtensa Update year range in copyright notice of binutils files 2018-01-03 17:49:56 +10:30
ld-z8k Update year range in copyright notice of binutils files 2018-01-03 17:49:56 +10:30
lib xgate testsuite fixes 2018-07-10 23:59:59 +09:30
ChangeLog-2004 Add copyright notices 2012-12-10 12:48:03 +00:00
ChangeLog-2005 Add copyright notices 2012-12-10 12:48:03 +00:00
ChangeLog-2006 Add copyright notices 2012-12-10 12:48:03 +00:00
ChangeLog-2007 Add copyright notices 2012-12-10 12:48:03 +00:00
ChangeLog-2008 Add copyright notices 2012-12-10 12:48:03 +00:00
ChangeLog-2009 Add copyright notices 2012-12-10 12:48:03 +00:00
ChangeLog-2010 Add copyright notices 2012-12-10 12:48:03 +00:00
ChangeLog-2011 Add copyright notices 2012-12-10 12:48:03 +00:00
ChangeLog-2012 Rotate binutils ChangeLog for 2013 2013-01-02 17:06:32 +00:00
ChangeLog-2013 New Year - binutils ChangeLog rotation 2014-01-08 05:32:12 -08:00
ChangeLog-2014 ChangeLog rotatation and copyright year update 2015-01-02 00:53:45 +10:30
ChangeLog-2015 binutils ChangeLog rotation 2016-01-01 22:59:17 +10:30
ChangeLog-9303 Add copyright notices 2012-12-10 12:48:03 +00:00