Allow self-assignment for absolute symbols defined in a linker script
authorAlan Modra <amodra@gmail.com>
Mon, 20 Jan 2014 10:58:42 +0000 (21:28 +1030)
committerAlan Modra <amodra@gmail.com>
Mon, 20 Jan 2014 10:58:42 +0000 (21:28 +1030)
commitfa72205cb90527fd34753203993859907a53ead2
tree287b960405c90fec23679e85d9a8688e8d5dec17
parent24ef1aa73ed312282bd1a755b3ac94681c9f1544
Allow self-assignment for absolute symbols defined in a linker script

Modifies ld machinery tracking linker script assignments to notice all
assignments, not just those symbols mentioned in DEFINED().

ld/
PR ld/14962
* ldlang.h (struct lang_definedness_hash_entry): Add by_object and
by_script.  Make iteration a single bit field.
(lang_track_definedness, lang_symbol_definition_iteration): Delete.
(lang_symbol_defined): Declare.
* ldlang.c (lang_statement_iteration): Expand comment a little.
(lang_init <lang_definedness_table>): Make it bigger.
(lang_track_definedness, lang_symbol_definition): Delete.
(lang_definedness_newfunc): Update.
(lang_symbol_defined): New function.
(lang_update_definedness): Create entries here.  Do track whether
script definition of symbol is valid, even when also defined in
an object file.
* ldexp.c (fold_name <DEFINED>): Update.
(fold_name <NAME>): Allow self-assignment for absolute symbols
defined in a linker script.
ld/testsuite/
* ld-scripts/pr14962-2.d,
* ld-scripts/pr14962-2.t: New test.
* ld-scripts/expr.exp: Run it.
ld/ChangeLog
ld/ldexp.c
ld/ldlang.c
ld/ldlang.h
ld/testsuite/ChangeLog
ld/testsuite/ld-scripts/expr.exp
ld/testsuite/ld-scripts/pr14962-2.d [new file with mode: 0644]
ld/testsuite/ld-scripts/pr14962-2.t [new file with mode: 0644]