1// RUN: llvm-mc -g -triple i686-pc-linux-gnu %s -filetype=obj -o - | elf-dump | FileCheck %s 2 3 4// Test that on ELF the debug info has a relocation to debug_abbrev and one to 5// to debug_line. 6 7 8 .text 9 .globl foo 10 .type foo, @function 11 .align 4 12foo: 13 ret 14 .size foo, .-foo 15 16// Section 4 is .debug_line 17// CHECK: # Section 4 18// CHECK-NEXT: # '.debug_line' 19 20 21 22// The two relocations, one to symbol 6 and one to 4 23// CHECK: # '.rel.debug_info' 24// CHECK-NEXT: ('sh_type', 25// CHECK-NEXT: ('sh_flags' 26// CHECK-NEXT: ('sh_addr', 27// CHECK-NEXT: ('sh_offset', 28// CHECK-NEXT: ('sh_size', 29// CHECK-NEXT: ('sh_link', 30// CHECK-NEXT: ('sh_info', 31// CHECK-NEXT: ('sh_addralign', 32// CHECK-NEXT: ('sh_entsize', 33// CHECK-NEXT: ('_relocations', [ 34// CHECK-NEXT: # Relocation 0 35// CHECK-NEXT: (('r_offset', 0x00000006) 36// CHECK-NEXT: ('r_sym', 0x000006) 37// CHECK-NEXT: ('r_type', 0x01) 38// CHECK-NEXT: ), 39// CHECK-NEXT: # Relocation 1 40// CHECK-NEXT: (('r_offset', 0x0000000c) 41// CHECK-NEXT: ('r_sym', 0x000004) 42// CHECK-NEXT: ('r_type', 0x01) 43// CHECK-NEXT: ), 44 45 46// Section 8 is .debug_abbrev 47// CHECK: # Section 8 48// CHECK-NEXT: (('sh_name', 0x00000001) # '.debug_abbrev' 49 50// Symbol 4 is section 4 (.debug_line) 51// CHECK: # Symbol 4 52// CHECK-NEXT: (('st_name', 0x00000000) # '' 53// CHECK-NEXT: ('st_value', 0x00000000) 54// CHECK-NEXT: ('st_size', 0x00000000) 55// CHECK-NEXT: ('st_bind', 0x0) 56// CHECK-NEXT: ('st_type', 0x3) 57// CHECK-NEXT: ('st_other', 0x00) 58// CHECK-NEXT: ('st_shndx', 0x0004) 59// CHECK-NEXT: ), 60 61// Symbol 6 is section 8 (.debug_abbrev) 62// CHECK: # Symbol 6 63// CHECK-NEXT: (('st_name', 0x00000000) # '' 64// CHECK-NEXT: ('st_value', 0x00000000) 65// CHECK-NEXT: ('st_size', 0x00000000) 66// CHECK-NEXT: ('st_bind', 0x0) 67// CHECK-NEXT: ('st_type', 0x3) 68// CHECK-NEXT: ('st_other', 0x00) 69// CHECK-NEXT: ('st_shndx', 0x0008) 70// CHECK-NEXT: ), 71