+2016-09-01  H.J. Lu  <hongjiu.lu@intel.com>
+
+       PR ld/20513
+       * testsuite/ld-elf/pr20513a.d: New file.
+       * testsuite/ld-elf/pr20513a.s: Likewise.
+       * testsuite/ld-elf/pr20513b.d: Likewise.
+       * testsuite/ld-elf/pr20513b.s: Likewise.
+       * testsuite/ld-elf/pr20513c.d: Likewise.
+       * testsuite/ld-elf/pr20513d.d: Likewise.
+       * testsuite/ld-elf/pr20513e.d: Likewise.
+       * testsuite/ld-elf/pr20513f.d: Likewise.
+
 2016-08-31  Alan Modra  <amodra@gmail.com>
 
        PR 20513
 
--- /dev/null
+#source: pr20513a.s
+#source: pr20513b.s
+#ld:
+#readelf: -S --wide
+
+#failif
+#...
+[      ]*\[.*\][       ]+\..text\.exclude[     ]+.*
+#...
 
--- /dev/null
+       .section .text.startup,"ax","progbits"
+       .type start,"function"
+       .global start
+start:
+       .type _start,"function"
+       .global _start
+_start:
+       .type __start,"function"
+       .global __start
+__start:
+       .type main,"function"
+       .global main
+main:
+       .long 0
 
--- /dev/null
+#source: pr20513b.s
+#source: pr20513a.s
+#ld:
+#readelf: -S --wide
+
+#failif
+#...
+[      ]*\[.*\][       ]+\..text\.exclude[     ]+.*
+#...
 
--- /dev/null
+       .section .text.exclude,"axe","progbits"
+       .type start,"function"
+       .global start
+start:
+       .type _start,"function"
+       .global _start
+_start:
+       .type __start,"function"
+       .global __start
+__start:
+       .type main,"function"
+       .global main
+main:
+       .long 0
 
--- /dev/null
+#source: pr20513a.s
+#source: pr20513b.s
+#ld: -shared
+#readelf: -S --wide
+
+#failif
+#...
+[      ]*\[.*\][       ]+\..text\.exclude[     ]+.*
+#...
 
--- /dev/null
+#source: pr20513b.s
+#source: pr20513a.s
+#ld: -shared
+#readelf: -S --wide
+
+#failif
+#...
+[      ]*\[.*\][       ]+\..text\.exclude[     ]+.*
+#...
 
--- /dev/null
+#source: pr20513a.s
+#source: pr20513b.s
+#ld: -r
+#error: multiple definition of
 
--- /dev/null
+#source: pr20513b.s
+#source: pr20513a.s
+#ld: -r
+#error: multiple definition of