llvm-project

Форк
0
/
objc-uses-custom-personality.s 
225 строк · 6.5 Кб
1
## Tests that lld correctly resolves the custom personality referenced by objc code in an archive.
2

3
# REQUIRES: x86
4
# RUN: rm -rf %t; split-file %s %t
5
# RUN: llvm-mc -filetype=obj -triple=x86_64-apple-iossimulator %t/defined.s -o %t/defined.o
6
# RUN: yaml2obj %t/combined.yaml > %t/combined.o
7
# RUN: llvm-ar r %t/pack.a %t/defined.o %t/combined.o
8
# RUN: %no-arg-lld -dylib -arch x86_64 -platform_version ios-simulator 12.0.0 15.0 -ObjC %t/pack.a -o %t/a.dylib
9
# RUN: llvm-objdump --macho --syms %t/a.dylib | FileCheck %s
10
# RUN: %no-arg-lld -dylib -arch x86_64 -platform_version ios-simulator 12.0.0 15.0 -ObjC --start-lib %t/defined.o %t/combined.o --end-lib -o %t/a.dylib
11
# RUN: llvm-objdump --macho --syms %t/a.dylib | FileCheck %s
12

13
# CHECK: SYMBOL TABLE:
14
# CHECK: {{.*}}  l     F __TEXT,__text _my_personality
15

16

17
#--- defined.s
18
.private_extern _my_personality
19

20
.text
21
.no_dead_strip _my_personality
22
_my_personality:
23
.cfi_startproc
24
.cfi_def_cfa_offset 16
25
.cfi_endproc
26
nop
27
.subsections_via_symbols
28

29
## combined.yaml is produced from combined.o below:
30
## lvm-mc -filetype=obj -triple=x86_64-apple-iossimulator %t/objc.s -o %t/objc.o
31
## ld -r -o combined.o defined.o objc.o
32
## // objc.s:
33
## .section __TEXT,__text
34
## .global _OBJC_CLASS_$_MyTest
35
## .no_dead_strip _OBJC_CLASS_$_MyTest
36
## _OBJC_CLASS_$_MyTest:
37
##  .cfi_startproc
38
##  .cfi_personality 155, _my_personality
39
##  .cfi_def_cfa_offset 16
40
##  ret
41
##  .cfi_endproc
42
##
43
##  ret
44
## .subsections_via_symbols
45

46
#--- combined.yaml
47
--- !mach-o
48
FileHeader:
49
  magic:           0xFEEDFACF
50
  cputype:         0x1000007
51
  cpusubtype:      0x3
52
  filetype:        0x1
53
  ncmds:           3
54
  sizeofcmds:      352
55
  flags:           0x2000
56
  reserved:        0x0
57
LoadCommands:
58
  - cmd:             LC_SEGMENT_64
59
    cmdsize:         312
60
    segname:         ''
61
    vmaddr:          0
62
    vmsize:          152
63
    fileoff:         416
64
    filesize:        152
65
    maxprot:         7
66
    initprot:        7
67
    nsects:          3
68
    flags:           0
69
    Sections:
70
      - sectname:        __text
71
        segname:         __TEXT
72
        addr:            0x0
73
        size:            3
74
        offset:          0x1A0
75
        align:           0
76
        reloff:          0x0
77
        nreloc:          0
78
        flags:           0x80000400
79
        reserved1:       0x0
80
        reserved2:       0x0
81
        reserved3:       0x0
82
        content:         90C3C3
83
      - sectname:        __eh_frame
84
        segname:         __TEXT
85
        addr:            0x8
86
        size:            80
87
        offset:          0x1A8
88
        align:           3
89
        reloff:          0x238
90
        nreloc:          5
91
        flags:           0x0
92
        reserved1:       0x0
93
        reserved2:       0x0
94
        reserved3:       0x0
95
        content:         1400000000000000017A520001781001100C0708900100001800000000000000017A505200017810069B04000000100C070890011800000004000000F8FFFFFFFFFFFFFF0100000000000000000E1000
96
        relocations:
97
          - address:         0x2A
98
            symbolnum:       0
99
            pcrel:           true
100
            length:          2
101
            extern:          true
102
            type:            4
103
            scattered:       false
104
            value:           0
105
          - address:         0x38
106
            symbolnum:       2
107
            pcrel:           false
108
            length:          2
109
            extern:          true
110
            type:            5
111
            scattered:       false
112
            value:           0
113
          - address:         0x38
114
            symbolnum:       3
115
            pcrel:           false
116
            length:          2
117
            extern:          true
118
            type:            0
119
            scattered:       false
120
            value:           0
121
          - address:         0x3C
122
            symbolnum:       3
123
            pcrel:           false
124
            length:          3
125
            extern:          true
126
            type:            5
127
            scattered:       false
128
            value:           0
129
          - address:         0x3C
130
            symbolnum:       4
131
            pcrel:           false
132
            length:          3
133
            extern:          true
134
            type:            0
135
            scattered:       false
136
            value:           0
137
      - sectname:        __compact_unwind
138
        segname:         __LD
139
        addr:            0x58
140
        size:            64
141
        offset:          0x1F8
142
        align:           3
143
        reloff:          0x260
144
        nreloc:          3
145
        flags:           0x2000000
146
        reserved1:       0x0
147
        reserved2:       0x0
148
        reserved3:       0x0
149
        content:         '00000000000000000100000000000202000000000000000000000000000000000000000000000000020000000000020200000000000000000000000000000000'
150
        relocations:
151
          - address:         0x0
152
            symbolnum:       0
153
            pcrel:           false
154
            length:          3
155
            extern:          true
156
            type:            0
157
            scattered:       false
158
            value:           0
159
          - address:         0x20
160
            symbolnum:       4
161
            pcrel:           false
162
            length:          3
163
            extern:          true
164
            type:            0
165
            scattered:       false
166
            value:           0
167
          - address:         0x30
168
            symbolnum:       0
169
            pcrel:           false
170
            length:          3
171
            extern:          true
172
            type:            0
173
            scattered:       false
174
            value:           0
175
  - cmd:             LC_SYMTAB
176
    cmdsize:         24
177
    symoff:          632
178
    nsyms:           5
179
    stroff:          712
180
    strsize:         64
181
  - cmd:             LC_DATA_IN_CODE
182
    cmdsize:         16
183
    dataoff:         632
184
    datasize:        0
185
LinkEditData:
186
  NameList:
187
    - n_strx:          23
188
      n_type:          0x1E
189
      n_sect:          1
190
      n_desc:          32
191
      n_value:         0
192
    - n_strx:          39
193
      n_type:          0xE
194
      n_sect:          2
195
      n_desc:          0
196
      n_value:         8
197
    - n_strx:          39
198
      n_type:          0xE
199
      n_sect:          2
200
      n_desc:          0
201
      n_value:         32
202
    - n_strx:          49
203
      n_type:          0xE
204
      n_sect:          2
205
      n_desc:          0
206
      n_value:         60
207
    - n_strx:          2
208
      n_type:          0xF
209
      n_sect:          1
210
      n_desc:          32
211
      n_value:         1
212
  StringTable:
213
    - ' '
214
    - '_OBJC_CLASS_$_MyTest'
215
    - _my_personality
216
    - EH_Frame1
217
    - func.eh
218
    - ''
219
    - ''
220
    - ''
221
    - ''
222
    - ''
223
    - ''
224
    - ''
225
...
226

Использование cookies

Мы используем файлы cookie в соответствии с Политикой конфиденциальности и Политикой использования cookies.

Нажимая кнопку «Принимаю», Вы даете АО «СберТех» согласие на обработку Ваших персональных данных в целях совершенствования нашего веб-сайта и Сервиса GitVerse, а также повышения удобства их использования.

Запретить использование cookies Вы можете самостоятельно в настройках Вашего браузера.