From 4d1c6335455aeeda9de8a5eb58998f919ea35a1e Mon Sep 17 00:00:00 2001 From: "H.J. Lu" Date: Fri, 31 Aug 2018 09:25:31 -0700 Subject: ld: Lookup section in output with the same name When there are more than one input sections with the same section name, SECNAME, linker picks the first one to define __start_SECNAME and __stop_SECNAME symbols. When the first input section is removed by comdat group, we need to check if there is still an output section with section name SECNAME. PR ld/23591 * ldlang.c (undef_start_stop): Lookup section in output with the same name. * testsuite/ld-elf/pr23591.d: New file. * testsuite/ld-elf/pr23591a.s: Likewise. * testsuite/ld-elf/pr23591b.s: Likewise. * testsuite/ld-elf/pr23591c.s: Likewise. --- ld/testsuite/ld-elf/pr23591.d | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 ld/testsuite/ld-elf/pr23591.d (limited to 'ld/testsuite/ld-elf/pr23591.d') diff --git a/ld/testsuite/ld-elf/pr23591.d b/ld/testsuite/ld-elf/pr23591.d new file mode 100644 index 0000000..e002d73 --- /dev/null +++ b/ld/testsuite/ld-elf/pr23591.d @@ -0,0 +1,9 @@ +#source: pr23591a.s +#source: pr23591b.s +#source: pr23591c.s +#ld: -e _start +#readelf: -sW + +#... + +[0-9]+: +[a-f0-9]+ +0 +NOTYPE +GLOBAL +HIDDEN +[0-9]+ +___?start___sancov_cntrs +#pass -- cgit v1.1