Home | History | Annotate | Download | only in llvm-readobj
      1 # RUN: yaml2obj %s -o %t.o
      2 
      3 # RUN: llvm-readobj --elf-section-groups -elf-output-style=GNU \
      4 # RUN:   %t.o >%tout.log 2>%terr.log
      5 # RUN: FileCheck %s -check-prefix=GNU-STDERR < %terr.log
      6 # GNU-STDERR: Error: section [    3] in group section [    4] already in group section [    2]
      7 # RUN: FileCheck %s -check-prefix=GNU-STDOUT < %tout.log
      8 # GNU-STDOUT:      COMDAT group section [    2] `.group' [bar] contains 1 sections:
      9 # GNU-STDOUT-NEXT:   [Index]    Name
     10 # GNU-STDOUT-NEXT:   [    3]   .foo
     11 # GNU-STDOUT:      COMDAT group section [    4] `.group1' [zed] contains 1 sections:
     12 # GNU-STDOUT-NEXT:   [Index]    Name
     13 
     14 # RUN: llvm-readobj --elf-section-groups \
     15 # RUN:   %t.o >%t2out.log 2>%t2err.log %t.o
     16 # RUN: FileCheck %s -check-prefix=LLVM-STDERR < %t2err.log
     17 # LLVM-STDERR: Error: .foo (3) in a group .group1 (4) is already in a group .group (2)
     18 # RUN: FileCheck %s -check-prefix=LLVM-STDOUT < %t2out.log
     19 # LLVM-STDOUT:      Groups {
     20 # LLVM-STDOUT-NEXT:   Group {
     21 # LLVM-STDOUT-NEXT:     Name: .group
     22 # LLVM-STDOUT-NEXT:     Index: 2
     23 # LLVM-STDOUT-NEXT:     Link: 5
     24 # LLVM-STDOUT-NEXT:     Info: 1
     25 # LLVM-STDOUT-NEXT:     Type: COMDAT
     26 # LLVM-STDOUT-NEXT:     Signature: bar
     27 # LLVM-STDOUT-NEXT:     Section(s) in group [
     28 # LLVM-STDOUT-NEXT:       .foo (3)
     29 # LLVM-STDOUT-NEXT:     ]
     30 # LLVM-STDOUT-NEXT:   }
     31 # LLVM-STDOUT-NEXT:   Group {
     32 # LLVM-STDOUT-NEXT:     Name: .group1
     33 # LLVM-STDOUT-NEXT:     Index: 4
     34 # LLVM-STDOUT-NEXT:     Link: 5
     35 # LLVM-STDOUT-NEXT:     Info: 2
     36 # LLVM-STDOUT-NEXT:     Type: COMDAT
     37 # LLVM-STDOUT-NEXT:     Signature: zed
     38 # LLVM-STDOUT-NEXT:     Section(s) in group [
     39 # LLVM-STDOUT-NEXT:     ]
     40 # LLVM-STDOUT-NEXT:   }
     41 # LLVM-STDOUT-NEXT: }
     42 
     43 !ELF
     44 FileHeader:      
     45   Class:           ELFCLASS64
     46   Data:            ELFDATA2LSB
     47   Type:            ET_REL
     48   Machine:         EM_X86_64
     49 Sections:        
     50   - Name:            .text
     51     Type:            SHT_PROGBITS
     52     Flags:           [ SHF_ALLOC, SHF_EXECINSTR ]
     53     AddressAlign:    0x0000000000000004
     54     Content:         ''
     55   - Name:            .group
     56     Type:            SHT_GROUP
     57     Link:            .symtab
     58     AddressAlign:    0x0000000000000004
     59     Info:            bar
     60     Members:         
     61       - SectionOrType:   GRP_COMDAT
     62       - SectionOrType:   .foo
     63   - Name:            .foo
     64     Type:            SHT_PROGBITS
     65     Flags:           [ SHF_ALLOC, SHF_EXECINSTR, SHF_GROUP ]
     66     AddressAlign:    0x0000000000000001
     67     Content:         ''
     68   - Name:            .group1
     69     Type:            SHT_GROUP
     70     Link:            .symtab
     71     AddressAlign:    0x0000000000000004
     72     Info:            zed
     73     Members:         
     74       - SectionOrType:   GRP_COMDAT
     75       - SectionOrType:   .foo
     76 Symbols:         
     77   Local:           
     78     - Name:            bar
     79       Section:         .group
     80     - Name:            zed
     81       Section:         .group1
     82