1 // RUN: llvm-mc -filetype=obj -triple x86_64-pc-linux-gnu %s -o - | elf-dump | FileCheck %s 2 3 // When doing a rename, all the checks for where the relocation should go 4 // should be performed with the original symbol. Only if we decide to relocate 5 // with the symbol we should then use the renamed one. 6 7 // This is a regression test for a bug where we used bar5@@@zed when deciding 8 // if we should relocate with the symbol or with the section and we would then 9 // not produce a relocation with .text. 10 11 defined1: 12 defined3: 13 .symver defined3, bar5@@@zed 14 .long defined3 15 16 .global defined1 17 18 // Section 1 is .text 19 // CHECK: # Section 1 20 // CHECK-NEXT: (('sh_name', 0x00000006) # '.text' 21 // CHECK-NEXT: ('sh_type', 0x00000001) 22 // CHECK-NEXT: ('sh_flags', 0x0000000000000006) 23 // CHECK-NEXT: ('sh_addr', 0x0000000000000000) 24 // CHECK-NEXT: ('sh_offset', 0x0000000000000040) 25 // CHECK-NEXT: ('sh_size', 0x0000000000000004) 26 // CHECK-NEXT: ('sh_link', 0x00000000) 27 // CHECK-NEXT: ('sh_info', 0x00000000) 28 // CHECK-NEXT: ('sh_addralign', 0x0000000000000004) 29 // CHECK-NEXT: ('sh_entsize', 0x0000000000000000) 30 31 // The relocation uses symbol 2 32 // CHECK: # Relocation 0 33 // CHECK-NEXT: (('r_offset', 0x0000000000000000) 34 // CHECK-NEXT: ('r_sym', 0x00000002) 35 // CHECK-NEXT: ('r_type', 0x0000000a) 36 // CHECK-NEXT: ('r_addend', 0x0000000000000000) 37 38 // Symbol 2 is section 1 39 // CHECK: # Symbol 2 40 // CHECK-NEXT: (('st_name', 0x00000000) # '' 41 // CHECK-NEXT: ('st_bind', 0x0) 42 // CHECK-NEXT: ('st_type', 0x3) 43 // CHECK-NEXT: ('st_other', 0x00) 44 // CHECK-NEXT: ('st_shndx', 0x0001) 45 // CHECK-NEXT: ('st_value', 0x0000000000000000) 46 // CHECK-NEXT: ('st_size', 0x0000000000000000) 47