blob: f85f410da8860f731c0e4d0fdec0aed4779bcee7 [file] [log] [blame]
Rafael Espindola29129722010-10-28 19:08:03 +00001// 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
11defined1:
12defined3:
13 .symver defined3, bar5@@@zed
14 .long defined3
15
16 .global defined1
17
18// Section 1 is .text
Rafael Espindola014180d2011-08-04 13:39:15 +000019// CHECK: # Section 1
Rafael Espindola9974b8b2011-04-07 23:51:25 +000020// CHECK-NEXT: (('sh_name', 0x00000006) # '.text'
Rafael Espindola29129722010-10-28 19:08:03 +000021// CHECK-NEXT: ('sh_type', 0x00000001)
22// CHECK-NEXT: ('sh_flags', 0x00000006)
23// CHECK-NEXT: ('sh_addr', 0x00000000)
24// CHECK-NEXT: ('sh_offset', 0x00000040)
25// CHECK-NEXT: ('sh_size', 0x00000004)
26// CHECK-NEXT: ('sh_link', 0x00000000)
27// CHECK-NEXT: ('sh_info', 0x00000000)
28// CHECK-NEXT: ('sh_addralign', 0x00000004)
29// CHECK-NEXT: ('sh_entsize', 0x00000000)
30
Rafael Espindola7c18fa82011-03-20 18:44:20 +000031// The relocation uses symbol 2
Rafael Espindolaf7179de2011-08-04 14:01:03 +000032// CHECK: # Relocation 0
Rafael Espindola7c18fa82011-03-20 18:44:20 +000033// CHECK-NEXT: (('r_offset', 0x00000000)
34// CHECK-NEXT: ('r_sym', 0x00000002)
35// CHECK-NEXT: ('r_type', 0x0000000a)
Rafael Espindolad7c9b632011-08-04 13:00:24 +000036// CHECK-NEXT: ('r_addend', 0x0000000000000000)
Rafael Espindola7c18fa82011-03-20 18:44:20 +000037
Rafael Espindola29129722010-10-28 19:08:03 +000038// Symbol 2 is section 1
Rafael Espindola65ad8dc2011-08-04 14:27:46 +000039// CHECK: # Symbol 2
Rafael Espindola29129722010-10-28 19:08:03 +000040// CHECK-NEXT: (('st_name', 0x00000000) # ''
Rafael Espindolad7c27832011-08-04 15:10:35 +000041// CHECK-NEXT: ('st_bind', 0x0)
Rafael Espindola29129722010-10-28 19:08:03 +000042// CHECK-NEXT: ('st_type', 0x00000003)
43// CHECK-NEXT: ('st_other', 0x00000000)
44// CHECK-NEXT: ('st_shndx', 0x00000001)
Roman Divacky1ae3c162010-12-20 20:49:43 +000045// CHECK-NEXT: ('st_value', 0x0000000000000000)
46// CHECK-NEXT: ('st_size', 0x0000000000000000)