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/testsuite | |
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/testsuite')
-rw-r--r-- | ld/testsuite/ChangeLog | 6 | ||||
-rw-r--r-- | ld/testsuite/ld-scripts/expr.exp | 1 | ||||
-rw-r--r-- | ld/testsuite/ld-scripts/pr14962-2.d | 10 | ||||
-rw-r--r-- | ld/testsuite/ld-scripts/pr14962-2.t | 11 |
4 files changed, 28 insertions, 0 deletions
diff --git a/ld/testsuite/ChangeLog b/ld/testsuite/ChangeLog index 8fbd375..4cfe40d 100644 --- a/ld/testsuite/ChangeLog +++ b/ld/testsuite/ChangeLog @@ -1,3 +1,9 @@ +2014-01-20 Alan Modra <amodra@gmail.com> + + * ld-scripts/pr14962-2.d, + * ld-scripts/pr14962-2.t: New test. + * ld-scripts/expr.exp: Run it. + 2014-01-15 Alan Modra <amodra@gmail.com> * ld-elf/ehdr_start-shared.d: New. diff --git a/ld/testsuite/ld-scripts/expr.exp b/ld/testsuite/ld-scripts/expr.exp index 0f92d97..ee8da7f 100644 --- a/ld/testsuite/ld-scripts/expr.exp +++ b/ld/testsuite/ld-scripts/expr.exp @@ -25,3 +25,4 @@ run_dump_test expr2 run_dump_test sane1 run_dump_test assign-loc run_dump_test pr14962 +run_dump_test pr14962-2 diff --git a/ld/testsuite/ld-scripts/pr14962-2.d b/ld/testsuite/ld-scripts/pr14962-2.d new file mode 100644 index 0000000..5e71433 --- /dev/null +++ b/ld/testsuite/ld-scripts/pr14962-2.d @@ -0,0 +1,10 @@ +#ld: -T pr14962-2.t +#source: pr14962a.s +#nm: -n +#notarget: rx-*-* frv-linux + +#... +0+2000 [AT] _start +#... +0+2000 A x +#pass diff --git a/ld/testsuite/ld-scripts/pr14962-2.t b/ld/testsuite/ld-scripts/pr14962-2.t new file mode 100644 index 0000000..f2c603b --- /dev/null +++ b/ld/testsuite/ld-scripts/pr14962-2.t @@ -0,0 +1,11 @@ +TOTO = 4096; +TOTO += 4096; + +SECTIONS +{ + .text TOTO : + { + x = ABSOLUTE(TOTO); + *(*.text) + } +} |