blob: 36065603e784a87dd12d97ea7301cd920992b5ca [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
19// CHECK: # Section 0x00000001
20// CHECK-NEXT: (('sh_name', 0x00000001) # '.text'
21// 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
31// Symbol 2 is section 1
32// CHECK: # Symbol 0x00000002
33// CHECK-NEXT: (('st_name', 0x00000000) # ''
34// CHECK-NEXT: ('st_bind', 0x00000000)
35// CHECK-NEXT: ('st_type', 0x00000003)
36// CHECK-NEXT: ('st_other', 0x00000000)
37// CHECK-NEXT: ('st_shndx', 0x00000001)
Roman Divacky1ae3c162010-12-20 20:49:43 +000038// CHECK-NEXT: ('st_value', 0x0000000000000000)
39// CHECK-NEXT: ('st_size', 0x0000000000000000)
Rafael Espindola29129722010-10-28 19:08:03 +000040
41// The relocation uses symbol 2
42// CHECK: # Relocation 0x00000000
43// CHECK-NEXT: (('r_offset', 0x00000000)
44// CHECK-NEXT: ('r_sym', 0x00000002)
45// CHECK-NEXT: ('r_type', 0x0000000a)
46// CHECK-NEXT: ('r_addend', 0x00000000)