diff options
author | Alan Modra <amodra@gmail.com> | 2014-01-20 21:28:42 +1030 |
---|---|---|
committer | Alan Modra <amodra@gmail.com> | 2014-01-20 21:28:42 +1030 |
commit | fa72205cb90527fd34753203993859907a53ead2 (patch) | |
tree | 287b960405c90fec23679e85d9a8688e8d5dec17 /ld/ldlang.h | |
parent | 24ef1aa73ed312282bd1a755b3ac94681c9f1544 (diff) | |
download | gdb-fa72205cb90527fd34753203993859907a53ead2.zip gdb-fa72205cb90527fd34753203993859907a53ead2.tar.gz gdb-fa72205cb90527fd34753203993859907a53ead2.tar.bz2 |
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.
Diffstat (limited to 'ld/ldlang.h')
-rw-r--r-- | ld/ldlang.h | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/ld/ldlang.h b/ld/ldlang.h index e91153c..8c815c6 100644 --- a/ld/ldlang.h +++ b/ld/ldlang.h @@ -465,7 +465,9 @@ struct unique_sections struct lang_definedness_hash_entry { struct bfd_hash_entry root; - int iteration; + unsigned int by_object : 1; + unsigned int by_script : 1; + unsigned int iteration : 1; }; /* Used by place_orphan to keep track of orphan sections and statements. */ @@ -658,8 +660,7 @@ extern void lang_add_unique (const char *); extern const char *lang_get_output_target (void); -extern void lang_track_definedness (const char *); -extern int lang_symbol_definition_iteration (const char *); +extern struct lang_definedness_hash_entry *lang_symbol_defined (const char *); extern void lang_update_definedness (const char *, struct bfd_link_hash_entry *); |