Skip to content
This repository was archived by the owner on Mar 28, 2020. It is now read-only.

Commit 51e124d

Browse files
committed
[llvm-lipo] Implement alignment function in -create
Summary: Removes hard coded valuse for alignment in -create. Patch by Anusha Basana <[email protected]> Differential Revision: https://reviews.llvm.org/D64871 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@366970 91177308-0d34-0410-b5e6-96231b3b80d8
1 parent 15471a7 commit 51e124d

File tree

5 files changed

+503
-4
lines changed

5 files changed

+503
-4
lines changed
Lines changed: 359 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,359 @@
1+
--- !mach-o
2+
FileHeader:
3+
magic: 0xFEEDFACF
4+
cputype: 0x0000000A
5+
cpusubtype: 0x80000003
6+
filetype: 0x00000001
7+
ncmds: 15
8+
sizeofcmds: 1216
9+
flags: 0x00200085
10+
reserved: 0x00000000
11+
LoadCommands:
12+
- cmd: LC_SEGMENT_64
13+
cmdsize: 72
14+
segname: __PAGEZERO
15+
vmaddr: 0
16+
vmsize: 4294967296
17+
fileoff: 0
18+
filesize: 0
19+
maxprot: 0
20+
initprot: 0
21+
nsects: 0
22+
flags: 0
23+
- cmd: LC_SEGMENT_64
24+
cmdsize: 472
25+
segname: __TEXT
26+
vmaddr: 4294967296
27+
vmsize: 4096
28+
fileoff: 0
29+
filesize: 4096
30+
maxprot: 7
31+
initprot: 5
32+
nsects: 5
33+
flags: 0
34+
Sections:
35+
- sectname: __text
36+
segname: __TEXT
37+
addr: 0x0000000100000F00
38+
size: 133
39+
offset: 0x00000F00
40+
align: 4
41+
reloff: 0x00000000
42+
nreloc: 0
43+
flags: 0x80000400
44+
reserved1: 0x00000000
45+
reserved2: 0x00000000
46+
reserved3: 0x00000000
47+
- sectname: __stubs
48+
segname: __TEXT
49+
addr: 0x0000000100000F86
50+
size: 6
51+
offset: 0x00000F86
52+
align: 1
53+
reloff: 0x00000000
54+
nreloc: 0
55+
flags: 0x80000408
56+
reserved1: 0x00000000
57+
reserved2: 0x00000006
58+
reserved3: 0x00000000
59+
- sectname: __stub_helper
60+
segname: __TEXT
61+
addr: 0x0000000100000F8C
62+
size: 26
63+
offset: 0x00000F8C
64+
align: 2
65+
reloff: 0x00000000
66+
nreloc: 0
67+
flags: 0x80000400
68+
reserved1: 0x00000000
69+
reserved2: 0x00000000
70+
reserved3: 0x00000000
71+
- sectname: __cstring
72+
segname: __TEXT
73+
addr: 0x0000000100000FA6
74+
size: 10
75+
offset: 0x00000FA6
76+
align: 0
77+
reloff: 0x00000000
78+
nreloc: 0
79+
flags: 0x00000002
80+
reserved1: 0x00000000
81+
reserved2: 0x00000000
82+
reserved3: 0x00000000
83+
- sectname: __unwind_info
84+
segname: __TEXT
85+
addr: 0x0000000100000FB0
86+
size: 72
87+
offset: 0x00000FB0
88+
align: 2
89+
reloff: 0x00000000
90+
nreloc: 0
91+
flags: 0x00000000
92+
reserved1: 0x00000000
93+
reserved2: 0x00000000
94+
reserved3: 0x00000000
95+
- cmd: LC_SEGMENT_64
96+
cmdsize: 232
97+
segname: __DATA
98+
vmaddr: 4294971392
99+
vmsize: 4096
100+
fileoff: 4096
101+
filesize: 4096
102+
maxprot: 7
103+
initprot: 3
104+
nsects: 2
105+
flags: 0
106+
Sections:
107+
- sectname: __nl_symbol_ptr
108+
segname: __DATA
109+
addr: 0x0000000100001000
110+
size: 16
111+
offset: 0x00001000
112+
align: 3
113+
reloff: 0x00000000
114+
nreloc: 0
115+
flags: 0x00000006
116+
reserved1: 0x00000001
117+
reserved2: 0x00000000
118+
reserved3: 0x00000000
119+
- sectname: __la_symbol_ptr
120+
segname: __DATA
121+
addr: 0x0000000100001010
122+
size: 8
123+
offset: 0x00001010
124+
align: 3
125+
reloff: 0x00000000
126+
nreloc: 0
127+
flags: 0x00000007
128+
reserved1: 0x00000003
129+
reserved2: 0x00000000
130+
reserved3: 0x00000000
131+
- cmd: LC_SEGMENT_64
132+
cmdsize: 72
133+
segname: __LINKEDIT
134+
vmaddr: 4294975488
135+
vmsize: 4096
136+
fileoff: 8192
137+
filesize: 280
138+
maxprot: 7
139+
initprot: 1
140+
nsects: 0
141+
flags: 0
142+
- cmd: LC_DYLD_INFO_ONLY
143+
cmdsize: 48
144+
rebase_off: 8192
145+
rebase_size: 8
146+
bind_off: 8200
147+
bind_size: 24
148+
weak_bind_off: 0
149+
weak_bind_size: 0
150+
lazy_bind_off: 8224
151+
lazy_bind_size: 16
152+
export_off: 8240
153+
export_size: 64
154+
- cmd: LC_SYMTAB
155+
cmdsize: 24
156+
symoff: 8312
157+
nsyms: 5
158+
stroff: 8408
159+
strsize: 64
160+
- cmd: LC_DYSYMTAB
161+
cmdsize: 80
162+
ilocalsym: 0
163+
nlocalsym: 0
164+
iextdefsym: 0
165+
nextdefsym: 3
166+
iundefsym: 3
167+
nundefsym: 2
168+
tocoff: 0
169+
ntoc: 0
170+
modtaboff: 0
171+
nmodtab: 0
172+
extrefsymoff: 0
173+
nextrefsyms: 0
174+
indirectsymoff: 8392
175+
nindirectsyms: 4
176+
extreloff: 0
177+
nextrel: 0
178+
locreloff: 0
179+
nlocrel: 0
180+
- cmd: LC_LOAD_DYLINKER
181+
cmdsize: 32
182+
name: 12
183+
PayloadString: /usr/lib/dyld
184+
ZeroPadBytes: 7
185+
- cmd: LC_UUID
186+
cmdsize: 24
187+
uuid: D01A2A5D-F96C-326A-80C7-FAD7D4023E07
188+
- cmd: LC_BUILD_VERSION
189+
cmdsize: 32
190+
platform: 1
191+
minos: 658944
192+
sdk: 658944
193+
ntools: 1
194+
Tools:
195+
- tool: 3
196+
version: 29491968
197+
- cmd: LC_SOURCE_VERSION
198+
cmdsize: 16
199+
version: 0
200+
- cmd: LC_MAIN
201+
cmdsize: 24
202+
entryoff: 3904
203+
stacksize: 0
204+
- cmd: LC_LOAD_DYLIB
205+
cmdsize: 56
206+
dylib:
207+
name: 24
208+
timestamp: 2
209+
current_version: 82115073
210+
compatibility_version: 65536
211+
PayloadString: /usr/lib/libSystem.B.dylib
212+
ZeroPadBytes: 6
213+
- cmd: LC_FUNCTION_STARTS
214+
cmdsize: 16
215+
dataoff: 8304
216+
datasize: 8
217+
- cmd: LC_DATA_IN_CODE
218+
cmdsize: 16
219+
dataoff: 8312
220+
datasize: 0
221+
LinkEditData:
222+
RebaseOpcodes:
223+
- Opcode: REBASE_OPCODE_SET_TYPE_IMM
224+
Imm: 1
225+
- Opcode: REBASE_OPCODE_SET_SEGMENT_AND_OFFSET_ULEB
226+
Imm: 2
227+
ExtraData:
228+
- 0x0000000000000010
229+
- Opcode: REBASE_OPCODE_DO_REBASE_IMM_TIMES
230+
Imm: 1
231+
- Opcode: REBASE_OPCODE_DONE
232+
Imm: 0
233+
BindOpcodes:
234+
- Opcode: BIND_OPCODE_SET_DYLIB_ORDINAL_IMM
235+
Imm: 1
236+
Symbol: ''
237+
- Opcode: BIND_OPCODE_SET_SYMBOL_TRAILING_FLAGS_IMM
238+
Imm: 0
239+
Symbol: dyld_stub_binder
240+
- Opcode: BIND_OPCODE_SET_TYPE_IMM
241+
Imm: 1
242+
Symbol: ''
243+
- Opcode: BIND_OPCODE_SET_SEGMENT_AND_OFFSET_ULEB
244+
Imm: 2
245+
ULEBExtraData:
246+
- 0x0000000000000000
247+
Symbol: ''
248+
- Opcode: BIND_OPCODE_DO_BIND
249+
Imm: 0
250+
Symbol: ''
251+
- Opcode: BIND_OPCODE_DONE
252+
Imm: 0
253+
Symbol: ''
254+
LazyBindOpcodes:
255+
- Opcode: BIND_OPCODE_SET_SEGMENT_AND_OFFSET_ULEB
256+
Imm: 2
257+
ULEBExtraData:
258+
- 0x0000000000000010
259+
Symbol: ''
260+
- Opcode: BIND_OPCODE_SET_DYLIB_ORDINAL_IMM
261+
Imm: 1
262+
Symbol: ''
263+
- Opcode: BIND_OPCODE_SET_SYMBOL_TRAILING_FLAGS_IMM
264+
Imm: 0
265+
Symbol: _printf
266+
- Opcode: BIND_OPCODE_DO_BIND
267+
Imm: 0
268+
Symbol: ''
269+
- Opcode: BIND_OPCODE_DONE
270+
Imm: 0
271+
Symbol: ''
272+
- Opcode: BIND_OPCODE_DONE
273+
Imm: 0
274+
Symbol: ''
275+
- Opcode: BIND_OPCODE_DONE
276+
Imm: 0
277+
Symbol: ''
278+
ExportTrie:
279+
TerminalSize: 0
280+
NodeOffset: 0
281+
Name: ''
282+
Flags: 0x0000000000000000
283+
Address: 0x0000000000000000
284+
Other: 0x0000000000000000
285+
ImportName: ''
286+
Children:
287+
- TerminalSize: 0
288+
NodeOffset: 5
289+
Name: _
290+
Flags: 0x0000000000000000
291+
Address: 0x0000000000000000
292+
Other: 0x0000000000000000
293+
ImportName: ''
294+
Children:
295+
- TerminalSize: 2
296+
NodeOffset: 31
297+
Name: _mh_execute_header
298+
Flags: 0x0000000000000000
299+
Address: 0x0000000000000000
300+
Other: 0x0000000000000000
301+
ImportName: ''
302+
- TerminalSize: 0
303+
NodeOffset: 35
304+
Name: ma
305+
Flags: 0x0000000000000000
306+
Address: 0x0000000000000000
307+
Other: 0x0000000000000000
308+
ImportName: ''
309+
Children:
310+
- TerminalSize: 3
311+
NodeOffset: 48
312+
Name: ximum
313+
Flags: 0x0000000000000000
314+
Address: 0x0000000000000F00
315+
Other: 0x0000000000000000
316+
ImportName: ''
317+
- TerminalSize: 3
318+
NodeOffset: 53
319+
Name: in
320+
Flags: 0x0000000000000000
321+
Address: 0x0000000000000F40
322+
Other: 0x0000000000000000
323+
ImportName: ''
324+
NameList:
325+
- n_strx: 2
326+
n_type: 0x0F
327+
n_sect: 1
328+
n_desc: 16
329+
n_value: 4294967296
330+
- n_strx: 22
331+
n_type: 0x0F
332+
n_sect: 1
333+
n_desc: 0
334+
n_value: 4294971200
335+
- n_strx: 28
336+
n_type: 0x0F
337+
n_sect: 1
338+
n_desc: 0
339+
n_value: 4294971136
340+
- n_strx: 37
341+
n_type: 0x01
342+
n_sect: 0
343+
n_desc: 256
344+
n_value: 0
345+
- n_strx: 45
346+
n_type: 0x01
347+
n_sect: 0
348+
n_desc: 256
349+
n_value: 0
350+
StringTable:
351+
- ' '
352+
- __mh_execute_header
353+
- _main
354+
- _maximum
355+
- _printf
356+
- dyld_stub_binder
357+
- ''
358+
- ''
359+
...

0 commit comments

Comments
 (0)