1// RUN: llvm-mc -filetype=obj -triple x86_64-pc-linux-gnu %s -o - | elf-dump | FileCheck %s 2 3// This is a long test that checks that the aliases created by weakref are 4// never in the symbol table and that the only case it causes a symbol to 5// be output as a weak undefined symbol is if that variable is not defined 6// in this file and all the references to it are done via the alias. 7 8 .weakref foo1, bar1 9 10 .weakref foo2, bar2 11 .long bar2 12 13 .weakref foo3, bar3 14 .long foo3 15 16 .weakref foo4, bar4 17 .long foo4 18 .long bar4 19 20 .weakref foo5, bar5 21 .long bar5 22 .long foo5 23 24bar6: 25 .weakref foo6, bar6 26 27bar7: 28 .weakref foo7, bar7 29 .long bar7 30 31bar8: 32 .weakref foo8, bar8 33 .long foo8 34 35bar9: 36 .weakref foo9, bar9 37 .long foo9 38 .long bar9 39 40bar10: 41 .global bar10 42 .weakref foo10, bar10 43 .long bar10 44 .long foo10 45 46bar11: 47 .global bar11 48 .weakref foo11, bar11 49 50bar12: 51 .global bar12 52 .weakref foo12, bar12 53 .long bar12 54 55bar13: 56 .global bar13 57 .weakref foo13, bar13 58 .long foo13 59 60bar14: 61 .global bar14 62 .weakref foo14, bar14 63 .long foo14 64 .long bar14 65 66bar15: 67 .global bar15 68 .weakref foo15, bar15 69 .long bar15 70 .long foo15 71 72// CHECK: # Symbol 0 73// CHECK-NEXT: (('st_name', 0x00000000) # '' 74// CHECK-NEXT: ('st_bind', 0x0) 75// CHECK-NEXT: ('st_type', 0x0) 76// CHECK-NEXT: ('st_other', 0x00) 77// CHECK-NEXT: ('st_shndx', 0x0000) 78// CHECK-NEXT: ('st_value', 0x0000000000000000) 79// CHECK-NEXT: ('st_size', 0x0000000000000000) 80// CHECK-NEXT: ), 81// CHECK-NEXT: # Symbol 1 82// CHECK-NEXT: (('st_name', 0x00000015) # 'bar6' 83// CHECK-NEXT: ('st_bind', 0x0) 84// CHECK-NEXT: ('st_type', 0x0) 85// CHECK-NEXT: ('st_other', 0x00) 86// CHECK-NEXT: ('st_shndx', 0x0001) 87// CHECK-NEXT: ('st_value', 0x0000000000000018) 88// CHECK-NEXT: ('st_size', 0x0000000000000000) 89// CHECK-NEXT: ), 90// CHECK-NEXT: # Symbol 2 91// CHECK-NEXT: (('st_name', 0x0000001a) # 'bar7' 92// CHECK-NEXT: ('st_bind', 0x0) 93// CHECK-NEXT: ('st_type', 0x0) 94// CHECK-NEXT: ('st_other', 0x00) 95// CHECK-NEXT: ('st_shndx', 0x0001) 96// CHECK-NEXT: ('st_value', 0x0000000000000018) 97// CHECK-NEXT: ('st_size', 0x0000000000000000) 98// CHECK-NEXT: ), 99// CHECK-NEXT: # Symbol 3 100// CHECK-NEXT: (('st_name', 0x0000001f) # 'bar8' 101// CHECK-NEXT: ('st_bind', 0x0) 102// CHECK-NEXT: ('st_type', 0x0) 103// CHECK-NEXT: ('st_other', 0x00) 104// CHECK-NEXT: ('st_shndx', 0x0001) 105// CHECK-NEXT: ('st_value', 0x000000000000001c) 106// CHECK-NEXT: ('st_size', 0x0000000000000000) 107// CHECK-NEXT: ), 108// CHECK-NEXT: # Symbol 4 109// CHECK-NEXT: (('st_name', 0x00000024) # 'bar9' 110// CHECK-NEXT: ('st_bind', 0x0) 111// CHECK-NEXT: ('st_type', 0x0) 112// CHECK-NEXT: ('st_other', 0x00) 113// CHECK-NEXT: ('st_shndx', 0x0001) 114// CHECK-NEXT: ('st_value', 0x0000000000000020) 115// CHECK-NEXT: ('st_size', 0x0000000000000000) 116// CHECK-NEXT: ), 117// CHECK-NEXT: # Symbol 5 118// CHECK-NEXT: (('st_name', 0x00000000) # '' 119// CHECK-NEXT: ('st_bind', 0x0) 120// CHECK-NEXT: ('st_type', 0x3) 121// CHECK-NEXT: ('st_other', 0x00) 122// CHECK-NEXT: ('st_shndx', 0x0001) 123// CHECK-NEXT: ('st_value', 0x0000000000000000) 124// CHECK-NEXT: ('st_size', 0x0000000000000000) 125// CHECK-NEXT: ), 126// CHECK-NEXT: # Symbol 6 127// CHECK-NEXT: (('st_name', 0x00000000) # '' 128// CHECK-NEXT: ('st_bind', 0x0) 129// CHECK-NEXT: ('st_type', 0x3) 130// CHECK-NEXT: ('st_other', 0x00) 131// CHECK-NEXT: ('st_shndx', 0x0003) 132// CHECK-NEXT: ('st_value', 0x0000000000000000) 133// CHECK-NEXT: ('st_size', 0x0000000000000000) 134// CHECK-NEXT: ), 135// CHECK-NEXT: # Symbol 7 136// CHECK-NEXT: (('st_name', 0x00000000) # '' 137// CHECK-NEXT: ('st_bind', 0x0) 138// CHECK-NEXT: ('st_type', 0x3) 139// CHECK-NEXT: ('st_other', 0x00) 140// CHECK-NEXT: ('st_shndx', 0x0004) 141// CHECK-NEXT: ('st_value', 0x0000000000000000) 142// CHECK-NEXT: ('st_size', 0x0000000000000000) 143// CHECK-NEXT: ), 144// CHECK-NEXT: # Symbol 8 145// CHECK-NEXT: (('st_name', 0x00000029) # 'bar10' 146// CHECK-NEXT: ('st_bind', 0x1) 147// CHECK-NEXT: ('st_type', 0x0) 148// CHECK-NEXT: ('st_other', 0x00) 149// CHECK-NEXT: ('st_shndx', 0x0001) 150// CHECK-NEXT: ('st_value', 0x0000000000000028) 151// CHECK-NEXT: ('st_size', 0x0000000000000000) 152// CHECK-NEXT: ), 153// CHECK-NEXT: # Symbol 9 154// CHECK-NEXT: (('st_name', 0x0000002f) # 'bar11' 155// CHECK-NEXT: ('st_bind', 0x1) 156// CHECK-NEXT: ('st_type', 0x0) 157// CHECK-NEXT: ('st_other', 0x00) 158// CHECK-NEXT: ('st_shndx', 0x0001) 159// CHECK-NEXT: ('st_value', 0x0000000000000030) 160// CHECK-NEXT: ('st_size', 0x0000000000000000) 161// CHECK-NEXT: ), 162// CHECK-NEXT: # Symbol 10 163// CHECK-NEXT: (('st_name', 0x00000035) # 'bar12' 164// CHECK-NEXT: ('st_bind', 0x1) 165// CHECK-NEXT: ('st_type', 0x0) 166// CHECK-NEXT: ('st_other', 0x00) 167// CHECK-NEXT: ('st_shndx', 0x0001) 168// CHECK-NEXT: ('st_value', 0x0000000000000030) 169// CHECK-NEXT: ('st_size', 0x0000000000000000) 170// CHECK-NEXT: ), 171// CHECK-NEXT: # Symbol 11 172// CHECK-NEXT: (('st_name', 0x0000003b) # 'bar13' 173// CHECK-NEXT: ('st_bind', 0x1) 174// CHECK-NEXT: ('st_type', 0x0) 175// CHECK-NEXT: ('st_other', 0x00) 176// CHECK-NEXT: ('st_shndx', 0x0001) 177// CHECK-NEXT: ('st_value', 0x0000000000000034) 178// CHECK-NEXT: ('st_size', 0x0000000000000000) 179// CHECK-NEXT: ), 180// CHECK-NEXT: # Symbol 12 181// CHECK-NEXT: (('st_name', 0x00000041) # 'bar14' 182// CHECK-NEXT: ('st_bind', 0x1) 183// CHECK-NEXT: ('st_type', 0x0) 184// CHECK-NEXT: ('st_other', 0x00) 185// CHECK-NEXT: ('st_shndx', 0x0001) 186// CHECK-NEXT: ('st_value', 0x0000000000000038) 187// CHECK-NEXT: ('st_size', 0x0000000000000000) 188// CHECK-NEXT: ), 189// CHECK-NEXT: # Symbol 13 190// CHECK-NEXT: (('st_name', 0x00000047) # 'bar15' 191// CHECK-NEXT: ('st_bind', 0x1) 192// CHECK-NEXT: ('st_type', 0x0) 193// CHECK-NEXT: ('st_other', 0x00) 194// CHECK-NEXT: ('st_shndx', 0x0001) 195// CHECK-NEXT: ('st_value', 0x0000000000000040) 196// CHECK-NEXT: ('st_size', 0x0000000000000000) 197// CHECK-NEXT: ), 198// CHECK-NEXT: # Symbol 14 199// CHECK-NEXT: (('st_name', 0x00000001) # 'bar2' 200// CHECK-NEXT: ('st_bind', 0x1) 201// CHECK-NEXT: ('st_type', 0x0) 202// CHECK-NEXT: ('st_other', 0x00) 203// CHECK-NEXT: ('st_shndx', 0x0000) 204// CHECK-NEXT: ('st_value', 0x0000000000000000) 205// CHECK-NEXT: ('st_size', 0x0000000000000000) 206// CHECK-NEXT: ), 207// CHECK-NEXT: # Symbol 15 208// CHECK-NEXT: (('st_name', 0x00000006) # 'bar3' 209// CHECK-NEXT: ('st_bind', 0x2) 210// CHECK-NEXT: ('st_type', 0x0) 211// CHECK-NEXT: ('st_other', 0x00) 212// CHECK-NEXT: ('st_shndx', 0x0000) 213// CHECK-NEXT: ('st_value', 0x0000000000000000) 214// CHECK-NEXT: ('st_size', 0x0000000000000000) 215// CHECK-NEXT: ), 216// CHECK-NEXT: # Symbol 16 217// CHECK-NEXT: (('st_name', 0x0000000b) # 'bar4' 218// CHECK-NEXT: ('st_bind', 0x1) 219// CHECK-NEXT: ('st_type', 0x0) 220// CHECK-NEXT: ('st_other', 0x00) 221// CHECK-NEXT: ('st_shndx', 0x0000) 222// CHECK-NEXT: ('st_value', 0x0000000000000000) 223// CHECK-NEXT: ('st_size', 0x0000000000000000) 224// CHECK-NEXT: ), 225// CHECK-NEXT: # Symbol 17 226// CHECK-NEXT: (('st_name', 0x00000010) # 'bar5' 227// CHECK-NEXT: ('st_bind', 0x1) 228// CHECK-NEXT: ('st_type', 0x0) 229// CHECK-NEXT: ('st_other', 0x00) 230// CHECK-NEXT: ('st_shndx', 0x0000) 231// CHECK-NEXT: ('st_value', 0x0000000000000000) 232// CHECK-NEXT: ('st_size', 0x0000000000000000) 233// CHECK-NEXT: ), 234// CHECK-NEXT: ]) 235