Alan Modra 165f707ac8 PR22471, undefined reference to linker-defined symbols
This patch processes linker script assignment statements before ld
opens DT_NEEDED libraries, in order to define symbols like __bss_start
that might also be defined by a library, falsely triggering an error
about "DSO missing from command line".

The initial value won't be correct when assigning a symbol from dot,
and I make no attempt to handle all expressions.  For example, an
assignment like "_start_foo = ADDR (.foo)" isn't valid until sections
are laid out, so won't define _start_foo early.  What's here should be
enough for most common scripts, and hopefully won't perturb fragile
scripts.

bfd/
	PR 22471
	* elflink.c (_bfd_elf_merge_symbol): Allow weak symbols to override
	early passes over linker script symbols.
	* linker.c (_bfd_generic_link_add_one_symbol): Allow symbols to
	override early passes over linker script symbols.  Clear ldscript_def
	on symbol definitions.
ld/
	PR 22471
	* ldexp.c (struct definedness_hash_entry): Delete "by_script".  Make
	"iteration" an 8-bit field, and update mask in all uses.
	(definedness_newfunc): Don't init "by_script".
	(update_definedness): Test ldscript_def rather than by_script.
	(is_sym_value): Likewise.
	(fold_name <DEFINED>): Return a result for first phase.  Test
	ldscript_def.
	(fold_name <NAME>): Return a result for first phase.
	* ldlang.c (open_input_bfds): Process all assignments, not just
	defsym.
	(lang_process): Increment lang_statement_iteration before
	open_input_bfds.
	* testsuite/ld-mips-elf/tlsdyn-o32-1.d: Adjust for larger .dynsym.
	* 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.
2017-11-28 22:57:00 +10:30
..
2007-06-29 16:41:32 +00:00
2007-06-29 16:41:32 +00:00
2007-06-29 16:41:32 +00:00
ld/
2006-10-16 21:34:25 +00:00
2015-05-28 15:21:17 -07:00
2015-05-28 15:21:17 -07:00
2015-05-28 15:21:17 -07:00
2015-05-28 15:21:17 -07:00
2015-05-28 15:21:17 -07:00
2015-05-28 15:21:17 -07:00
2015-05-28 15:21:17 -07:00
2015-05-28 15:21:17 -07:00
2015-05-28 15:21:17 -07:00
2015-05-28 15:21:17 -07:00
2015-05-28 15:21:17 -07:00
2015-05-28 15:21:17 -07:00
2015-05-28 15:21:17 -07:00
2013-10-13 10:17:20 +00:00
2013-10-13 10:17:20 +00:00
2013-10-13 10:17:20 +00:00
2013-10-13 10:17:20 +00:00
2013-10-13 10:17:20 +00:00
2013-10-13 10:17:20 +00:00
2013-10-13 10:17:20 +00:00
2013-10-13 10:17:20 +00:00
2013-10-13 10:17:20 +00:00
2012-05-13 09:45:45 +00:00
2012-05-13 09:45:45 +00:00
2013-09-24 22:15:38 +00:00
2009-09-19 08:06:11 +00:00
2013-05-03 15:19:27 +00:00
2013-05-03 15:19:27 +00:00
2013-05-03 15:19:27 +00:00
2013-05-03 15:19:27 +00:00
2013-05-03 15:19:27 +00:00
2012-08-06 21:28:45 +00:00
2006-03-14 07:47:49 +00:00
2012-08-06 21:05:54 +00:00
2012-08-06 21:05:54 +00:00
2008-08-07 20:01:14 +00:00
2008-03-20 10:53:11 +00:00
2008-08-07 20:01:14 +00:00
2008-03-20 10:53:11 +00:00
2007-11-14 20:46:15 +00:00
2007-11-14 20:46:15 +00:00
2012-08-06 21:28:45 +00:00
2007-11-14 20:46:15 +00:00
2007-11-14 20:46:15 +00:00
2007-11-14 20:46:15 +00:00
2007-11-14 20:46:15 +00:00
2007-11-14 20:46:15 +00:00
2013-02-13 14:08:58 +00:00
2013-02-13 14:08:58 +00:00
2013-02-13 14:08:58 +00:00
2013-02-13 14:08:58 +00:00
2013-02-13 14:08:58 +00:00
2013-02-13 14:08:58 +00:00
2013-02-13 14:08:58 +00:00
2013-02-13 14:08:58 +00:00
2013-02-13 14:08:58 +00:00
2013-02-13 14:08:58 +00:00
2013-02-13 14:08:58 +00:00
2013-02-13 14:08:58 +00:00
2013-02-13 14:08:58 +00:00
2013-02-13 14:08:58 +00:00
2013-02-13 14:08:58 +00:00
2013-02-13 14:08:58 +00:00
2013-02-13 14:08:58 +00:00
2013-02-13 14:08:58 +00:00
2013-02-13 14:08:58 +00:00
2008-08-07 19:58:38 +00:00
2008-08-07 19:58:38 +00:00
2008-08-07 19:58:38 +00:00
2008-08-07 19:58:38 +00:00
ld/
2006-07-29 08:48:15 +00:00
ld/
2006-07-29 08:48:15 +00:00
ld/
2006-07-29 08:48:15 +00:00
ld/
2006-07-29 08:48:15 +00:00
ld/
2006-10-16 21:34:25 +00:00
2012-08-06 21:05:54 +00:00
ld/
2006-10-16 21:34:25 +00:00
2013-05-29 16:22:14 +00:00
2013-05-29 16:22:14 +00:00
2011-07-24 14:20:15 +00:00
2011-07-24 14:20:15 +00:00
2011-07-24 14:20:15 +00:00
2011-07-24 14:20:15 +00:00
2011-07-24 14:20:15 +00:00
2011-07-24 14:20:15 +00:00
2015-08-12 17:10:22 +01:00
2011-07-24 14:20:15 +00:00
2012-05-13 09:55:45 +00:00
2012-05-13 09:55:45 +00:00
2012-05-13 09:55:45 +00:00
2012-05-13 09:55:45 +00:00
2005-02-15 19:57:54 +00:00
2005-02-15 19:57:54 +00:00
2005-02-15 19:57:54 +00:00
2005-02-15 19:57:54 +00:00
2006-11-02 15:20:31 +00:00
2006-11-02 15:20:31 +00:00
2008-08-06 19:44:47 +00:00
2007-06-25 10:13:57 +00:00
2008-08-06 19:44:47 +00:00
2010-09-19 10:26:28 +00:00
2013-08-23 07:54:19 +00:00
2008-08-06 19:44:47 +00:00
2008-08-06 19:44:47 +00:00
2013-09-24 22:15:38 +00:00
2013-02-13 14:08:58 +00:00
2013-09-24 22:15:38 +00:00
2008-08-07 20:01:14 +00:00
2008-08-06 19:44:47 +00:00
2008-08-06 19:44:47 +00:00
2015-08-12 17:10:22 +01:00
2008-08-18 18:14:05 +00:00
2008-08-18 18:14:05 +00:00
2008-08-18 18:14:05 +00:00
2008-08-18 18:14:05 +00:00
2008-08-18 18:14:05 +00:00
2008-08-18 18:14:05 +00:00
2005-03-05 00:01:44 +00:00
2005-03-05 00:01:44 +00:00
2013-07-12 15:58:15 +00:00
2013-07-12 15:58:15 +00:00
2013-07-12 15:58:15 +00:00
2013-07-12 15:58:15 +00:00
2008-07-10 19:06:54 +00:00
2008-07-10 19:06:54 +00:00
2013-09-24 22:15:38 +00:00
2013-09-24 22:15:38 +00:00
2013-09-24 22:15:38 +00:00
2013-09-24 22:15:38 +00:00
2013-10-13 10:03:22 +00:00
2013-10-13 10:03:22 +00:00
2013-10-13 10:03:22 +00:00
2013-10-13 10:03:22 +00:00
2013-10-13 10:03:22 +00:00
2013-10-13 10:03:22 +00:00
2013-10-13 10:03:22 +00:00
2013-10-13 10:03:22 +00:00
2013-10-13 10:03:22 +00:00
2015-06-26 11:53:33 +01:00
2012-08-06 21:28:45 +00:00
2012-08-06 21:28:45 +00:00
ld/
2006-10-16 21:34:25 +00:00
ld/
2006-10-16 21:34:25 +00:00
2011-05-15 18:52:01 +00:00
2011-05-15 18:52:01 +00:00
2008-08-07 19:50:05 +00:00
2008-08-07 19:50:05 +00:00
2012-06-06 10:50:18 +00:00
2006-06-11 08:33:27 +00:00
2012-08-06 21:28:45 +00:00
2005-03-24 01:30:47 +00:00
2007-11-14 20:46:15 +00:00
2007-11-14 20:46:15 +00:00
2006-02-04 08:29:58 +00:00
2006-02-04 08:29:58 +00:00
2013-02-11 18:09:24 +00:00
2013-02-11 18:09:24 +00:00
2007-11-14 20:46:15 +00:00
2013-02-11 18:06:10 +00:00
2008-08-07 20:01:14 +00:00
2013-02-11 18:06:10 +00:00
2015-08-12 17:10:22 +01:00
2013-02-11 17:46:02 +00:00
2015-08-12 17:10:22 +01:00
2013-02-11 17:46:02 +00:00
2015-08-12 17:10:22 +01:00
2013-09-24 22:15:38 +00:00
2009-12-10 14:20:04 +00:00
2009-12-10 14:20:04 +00:00
2007-08-13 21:16:39 +00:00
2007-04-12 19:26:09 +00:00
2007-08-17 13:22:44 +00:00
2017-11-07 17:01:16 +10:30
2007-08-13 21:16:39 +00:00
2007-08-13 21:16:39 +00:00