Home | History | Annotate | Download | only in ELF
      1 // RUN: llvm-mc -filetype=obj -triple x86_64-pc-linux-gnu %s -o - | elf-dump  | FileCheck %s
      2 
      3 // Test that the relocations point to the correct symbols. We used to get the
      4 // symbol index wrong for weakrefs when creating _GLOBAL_OFFSET_TABLE_.
      5 
      6 	.weakref	bar,foo
      7         call    zed@PLT
      8 	call	bar
      9 
     10 // CHECK:      # Relocation 0
     11 // CHECK-NEXT: (('r_offset', 0x0000000000000001)
     12 // CHECK-NEXT:  ('r_sym', 0x00000006)
     13 // CHECK-NEXT:  ('r_type', 0x00000004)
     14 // CHECK-NEXT:  ('r_addend', 0xfffffffffffffffc)
     15 // CHECK-NEXT: ),
     16 // CHECK-NEXT: # Relocation 1
     17 // CHECK-NEXT: (('r_offset', 0x0000000000000006)
     18 // CHECK-NEXT:  ('r_sym', 0x00000005)
     19 // CHECK-NEXT:  ('r_type', 0x00000002)
     20 // CHECK-NEXT:  ('r_addend', 0xfffffffffffffffc)
     21 // CHECK-NEXT: ),
     22 
     23 // CHECK:      # Symbol 4
     24 // CHECK-NEXT: (('st_name', 0x00000009) # '_GLOBAL_OFFSET_TABLE_'
     25 // CHECK-NEXT:  ('st_bind', 0x1)
     26 // CHECK-NEXT:  ('st_type', 0x0)
     27 // CHECK-NEXT:  ('st_other', 0x00)
     28 // CHECK-NEXT:  ('st_shndx', 0x0000)
     29 // CHECK-NEXT:  ('st_value', 0x0000000000000000)
     30 // CHECK-NEXT:  ('st_size', 0x0000000000000000)
     31 // CHECK-NEXT: ),
     32 // CHECK-NEXT: # Symbol 5
     33 // CHECK-NEXT: (('st_name', 0x00000001) # 'foo'
     34 // CHECK-NEXT:  ('st_bind', 0x2)
     35 // CHECK-NEXT:  ('st_type', 0x0)
     36 // CHECK-NEXT:  ('st_other', 0x00)
     37 // CHECK-NEXT:  ('st_shndx', 0x0000)
     38 // CHECK-NEXT:  ('st_value', 0x0000000000000000)
     39 // CHECK-NEXT:  ('st_size', 0x0000000000000000)
     40 // CHECK-NEXT: ),
     41 // CHECK-NEXT: # Symbol 6
     42 // CHECK-NEXT: (('st_name', 0x00000005) # 'zed'
     43 // CHECK-NEXT:  ('st_bind', 0x1)
     44 // CHECK-NEXT:  ('st_type', 0x0)
     45 // CHECK-NEXT:  ('st_other', 0x00)
     46 // CHECK-NEXT:  ('st_shndx', 0x0000)
     47 // CHECK-NEXT:  ('st_value', 0x0000000000000000)
     48 // CHECK-NEXT:  ('st_size', 0x0000000000000000)
     49 // CHECK-NEXT: ),
     50