Follow up to d0858bffa11, add missing REQUIRES x86
[llvm-project.git] / llvm / test / tools / llvm-objcopy / ELF / symbol-copy.test
bloba71ccfd7e858cb8b60e408bdcd3d4cb512ba2f3e
1 # RUN: yaml2obj %s -o %t
2 # RUN: llvm-objcopy %t %t2
3 # RUN: llvm-readobj --symbols %t2 | FileCheck %s
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   - Name:     _start
26     Type:     STT_FUNC
27     Section:  .text
28     Value:    0x1000
29     Size:     4
30     Binding:  STB_GLOBAL
31   - Name:     bam
32     Type:     STT_FUNC
33     Section:  .text
34     Value:    0x1001
35     Size:     4
36     Other:    [ STV_HIDDEN ]
37     Binding:  STB_GLOBAL
38   - Name:     foo
39     Type:     STT_FUNC
40     Section:  .text
41     Value:    0x1004
42     Binding:  STB_GLOBAL
43   - Name:     faz
44     Type:     STT_OBJECT
45     Section:  .data
46     Value:    0x2002
47     Size:     2
48     Other:    [ STV_INTERNAL ]
49     Binding:  STB_GLOBAL
50   - Name:     bar
51     Type:     STT_OBJECT
52     Section:  .data
53     Value:    0x2000
54     Size:     4
55     Binding:  STB_GLOBAL
56   - Name:     baz
57     Type:     STT_OBJECT
58     Section:  .data
59     Value:    0x2004
60     Size:     4
61     Binding:  STB_GLOBAL
63 #CHECK: Symbols [
64 #CHECK-NEXT:  Symbol {
65 #CHECK-NEXT:    Name:
66 #CHECK-NEXT:    Value: 0x0
67 #CHECK-NEXT:    Size: 0
68 #CHECK-NEXT:    Binding: Local
69 #CHECK-NEXT:    Type: None
70 #CHECK-NEXT:    Other: 0
71 #CHECK-NEXT:    Section: Undefined
72 #CHECK-NEXT:  }
73 #CHECK-NEXT:  Symbol {
74 #CHECK-NEXT:    Name: _start
75 #CHECK-NEXT:    Value: 0x1000
76 #CHECK-NEXT:    Size: 4
77 #CHECK-NEXT:    Binding: Global
78 #CHECK-NEXT:    Type: Function
79 #CHECK-NEXT:    Other: 0
80 #CHECK-NEXT:    Section: .text
81 #CHECK-NEXT:  }
82 #CHECK-NEXT:  Symbol {
83 #CHECK-NEXT:    Name: bam
84 #CHECK-NEXT:    Value: 0x1001
85 #CHECK-NEXT:    Size: 4
86 #CHECK-NEXT:    Binding: Global
87 #CHECK-NEXT:    Type: Function
88 #CHECK-NEXT:    Other [
89 #CHECK-NEXT:      STV_HIDDEN
90 #CHECK-NEXT:    ]
91 #CHECK-NEXT:    Section: .text
92 #CHECK-NEXT:  }
93 #CHECK-NEXT:  Symbol {
94 #CHECK-NEXT:    Name: foo
95 #CHECK-NEXT:    Value: 0x1004
96 #CHECK-NEXT:    Size: 0
97 #CHECK-NEXT:    Binding: Global
98 #CHECK-NEXT:    Type: Function
99 #CHECK-NEXT:    Other: 0
100 #CHECK-NEXT:    Section: .text
101 #CHECK-NEXT:  }
102 #CHECK-NEXT:  Symbol {
103 #CHECK-NEXT:    Name: faz
104 #CHECK-NEXT:    Value: 0x2002
105 #CHECK-NEXT:    Size: 2
106 #CHECK-NEXT:    Binding: Global
107 #CHECK-NEXT:    Type: Object
108 #CHECK-NEXT:    Other [
109 #CHECK-NEXT:      STV_INTERNAL
110 #CHECK-NEXT:    ]
111 #CHECK-NEXT:    Section: .data
112 #CHECK-NEXT:  }
113 #CHECK-NEXT:  Symbol {
114 #CHECK-NEXT:    Name: bar
115 #CHECK-NEXT:    Value: 0x2000
116 #CHECK-NEXT:    Size: 4
117 #CHECK-NEXT:    Binding: Global
118 #CHECK-NEXT:    Type: Object
119 #CHECK-NEXT:    Other: 0
120 #CHECK-NEXT:    Section: .data
121 #CHECK-NEXT:  }
122 #CHECK-NEXT:  Symbol {
123 #CHECK-NEXT:    Name: baz
124 #CHECK-NEXT:    Value: 0x2004
125 #CHECK-NEXT:    Size: 4
126 #CHECK-NEXT:    Binding: Global
127 #CHECK-NEXT:    Type: Object
128 #CHECK-NEXT:    Other: 0
129 #CHECK-NEXT:    Section: .data
130 #CHECK-NEXT:  }
131 #CHECK-NEXT:]