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 we produce the group sections and that they are a the beginning
      4 // of the file.
      5 
      6 // CHECK:       # Section 1
      7 // CHECK-NEXT:  (('sh_name', 0x0000001b) # '.group'
      8 // CHECK-NEXT:   ('sh_type', 0x00000011)
      9 // CHECK-NEXT:   ('sh_flags', 0x0000000000000000)
     10 // CHECK-NEXT:   ('sh_addr', 0x0000000000000000)
     11 // CHECK-NEXT:   ('sh_offset', 0x0000000000000040)
     12 // CHECK-NEXT:   ('sh_size', 0x000000000000000c)
     13 // CHECK-NEXT:   ('sh_link', 0x0000000d)
     14 // CHECK-NEXT:   ('sh_info', 0x00000001)
     15 // CHECK-NEXT:   ('sh_addralign', 0x0000000000000004)
     16 // CHECK-NEXT:   ('sh_entsize', 0x0000000000000004)
     17 // CHECK-NEXT:  ),
     18 // CHECK-NEXT:  # Section 2
     19 // CHECK-NEXT:  (('sh_name', 0x0000001b) # '.group'
     20 // CHECK-NEXT:   ('sh_type', 0x00000011)
     21 // CHECK-NEXT:   ('sh_flags', 0x0000000000000000)
     22 // CHECK-NEXT:   ('sh_addr', 0x0000000000000000)
     23 // CHECK-NEXT:   ('sh_offset', 0x000000000000004c)
     24 // CHECK-NEXT:   ('sh_size', 0x0000000000000008)
     25 // CHECK-NEXT:   ('sh_link', 0x0000000d)
     26 // CHECK-NEXT:   ('sh_info', 0x00000002)
     27 // CHECK-NEXT:   ('sh_addralign', 0x0000000000000004)
     28 // CHECK-NEXT:   ('sh_entsize', 0x0000000000000004)
     29 // CHECK-NEXT:  ),
     30 // CHECK-NEXT:  # Section 3
     31 // CHECK-NEXT:  (('sh_name', 0x0000001b) # '.group'
     32 // CHECK-NEXT:   ('sh_type', 0x00000011)
     33 // CHECK-NEXT:   ('sh_flags', 0x0000000000000000)
     34 // CHECK-NEXT:   ('sh_addr', 0x0000000000000000)
     35 // CHECK-NEXT:   ('sh_offset', 0x0000000000000054)
     36 // CHECK-NEXT:   ('sh_size', 0x0000000000000008)
     37 // CHECK-NEXT:   ('sh_link', 0x0000000d)
     38 // CHECK-NEXT:   ('sh_info', 0x0000000d)
     39 // CHECK-NEXT:   ('sh_addralign', 0x0000000000000004)
     40 // CHECK-NEXT:   ('sh_entsize', 0x0000000000000004)
     41 // CHECK-NEXT:  ),
     42 
     43 // Test that g1 and g2 are local, but g3 is an undefined global.
     44 
     45 // CHECK:      # Symbol 1
     46 // CHECK-NEXT: (('st_name', 0x00000001) # 'g1'
     47 // CHECK-NEXT:  ('st_bind', 0x0)
     48 // CHECK-NEXT:  ('st_type', 0x0)
     49 // CHECK-NEXT:  ('st_other', 0x00)
     50 // CHECK-NEXT:  ('st_shndx', 0x0007)
     51 // CHECK-NEXT:  ('st_value', 0x0000000000000000)
     52 // CHECK-NEXT:  ('st_size', 0x0000000000000000)
     53 // CHECK-NEXT: ),
     54 // CHECK-NEXT: # Symbol 2
     55 // CHECK-NEXT: (('st_name', 0x00000004) # 'g2'
     56 // CHECK-NEXT:  ('st_bind', 0x0)
     57 // CHECK-NEXT:  ('st_type', 0x0)
     58 // CHECK-NEXT:  ('st_other', 0x00)
     59 // CHECK-NEXT:  ('st_shndx', 0x0002)
     60 // CHECK-NEXT:  ('st_value', 0x0000000000000000)
     61 // CHECK-NEXT:  ('st_size', 0x0000000000000000)
     62 // CHECK-NEXT: ),
     63 
     64 // CHECK:      # Symbol 13
     65 // CHECK-NEXT: (('st_name', 0x00000007) # 'g3'
     66 // CHECK-NEXT:  ('st_bind', 0x1)
     67 // CHECK-NEXT:  ('st_type', 0x0)
     68 // CHECK-NEXT:  ('st_other', 0x00)
     69 // CHECK-NEXT:  ('st_shndx', 0x0000)
     70 // CHECK-NEXT:  ('st_value', 0x0000000000000000)
     71 // CHECK-NEXT:  ('st_size', 0x0000000000000000)
     72 // CHECK-NEXT: ),
     73 
     74 
     75 	.section	.foo,"axG",@progbits,g1,comdat
     76 g1:
     77         nop
     78 
     79         .section	.bar,"axG",@progbits,g1,comdat
     80         nop
     81 
     82         .section	.zed,"axG",@progbits,g2,comdat
     83         nop
     84 
     85         .section	.baz,"axG",@progbits,g3,comdat
     86         .long g3
     87