Skip to content

Commit 5aa5166

Browse files
Add support to dsymutil for dumping out new swift5 reflection sections
This change adds support for dsymutil to be able to dump out the new swift5 reflection sections called swift5_proto and swift5_protos. The test is also updated to check for this. Differential Revision: https://reviews.llvm.org/D119310 (cherry picked from commit a18d06a)
1 parent a869925 commit 5aa5166

File tree

3 files changed

+45
-11
lines changed

3 files changed

+45
-11
lines changed

llvm/include/llvm/BinaryFormat/Swift.def

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,3 +24,7 @@ HANDLE_SWIFT_SECTION(builtin, "__swift5_builtin", "swift5_builtin", ".sw5bltn")
2424
HANDLE_SWIFT_SECTION(capture, "__swift5_capture", "swift5_capture", ".sw5cptr")
2525
HANDLE_SWIFT_SECTION(typeref, "__swift5_typeref", "swift5_typeref", ".sw5tyrf")
2626
HANDLE_SWIFT_SECTION(reflstr, "__swift5_reflstr", "swift5_reflstr", ".sw5rfst")
27+
HANDLE_SWIFT_SECTION(conform, "__swift5_proto", "swift5_protocol_confromances",
28+
".sw5prtc$B")
29+
HANDLE_SWIFT_SECTION(protocs, "__swift5_protos", "swift5_protocols",
30+
".sw5prt$B")

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

Lines changed: 35 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -16,27 +16,27 @@ FileHeader:
1616
cpusubtype: 0x3
1717
filetype: 0x1
1818
ncmds: 8
19-
sizeofcmds: 2800
19+
sizeofcmds: 2960
2020
flags: 0x2000
2121
reserved: 0x0
2222
LoadCommands:
2323
- cmd: LC_SEGMENT_64
24-
cmdsize: 2552
24+
cmdsize: 2712
2525
segname: ''
2626
vmaddr: 0
2727
vmsize: 21352
2828
fileoff: 2832
2929
filesize: 20967
3030
maxprot: 7
3131
initprot: 7
32-
nsects: 31
32+
nsects: 33
3333
flags: 0
3434
Sections:
3535
- sectname: __text
3636
segname: __TEXT
3737
addr: 0x0
3838
size: 4571
39-
offset: 0xB10
39+
offset: 0xBB0
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: 0x1CEC
59+
offset: 0x1D8C
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: 0x1D64
80+
offset: 0x1E04
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: 0x22E8
101+
offset: 0x2388
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: 0x2310
113+
offset: 0x23B0
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: 0x2328
134+
offset: 0x23C8
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: 0x25D8
155+
offset: 0x2678
156156
align: 2
157157
reloff: 0x67F8
158158
nreloc: 2
@@ -169,11 +169,35 @@ LoadCommands:
169169
type: 5
170170
scattered: false
171171
value: 0
172+
- sectname: __swift5_proto
173+
segname: __TEXT
174+
addr: 0x1AEC
175+
size: 10
176+
offset: 0x269C
177+
align: 2
178+
reloff: 0x0
179+
nreloc: 0
180+
flags: 0x10000000
181+
reserved1: 0x0
182+
reserved2: 0x0
183+
content: 41424344454647484950
184+
- sectname: __swift5_protos
185+
segname: __TEXT
186+
addr: 0x1AF8
187+
size: 10
188+
offset: 0x26C0
189+
align: 2
190+
reloff: 0x0
191+
nreloc: 0
192+
flags: 0x10000000
193+
reserved1: 0x0
194+
reserved2: 0x0
195+
content: 51525354555657585960
172196
- sectname: __bss
173197
segname: __DATA
174198
addr: 0x3372
175199
size: 2084
176-
offset: 0x50B0
200+
offset: 0x5150
177201
align: 3
178202
reloff: 0x0
179203
nreloc: 0

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

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,3 +42,9 @@ CHECK-NEXT: 10000e23c f0ffffff ecffffff ........
4242
CHECK: Contents of section __DWARF,__swift5_builtin:
4343
CHECK-NEXT: 10000e244 00000000 09000000 08000100 10000000 ................
4444
CHECK-NEXT: 10000e254 fe000000 ....
45+
46+
CHECK: Contents of section __DWARF,__swift5_proto:
47+
CHECK-NEXT: 10000e258 41424344 45464748 4950 ABCDEFGHIP
48+
49+
CHECK: Contents of section __DWARF,__swift5_protos:
50+
CHECK-NEXT: 10000e264 51525354 55565758 5960 QRSTUVWXY`

0 commit comments

Comments
 (0)