-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.
+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
#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 .*
.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
.globl t.c.4903c230
t.c.4903c230:
.byte 0x28
-
- .section .debug_line,"",%progbits
- .byte 0
.globl t.c.4903c231
t.c.4903c231:
.byte 0x29
-
- .section .debug_line,"",%progbits
- .byte 0