diff options
author | Alan Modra <amodra@gmail.com> | 2014-12-22 10:49:23 +1030 |
---|---|---|
committer | Alan Modra <amodra@gmail.com> | 2014-12-23 23:36:50 +1030 |
commit | 4cc2bf08a4e18aa2009e9d4f1694a800eacbee17 (patch) | |
tree | 8f4ddd987d28c687603ba418ad9129c105313c03 /ld/testsuite | |
parent | cd8e2bcf0d51e91ab8da72ec63048790e3720b03 (diff) | |
download | binutils-4cc2bf08a4e18aa2009e9d4f1694a800eacbee17.zip binutils-4cc2bf08a4e18aa2009e9d4f1694a800eacbee17.tar.gz binutils-4cc2bf08a4e18aa2009e9d4f1694a800eacbee17.tar.bz2 |
Don't PROVIDE over top of common symbols
This:
int end[100000];
int main(void) { end[99999] = 0; return 0; }
should not segfault.
ld/
* ldexp.c (exp_fold_tree_1 <etree_provide>): Leave bfd_link_hash_common
symbols alone.
ld/testsuite/
* ld-elf/endsym.s, *ld-elf/endsym.d: New test.
Diffstat (limited to 'ld/testsuite')
-rw-r--r-- | ld/testsuite/ChangeLog | 4 | ||||
-rw-r--r-- | ld/testsuite/ld-elf/endsym.d | 13 | ||||
-rw-r--r-- | ld/testsuite/ld-elf/endsym.s | 2 |
3 files changed, 19 insertions, 0 deletions
diff --git a/ld/testsuite/ChangeLog b/ld/testsuite/ChangeLog index 9607a15..c901bb7 100644 --- a/ld/testsuite/ChangeLog +++ b/ld/testsuite/ChangeLog @@ -1,3 +1,7 @@ +2014-12-23 Alan Modra <amodra@gmail.com> + + * ld-elf/endsym.s, *ld-elf/endsym.d: New test. + 2014-12-19 Matthew Fortune <matthew.fortune@imgtec.com> * ld-mips-elf/attr-gnu-4-00.d: Relax check for ISA extension. diff --git a/ld/testsuite/ld-elf/endsym.d b/ld/testsuite/ld-elf/endsym.d new file mode 100644 index 0000000..912d3de --- /dev/null +++ b/ld/testsuite/ld-elf/endsym.d @@ -0,0 +1,13 @@ +#source: start.s +#source: endsym.s +#ld: --sort-common +#nm: -n +#notarget: hppa*-*-hpux* + +#... +.* end +#... +.* end2 +#... +.* _?_end +#pass diff --git a/ld/testsuite/ld-elf/endsym.s b/ld/testsuite/ld-elf/endsym.s new file mode 100644 index 0000000..5255c04 --- /dev/null +++ b/ld/testsuite/ld-elf/endsym.s @@ -0,0 +1,2 @@ + .comm end,4,4 + .comm end2,2,2 |