Skip to content

Commit d76da6c

Browse files
Add support for the swift5 reflection section acfuncs
With bc013b3 a new section called accessible functions was added to swift/include/swift/ABI/ObjectFile.h so this change adds support for dumping it out into the dSYM bundle Differential Revision: https://reviews.llvm.org/D119569
1 parent 45bddf5 commit d76da6c

File tree

3 files changed

+29
-12
lines changed

3 files changed

+29
-12
lines changed

llvm/include/llvm/BinaryFormat/Swift.def

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,3 +28,5 @@ HANDLE_SWIFT_SECTION(conform, "__swift5_proto", "swift5_protocol_confromances",
2828
".sw5prtc$B")
2929
HANDLE_SWIFT_SECTION(protocs, "__swift5_protos", "swift5_protocols",
3030
".sw5prt$B")
31+
HANDLE_SWIFT_SECTION(acfuncs, "__swift5_acfuncs", "swift5_accessible_functions",
32+
".sw5acfn$B")

llvm/test/tools/dsymutil/Inputs/reflection_metadata.yaml

Lines changed: 24 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,12 @@ FileHeader:
1616
cpusubtype: 0x3
1717
filetype: 0x1
1818
ncmds: 8
19-
sizeofcmds: 2960
19+
sizeofcmds: 3040
2020
flags: 0x2000
2121
reserved: 0x0
2222
LoadCommands:
2323
- cmd: LC_SEGMENT_64
24-
cmdsize: 2712
24+
cmdsize: 2792
2525
segname: ''
2626
vmaddr: 0
2727
vmsize: 21352
@@ -36,7 +36,7 @@ LoadCommands:
3636
segname: __TEXT
3737
addr: 0x0
3838
size: 4571
39-
offset: 0xBB0
39+
offset: 0xC00
4040
align: 4
4141
reloff: 0x5CF8
4242
nreloc: 74
@@ -56,7 +56,7 @@ LoadCommands:
5656
segname: __TEXT
5757
addr: 0x11DC
5858
size: 117
59-
offset: 0x1D8C
59+
offset: 0x1DDC
6060
align: 1
6161
reloff: 0x5F48
6262
nreloc: 22
@@ -77,7 +77,7 @@ LoadCommands:
7777
segname: __TEXT
7878
addr: 0x1254
7979
size: 24
80-
offset: 0x1E04
80+
offset: 0x1E54
8181
align: 2
8282
reloff: 0x5FF8
8383
nreloc: 6
@@ -98,7 +98,7 @@ LoadCommands:
9898
segname: __TEXT
9999
addr: 0x17D8
100100
size: 37
101-
offset: 0x2388
101+
offset: 0x23D8
102102
align: 0
103103
reloff: 0x0
104104
nreloc: 0
@@ -110,7 +110,7 @@ LoadCommands:
110110
segname: __TEXT
111111
addr: 0x1800
112112
size: 24
113-
offset: 0x23B0
113+
offset: 0x2400
114114
align: 2
115115
reloff: 0x6530
116116
nreloc: 8
@@ -131,7 +131,7 @@ LoadCommands:
131131
segname: __TEXT
132132
addr: 0x1818
133133
size: 260
134-
offset: 0x23C8
134+
offset: 0x2418
135135
align: 2
136136
reloff: 0x6570
137137
nreloc: 60
@@ -152,7 +152,7 @@ LoadCommands:
152152
segname: __TEXT
153153
addr: 0x1AC8
154154
size: 20
155-
offset: 0x2678
155+
offset: 0x26C8
156156
align: 2
157157
reloff: 0x67F8
158158
nreloc: 2
@@ -173,7 +173,7 @@ LoadCommands:
173173
segname: __TEXT
174174
addr: 0x1AEC
175175
size: 10
176-
offset: 0x269C
176+
offset: 0x26EC
177177
align: 2
178178
reloff: 0x0
179179
nreloc: 0
@@ -185,19 +185,31 @@ LoadCommands:
185185
segname: __TEXT
186186
addr: 0x1AF8
187187
size: 10
188-
offset: 0x26C0
188+
offset: 0x2710
189189
align: 2
190190
reloff: 0x0
191191
nreloc: 0
192192
flags: 0x10000000
193193
reserved1: 0x0
194194
reserved2: 0x0
195195
content: 51525354555657585960
196+
- sectname: __swift5_acfuncs
197+
segname: __TEXT
198+
addr: 0x1B04
199+
size: 10
200+
offset: 0x2734
201+
align: 2
202+
reloff: 0x0
203+
nreloc: 0
204+
flags: 0x10000000
205+
reserved1: 0x0
206+
reserved2: 0x0
207+
content: 61626364656667686970
196208
- sectname: __bss
197209
segname: __DATA
198210
addr: 0x3372
199211
size: 2084
200-
offset: 0x5150
212+
offset: 0x51D0
201213
align: 3
202214
reloff: 0x0
203215
nreloc: 0

llvm/test/tools/dsymutil/X86/reflection-dump.test

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,3 +48,6 @@ CHECK-NEXT: 10000e258 41424344 45464748 4950 ABCDEFGHIP
4848

4949
CHECK: Contents of section __DWARF,__swift5_protos:
5050
CHECK-NEXT: 10000e264 51525354 55565758 5960 QRSTUVWXY`
51+
52+
CHECK: Contents of section __DWARF,__swift5_acfuncs:
53+
CHECK-NEXT: 10000e270 61626364 65666768 6970 abcdefghip

0 commit comments

Comments
 (0)