Re: ld: Lookup section in output with the same name
authorAlan Modra <amodra@gmail.com>
Mon, 3 Sep 2018 01:19:57 +0000 (10:49 +0930)
committerAlan Modra <amodra@gmail.com>
Mon, 3 Sep 2018 03:24:35 +0000 (12:54 +0930)
Fixes pr23591 test failures on hppa64-hpux and score-elf, and xfails
frv-linux and lm32-linux.

PR ld/23591
* testsuite/ld-elf/pr23591a.s,
* testsuite/ld-elf/pr23591b.s,
* testsuite/ld-elf/pr23591c.s: Don't start directives in first column.
* testsuite/ld-elf/pr23591.d: xfail frv-linux and lm32-linux.
Allow __start___sancov_cntrs as a local symbol.

ld/ChangeLog
ld/testsuite/ld-elf/pr23591.d
ld/testsuite/ld-elf/pr23591a.s
ld/testsuite/ld-elf/pr23591b.s
ld/testsuite/ld-elf/pr23591c.s

index 8736047b4ad69f540436f7d988b162a1eee2c04d..486aa261a500537467d62d82816c5c0106642571 100644 (file)
@@ -1,3 +1,12 @@
+2018-09-03  Alan Modra  <amodra@gmail.com>
+
+       PR ld/23591
+       * testsuite/ld-elf/pr23591a.s,
+       * testsuite/ld-elf/pr23591b.s,
+       * testsuite/ld-elf/pr23591c.s: Don't start directives in first column.
+       * testsuite/ld-elf/pr23591.d: xfail frv-linux and lm32-linux.
+       Allow __start___sancov_cntrs as a local symbol.
+
 018-08-31  H.J. Lu  <hongjiu.lu@intel.com>
 
        PR ld/23591
index e002d73044e3c376c133fd4cca9936c39072a317..e5a747532400f15a854de2892133d60e446f9928 100644 (file)
@@ -3,7 +3,10 @@
 #source: pr23591c.s
 #ld: -e _start
 #readelf: -sW
+#xfail: frv-*-linux* lm32-*-linux*
+# frv-linux and lm32-linux fail with complaints about emitting dynamic
+# relocations in read-only sections.
 
 #...
- +[0-9]+: +[a-f0-9]+ +0 +NOTYPE +GLOBAL +HIDDEN +[0-9]+ +___?start___sancov_cntrs
+ +[0-9]+: +[a-f0-9]+ +0 +NOTYPE +(GLOBAL +HIDDEN|LOCAL +DEFAULT) +[0-9]+ +___?start___sancov_cntrs
 #pass
index ebdb7f8abb6c6a60ad42ae65ca5f66f1751a4537..7616b131cde8180ed1972ab33fe4345720ac266b 100644 (file)
@@ -1,14 +1,14 @@
-.ifdef UNDERSCORE
+ .ifdef UNDERSCORE
        .hidden ___start___sancov_cntrs
-.else
+ .else
        .hidden __start___sancov_cntrs
-.endif
+ .endif
        .text
        .globl  _start
        .type   _start, %function
 _start:
-.ifdef UNDERSCORE
+ .ifdef UNDERSCORE
        .dc.a   ___start___sancov_cntrs
-.else
+ .else
        .dc.a   __start___sancov_cntrs
-.endif
+ .endif
index 646e681cc52d7c8e0ef58eef9a4e14687bcac88b..4ab48fb4bb37aa7ed71eb8b6e83aa85beea621af 100644 (file)
@@ -1,11 +1,11 @@
        .section .text,"axG",%progbits,foo1,comdat
-.ifdef UNDERSCORE
+ .ifdef UNDERSCORE
        .globl _foo1
        .type _foo1, %function
 _foo1:
-.else
+ .else
        .globl foo1
        .type foo1, %function
 foo1:
-.endif
+ .endif
        .byte 0
index 338671ceb7244a13c4c0926430d3b57b8bbd8331..695b218ad0c82c99ed490e4fb9bdbd05fa853b29 100644 (file)
@@ -1,26 +1,26 @@
        .section        __sancov_cntrs,"aG",%progbits,foo1,comdat
        .long 0
        .section .text,"axG",%progbits,foo1,comdat
-.ifdef UNDERSCORE
+ .ifdef UNDERSCORE
        .globl _foo1
        .type _foo1, %function
 _foo1:
-.else
+ .else
        .globl foo1
        .type foo1, %function
 foo1:
-.endif
+ .endif
        .long 0
        .section        __sancov_cntrs,"aG",%progbits,foo2,comdat
        .long 1
        .section .text,"axG",%progbits,foo2,comdat
-.ifdef UNDERSCORE
+ .ifdef UNDERSCORE
        .globl _foo2
        .type _foo2, %function
 _foo2:
        .long 1
-.else
+ .else
        .globl foo2
        .type foo2, %function
 foo2:
-.endif
+ .endif