diff options
Diffstat (limited to 'test/old-elf/X86_64/debug.test')
-rw-r--r-- | test/old-elf/X86_64/debug.test | 57 |
1 files changed, 57 insertions, 0 deletions
diff --git a/test/old-elf/X86_64/debug.test b/test/old-elf/X86_64/debug.test new file mode 100644 index 000000000000..26ba367da574 --- /dev/null +++ b/test/old-elf/X86_64/debug.test @@ -0,0 +1,57 @@ +# Test that debug info is assigned typeNoAlloc and that the output sections have +# a virtual address of 0. +RUN: lld -flavor old-gnu -target x86_64 -e main --output-filetype=yaml \ +RUN: %p/Inputs/debug0.x86-64 %p/Inputs/debug1.x86-64 -o %t +RUN: FileCheck %s -check-prefix YAML < %t + +RUN: lld -flavor old-gnu -target x86_64 -e main %p/Inputs/debug0.x86-64 \ +RUN: %p/Inputs/debug1.x86-64 -o %t1 +RUN: llvm-readobj -sections %t1 | FileCheck %s -check-prefix ELF +# Verify that non SHF_ALLOC sections are relocated correctly. +RUN: llvm-objdump -s %t1 | FileCheck %s -check-prefix RELOC + +YAML: type: no-alloc + +ELF: Section { +ELF: Name: .debug_info +ELF: Type: SHT_PROGBITS (0x1) +ELF: Flags [ (0x0) +ELF: ] +ELF: Address: 0x0 +ELF: } +ELF: Section { +ELF: Name: .debug_abbrev +ELF: Type: SHT_PROGBITS (0x1) +ELF: Flags [ (0x0) +ELF: ] +ELF: Address: 0x0 +ELF: } +ELF: Section { +ELF: Name: .debug_aranges +ELF: Type: SHT_PROGBITS (0x1) +ELF: Flags [ (0x0) +ELF: ] +ELF: Address: 0x0 +ELF: } +ELF: Section { +ELF: Name: .debug_line +ELF: Type: SHT_PROGBITS (0x1) +ELF: Flags [ (0x0) +ELF: ] +ELF: Address: 0x0 +ELF: } +ELF: Section { +ELF: Name: .debug_str +ELF: Type: SHT_PROGBITS (0x1) +ELF: Flags [ (0x0) +ELF: ] +ELF: Address: 0x0 +ELF: } + +RELOC: Contents of section .debug_info: +RELOC: 0000 4e000000 04000000 00000801 3a000000 N...........:... +# ^^ Relocation: ._debug_str + 0x3a +RELOC: 0010 01780000 00000000 00dc0140 00000000 .x.........@.... +# ^^ Relocation: .debug_str + 0x78 +RELOC: 0020 00100000 00000000 00000000 00028100 ................ +# ^^ Relocation: .debug_str + 0x81 |