diff options
author | Nick Clifton <nickc@redhat.com> | 2017-10-23 18:16:49 +0100 |
---|---|---|
committer | Nick Clifton <nickc@redhat.com> | 2017-10-23 18:16:49 +0100 |
commit | 66cae56016a12f7cbdc94be6f82c1cad1c59b521 (patch) | |
tree | a89554827cf870a421e3af26f6b7d6c389abefe4 /ld/testsuite/ld-elf | |
parent | fe4e2a3c9281851c9da99a6e36a2bc96e4279476 (diff) | |
download | binutils-gdb-66cae56016a12f7cbdc94be6f82c1cad1c59b521.tar.gz |
Make sure that undefined symbols added to the linker command line via the -u option appear in the output executable, if they have not been resolved.
PR 22319
bfd * elflink.c (elf_link_output_extsym): Keep global undefined
symbols if they have been marked as needed.
ld * testsuite/ld-elf/pr22310.s: New test source file.
* testsuite/ld-elf/pr22310.d: New test driver.
* testsuite/ld-mmix/undef-3.d: Update expected output from readelf.
Diffstat (limited to 'ld/testsuite/ld-elf')
-rw-r--r-- | ld/testsuite/ld-elf/pr22319.d | 9 | ||||
-rw-r--r-- | ld/testsuite/ld-elf/pr22319.s | 2 |
2 files changed, 11 insertions, 0 deletions
diff --git a/ld/testsuite/ld-elf/pr22319.d b/ld/testsuite/ld-elf/pr22319.d new file mode 100644 index 00000000000..68a5706ee8c --- /dev/null +++ b/ld/testsuite/ld-elf/pr22319.d @@ -0,0 +1,9 @@ +#name: PR 22319 - required undefined symbols in output +#ld: -u undefined_symbol -e 0 +#nm: -u +#notarget: dlx-*-* +# The DLX target fails because it needs a special linker script to handle file symbols. + +[ ]+U+[ ]+undefined_symbol +#pass + diff --git a/ld/testsuite/ld-elf/pr22319.s b/ld/testsuite/ld-elf/pr22319.s new file mode 100644 index 00000000000..5a02e477708 --- /dev/null +++ b/ld/testsuite/ld-elf/pr22319.s @@ -0,0 +1,2 @@ + .data + .dc.b 0 |