Home | History | Annotate | Download | only in llvm-objcopy
      1 # RUN: yaml2obj %s > %t
      2 # RUN: llvm-objcopy %t %t2
      3 # RUN: llvm-readobj -symbols %t2 | FileCheck %s
      4 
      5 !ELF
      6 FileHeader:
      7   Class:           ELFCLASS64
      8   Data:            ELFDATA2LSB
      9   Type:            ET_EXEC
     10   Machine:         EM_X86_64
     11 Sections:
     12   - Name:            .text
     13     Type:            SHT_PROGBITS
     14     Flags:           [ SHF_ALLOC, SHF_EXECINSTR ]
     15     Address:         0x1000
     16     AddressAlign:    0x0000000000000010
     17     Content:         "0000000000000000"
     18   - Name:            .data
     19     Type:            SHT_PROGBITS
     20     Flags:           [ SHF_ALLOC ]
     21     Address:         0x2000
     22     AddressAlign:    0x0000000000000010
     23     Content:         "0000000000000000"
     24 Symbols:
     25   Global:
     26     - Name:     _start
     27       Type:     STT_FUNC
     28       Section:  .text
     29       Value:    0x1000
     30       Size:     4
     31     - Name:     bam
     32       Type:     STT_FUNC
     33       Section:  .text
     34       Value:    0x1001
     35       Size:     4
     36       Visibility: STV_HIDDEN
     37     - Name:     foo
     38       Type:     STT_FUNC
     39       Section:  .text
     40       Value:    0x1004
     41     - Name:     faz
     42       Type:     STT_OBJECT
     43       Section:  .data
     44       Value:    0x2002
     45       Size:     2
     46       Visibility: STV_INTERNAL
     47     - Name:     bar
     48       Type:     STT_OBJECT
     49       Section:  .data
     50       Value:    0x2000
     51       Size:     4
     52     - Name:     baz
     53       Type:     STT_OBJECT
     54       Section:  .data
     55       Value:    0x2004
     56       Size:     4
     57 
     58 #CHECK: Symbols [
     59 #CHECK-NEXT:  Symbol {
     60 #CHECK-NEXT:    Name:
     61 #CHECK-NEXT:    Value: 0x0
     62 #CHECK-NEXT:    Size: 0
     63 #CHECK-NEXT:    Binding: Local
     64 #CHECK-NEXT:    Type: None
     65 #CHECK-NEXT:    Other: 0
     66 #CHECK-NEXT:    Section: Undefined
     67 #CHECK-NEXT:  }
     68 #CHECK-NEXT:  Symbol {
     69 #CHECK-NEXT:    Name: _start
     70 #CHECK-NEXT:    Value: 0x1000
     71 #CHECK-NEXT:    Size: 4
     72 #CHECK-NEXT:    Binding: Global
     73 #CHECK-NEXT:    Type: Function
     74 #CHECK-NEXT:    Other: 0
     75 #CHECK-NEXT:    Section: .text
     76 #CHECK-NEXT:  }
     77 #CHECK-NEXT:  Symbol {
     78 #CHECK-NEXT:    Name: bam
     79 #CHECK-NEXT:    Value: 0x1001
     80 #CHECK-NEXT:    Size: 4
     81 #CHECK-NEXT:    Binding: Global
     82 #CHECK-NEXT:    Type: Function
     83 #CHECK-NEXT:    Other [
     84 #CHECK-NEXT:      STV_HIDDEN
     85 #CHECK-NEXT:    ]
     86 #CHECK-NEXT:    Section: .text
     87 #CHECK-NEXT:  }
     88 #CHECK-NEXT:  Symbol {
     89 #CHECK-NEXT:    Name: foo
     90 #CHECK-NEXT:    Value: 0x1004
     91 #CHECK-NEXT:    Size: 0
     92 #CHECK-NEXT:    Binding: Global
     93 #CHECK-NEXT:    Type: Function
     94 #CHECK-NEXT:    Other: 0
     95 #CHECK-NEXT:    Section: .text
     96 #CHECK-NEXT:  }
     97 #CHECK-NEXT:  Symbol {
     98 #CHECK-NEXT:    Name: faz
     99 #CHECK-NEXT:    Value: 0x2002
    100 #CHECK-NEXT:    Size: 2
    101 #CHECK-NEXT:    Binding: Global
    102 #CHECK-NEXT:    Type: Object
    103 #CHECK-NEXT:    Other [
    104 #CHECK-NEXT:      STV_INTERNAL
    105 #CHECK-NEXT:    ]
    106 #CHECK-NEXT:    Section: .data
    107 #CHECK-NEXT:  }
    108 #CHECK-NEXT:  Symbol {
    109 #CHECK-NEXT:    Name: bar
    110 #CHECK-NEXT:    Value: 0x2000
    111 #CHECK-NEXT:    Size: 4
    112 #CHECK-NEXT:    Binding: Global
    113 #CHECK-NEXT:    Type: Object
    114 #CHECK-NEXT:    Other: 0
    115 #CHECK-NEXT:    Section: .data
    116 #CHECK-NEXT:  }
    117 #CHECK-NEXT:  Symbol {
    118 #CHECK-NEXT:    Name: baz
    119 #CHECK-NEXT:    Value: 0x2004
    120 #CHECK-NEXT:    Size: 4
    121 #CHECK-NEXT:    Binding: Global
    122 #CHECK-NEXT:    Type: Object
    123 #CHECK-NEXT:    Other: 0
    124 #CHECK-NEXT:    Section: .data
    125 #CHECK-NEXT:  }
    126 #CHECK-NEXT:]
    127