summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRafael Espindola <rafael.espindola@gmail.com>2018-03-22 17:14:41 +0000
committerRafael Espindola <rafael.espindola@gmail.com>2018-03-22 17:14:41 +0000
commit78fad32d8341dde5ccfcbb7793316147ebddba85 (patch)
tree8649ee15844e5c0d7968b5eba43b026a27b78b47
parent236cdaf84c684a985fa501721bf99b93ce2614da (diff)
downloadbcm5719-llvm-78fad32d8341dde5ccfcbb7793316147ebddba85.tar.gz
bcm5719-llvm-78fad32d8341dde5ccfcbb7793316147ebddba85.zip
Make the debug info in some tests more realistic.
Currently lld just parses the .debug_line section assuming that there is only one compile unit. That assumption is false (PR36793). I have a patch that changes lld to iterate over the compile units and parse the portions of the .debug_line they point to (which fixes PR36793). A problem is that we will then need a compiler unit pointing to .debug_line for lld to see it. It seems like bfd has the same restriction. This patch updates existing tests to add a minimal compile unit so that they still work with PR36793 fixed. llvm-svn: 328215
-rw-r--r--lld/test/ELF/Inputs/conflict-debug.s21
-rw-r--r--lld/test/ELF/Inputs/undef-debug.s21
-rw-r--r--lld/test/ELF/compressed-debug-conflict.s21
-rw-r--r--lld/test/ELF/undef-broken-debug.test21
4 files changed, 84 insertions, 0 deletions
diff --git a/lld/test/ELF/Inputs/conflict-debug.s b/lld/test/ELF/Inputs/conflict-debug.s
index 03fb0133181..c38771efc20 100644
--- a/lld/test/ELF/Inputs/conflict-debug.s
+++ b/lld/test/ELF/Inputs/conflict-debug.s
@@ -3,3 +3,24 @@
.loc 1 4
zed:
nop
+
+ .section .debug_abbrev,"",@progbits
+ .byte 1 # Abbreviation Code
+ .byte 17 # DW_TAG_compile_unit
+ .byte 0 # DW_CHILDREN_no
+ .byte 16 # DW_AT_stmt_list
+ .byte 23 # DW_FORM_sec_offset
+ .byte 0 # EOM(1)
+ .byte 0 # EOM(2)
+ .byte 0 # EOM(3)
+
+ .section .debug_info,"",@progbits
+ .long .Lend0 - .Lbegin0 # Length of Unit
+.Lbegin0:
+ .short 4 # DWARF version number
+ .long .debug_abbrev # Offset Into Abbrev. Section
+ .byte 8 # Address Size (in bytes)
+ .byte 1 # Abbrev [1] 0xb:0x1f DW_TAG_compile_unit
+ .long .debug_line # DW_AT_stmt_list
+.Lend0:
+ .section .debug_line,"",@progbits
diff --git a/lld/test/ELF/Inputs/undef-debug.s b/lld/test/ELF/Inputs/undef-debug.s
index db8aaf16e6b..46c1c92d2b1 100644
--- a/lld/test/ELF/Inputs/undef-debug.s
+++ b/lld/test/ELF/Inputs/undef-debug.s
@@ -9,3 +9,24 @@
.section .text.2,"ax"
.loc 1 11
.quad zed5
+
+ .section .debug_abbrev,"",@progbits
+ .byte 1 # Abbreviation Code
+ .byte 17 # DW_TAG_compile_unit
+ .byte 0 # DW_CHILDREN_no
+ .byte 16 # DW_AT_stmt_list
+ .byte 23 # DW_FORM_sec_offset
+ .byte 0 # EOM(1)
+ .byte 0 # EOM(2)
+ .byte 0 # EOM(3)
+
+ .section .debug_info,"",@progbits
+ .long .Lend0 - .Lbegin0 # Length of Unit
+.Lbegin0:
+ .short 4 # DWARF version number
+ .long .debug_abbrev # Offset Into Abbrev. Section
+ .byte 8 # Address Size (in bytes)
+ .byte 1 # Abbrev [1] 0xb:0x1f DW_TAG_compile_unit
+ .long .debug_line # DW_AT_stmt_list
+.Lend0:
+ .section .debug_line,"",@progbits
diff --git a/lld/test/ELF/compressed-debug-conflict.s b/lld/test/ELF/compressed-debug-conflict.s
index 12430fa5217..e3ebc51e808 100644
--- a/lld/test/ELF/compressed-debug-conflict.s
+++ b/lld/test/ELF/compressed-debug-conflict.s
@@ -27,3 +27,24 @@ main:
xorl %eax, %eax
retl
.file 2 "/tmp/repeat/repeat/repeat/repeat" "repeat.h"
+
+ .section .debug_abbrev,"",@progbits
+ .byte 1 # Abbreviation Code
+ .byte 17 # DW_TAG_compile_unit
+ .byte 0 # DW_CHILDREN_no
+ .byte 16 # DW_AT_stmt_list
+ .byte 23 # DW_FORM_sec_offset
+ .byte 0 # EOM(1)
+ .byte 0 # EOM(2)
+ .byte 0 # EOM(3)
+
+ .section .debug_info,"",@progbits
+ .long .Lend0 - .Lbegin0 # Length of Unit
+.Lbegin0:
+ .short 4 # DWARF version number
+ .long .debug_abbrev # Offset Into Abbrev. Section
+ .byte 8 # Address Size (in bytes)
+ .byte 1 # Abbrev [1] 0xb:0x1f DW_TAG_compile_unit
+ .long .debug_line # DW_AT_stmt_list
+.Lend0:
+ .section .debug_line,"",@progbits
diff --git a/lld/test/ELF/undef-broken-debug.test b/lld/test/ELF/undef-broken-debug.test
index 1238ebe70ac..4a61bce3f24 100644
--- a/lld/test/ELF/undef-broken-debug.test
+++ b/lld/test/ELF/undef-broken-debug.test
@@ -40,6 +40,27 @@ Sections:
- Offset: 0x0000000000000029
Symbol: bar
Type: R_X86_64_64
+ - Name: .debug_info
+ Type: SHT_PROGBITS
+ AddressAlign: 0x0000000000000001
+ Content: 0C000000040000000000080100000000
+ - Name: .rela.debug_info
+ Type: SHT_RELA
+ Link: .symtab
+ AddressAlign: 0x0000000000000008
+ Info: .debug_info
+ Relocations:
+ - Offset: 0x0000000000000006
+ Symbol: .debug_abbrev
+ Type: R_X86_64_32
+ - Offset: 0x000000000000000C
+ Symbol: .debug_line
+ Type: R_X86_64_32
+ - Name: .debug_abbrev
+ Type: SHT_PROGBITS
+ AddressAlign: 0x0000000000000001
+ Content: '0111001017000000'
+
Symbols:
Global:
- Name: _start
OpenPOWER on IntegriCloud