Home | History | Annotate | Download | only in llvm-objcopy
      1 # RUN: yaml2obj %s > %t
      2 # RUN: llvm-objcopy --discard-all -K foo --keep-symbol bar %t %t2
      3 # RUN: llvm-objcopy -K foo -N foo -N bar --keep-symbol bar -N baz %t %t3
      4 # RUN: llvm-readobj -symbols %t2 | FileCheck %s
      5 # RUN: llvm-readobj -symbols %t3 | FileCheck %s
      6 
      7 !ELF
      8 FileHeader:
      9   Class:           ELFCLASS64
     10   Data:            ELFDATA2LSB
     11   Type:            ET_REL
     12   Machine:         EM_X86_64
     13 Sections:
     14   - Name:            .text
     15     Type:            SHT_PROGBITS
     16     Flags:           [ SHF_ALLOC, SHF_EXECINSTR ]
     17     Address:         0x1000
     18     AddressAlign:    0x0000000000000010
     19     Size:            64
     20 Symbols:
     21   Local:
     22     - Name:     foo
     23       Type:     STT_FUNC
     24       Section:  .text
     25       Value:    0x1000
     26       Size:     8
     27     - Name:     bar
     28       Type:     STT_FUNC
     29       Section:  .text
     30       Value:    0x1008
     31       Size:     8
     32     - Name:     baz
     33       Type:     STT_FUNC
     34       Section:  .text
     35       Value:    0x1010
     36       Size:     8
     37 
     38 #CHECK: Symbols [
     39 #CHECK-NEXT:  Symbol {
     40 #CHECK-NEXT:    Name:
     41 #CHECK-NEXT:    Value: 0x0
     42 #CHECK-NEXT:    Size: 0
     43 #CHECK-NEXT:    Binding: Local
     44 #CHECK-NEXT:    Type: None
     45 #CHECK-NEXT:    Other: 0
     46 #CHECK-NEXT:    Section: Undefined
     47 #CHECK-NEXT:  }
     48 #CHECK-NEXT:  Symbol {
     49 #CHECK-NEXT:    Name: foo
     50 #CHECK-NEXT:    Value: 0x1000
     51 #CHECK-NEXT:    Size: 8
     52 #CHECK-NEXT:    Binding: Local
     53 #CHECK-NEXT:    Type: Function
     54 #CHECK-NEXT:    Other: 0
     55 #CHECK-NEXT:    Section: .text
     56 #CHECK-NEXT:  }
     57 #CHECK-NEXT:  Symbol {
     58 #CHECK-NEXT:    Name: bar
     59 #CHECK-NEXT:    Value: 0x1008
     60 #CHECK-NEXT:    Size: 8
     61 #CHECK-NEXT:    Binding: Local
     62 #CHECK-NEXT:    Type: Function
     63 #CHECK-NEXT:    Other: 0
     64 #CHECK-NEXT:    Section: .text
     65 #CHECK-NEXT:  }
     66 #CHECK-NEXT:]
     67