pr20882 testcase
authorAlan Modra <amodra@gmail.com>
Thu, 18 May 2017 04:58:17 +0000 (14:28 +0930)
committerAlan Modra <amodra@gmail.com>
Thu, 18 May 2017 04:58:17 +0000 (14:28 +0930)
-gdwarf-sections doesn't work on targets that lack support to emit
address size relative relocs.  The testcase as it was avoided
-gdwarf-sections doing anything by providing a non-empty .debug_line.
It's better to not use -gdwarf-sections.  Also, the testcase failed
to match the output for 16-bit address targets like avr.

PR ld/20882
* testsuite/ld-gc/pr20882.d: Don't pass -gdwarf-sections to gas.
Allow for 16-bit address targets and match expected data fully.
* testsuite/ld-gc/pr20882a.s: Delete .debug_line section.
* testsuite/ld-gc/pr20882b.s: Likewise.
* testsuite/ld-gc/pr20882c.s: Likewise.

ld/ChangeLog
ld/testsuite/ld-gc/pr20882.d
ld/testsuite/ld-gc/pr20882a.s
ld/testsuite/ld-gc/pr20882b.s
ld/testsuite/ld-gc/pr20882c.s

index b71bc16273cc78a69edd380929b131c6fec6d8ad..c5892d17f7769f3e2796ba4c7f1374e161de7b0c 100644 (file)
@@ -1,3 +1,12 @@
+2017-05-18  Alan Modra  <amodra@gmail.com>
+
+       PR ld/20882
+       * testsuite/ld-gc/pr20882.d: Don't pass -gdwarf-sections to gas.
+       Allow for 16-bit address targets and match expected data fully.
+       * testsuite/ld-gc/pr20882a.s: Delete .debug_line section.
+       * testsuite/ld-gc/pr20882b.s: Likewise.
+       * testsuite/ld-gc/pr20882c.s: Likewise.
+
 2017-05-17  H.J. Lu  <hongjiu.lu@intel.com>
 
        PR ld/20882
index 55fa1414109d1339a4b7471e9bc00b104e54180e..dd388c51c960aed06f5b1db6c41087dce09b2896 100644 (file)
@@ -2,9 +2,8 @@
 #source: pr20882a.s
 #source: pr20882b.s
 #source: pr20882c.s
-#as: -gdwarf-sections
 #ld: --gc-sections -e main
 #readelf: -x .debug_info
 
 #...
- +0x0+ [0-9a-f ]+ 28 +.+\(
+  0x0+ (0a000000 00000000 |00000000 0000000a |06000000 |00000006 |0400|0004)28 .*
index 3348ba9ecef3e166ee3211bb3388b8cfa8893cc2..aad12e89b33ff86e18b2cd01570522cf4c089a80 100644 (file)
@@ -1,11 +1,8 @@
        .text
-       .globl  main
-       .type   main, %function
+       .globl  main
+       .type   main, %function
 main:
        .byte 0
 
        .section .debug_info,"",%progbits
        .dc.a  t.c.4903c230+2
-
-       .section .debug_line,"",%progbits
-       .byte 0
index fed521cc2a1f364de1bf7630a86a068a3a48bbe0..ea0cf2e4adad95812587ea0afae05f5ef991577f 100644 (file)
@@ -3,6 +3,3 @@
        .globl t.c.4903c230
 t.c.4903c230:
        .byte 0x28
-
-       .section .debug_line,"",%progbits
-       .byte 0
index a77edad25495e0127b54b82eadb0d14011d34c81..44d27349c4c9b9e48a15a1ac6ddf71f80779a6e0 100644 (file)
@@ -3,6 +3,3 @@
        .globl t.c.4903c231
 t.c.4903c231:
        .byte   0x29
-
-       .section .debug_line,"",%progbits
-       .byte 0