peachsim 0.1.1915 → 0.1.1916
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist-lib/agent-daemon-client.cjs +1 -1
- package/dist-lib/agent-events.cjs +1 -1
- package/dist-lib/attached-projects.cjs +1 -1
- package/dist-lib/auth/shared-session.cjs +1 -1
- package/dist-lib/backend-origin.cjs +1 -1
- package/dist-lib/beta.cjs +1 -1
- package/dist-lib/beta.mjs +1 -1
- package/dist-lib/bridge-constants.cjs +1 -1
- package/dist-lib/bridge-contract-input.cjs +1 -1
- package/dist-lib/bridge-contract-input.mjs +1 -1
- package/dist-lib/bridge-contract.cjs +1 -1
- package/dist-lib/bridge-contract.mjs +1 -1
- package/dist-lib/bundle-channel.cjs +23 -12
- package/dist-lib/capture-contract.cjs +1 -1
- package/dist-lib/capture-contract.mjs +1 -1
- package/dist-lib/cloud-contract.cjs +1 -1
- package/dist-lib/cloud-contract.mjs +1 -1
- package/dist-lib/cloud-test-args.cjs +1 -1
- package/dist-lib/cloud-test-args.mjs +1 -1
- package/dist-lib/cloud.cjs +1 -1
- package/dist-lib/cloud.mjs +1 -1
- package/dist-lib/config.cjs +1 -1
- package/dist-lib/config.mjs +1 -1
- package/dist-lib/detox/index.cjs +1 -1
- package/dist-lib/dev-bundle-resolution.cjs +1 -1
- package/dist-lib/expo-swift-bundle.cjs +18 -7
- package/dist-lib/expo-swift-metadata.cjs +1 -1
- package/dist-lib/expo-swift-metadata.mjs +1 -1
- package/dist-lib/home-paths.cjs +1 -1
- package/dist-lib/host/bridge-host.cjs +23 -12
- package/dist-lib/host/fetch-proxy-handler.cjs +1 -1
- package/dist-lib/host/fetch-proxy-overrides.cjs +1 -1
- package/dist-lib/host/fetch-proxy-overrides.mjs +1 -1
- package/dist-lib/host/replacement-module-handler.cjs +1 -1
- package/dist-lib/host/websocket-proxy.cjs +1 -1
- package/dist-lib/index.cjs +2 -2
- package/dist-lib/jump-to-source-babel.cjs +1 -1
- package/dist-lib/jump-to-source-native.cjs +1 -1
- package/dist-lib/kotlin-host.cjs +1 -1
- package/dist-lib/menu.cjs +1 -1
- package/dist-lib/menu.mjs +1 -1
- package/dist-lib/metro-fingerprint-registry.cjs +1 -1
- package/dist-lib/metro-fingerprint-registry.mjs +1 -1
- package/dist-lib/metro-production-bundle.cjs +1 -1
- package/dist-lib/metro-production-bundle.mjs +1 -1
- package/dist-lib/metro.cjs +2 -2
- package/dist-lib/native-app-identity-project.cjs +2 -2
- package/dist-lib/native-app-identity-project.mjs +2 -2
- package/dist-lib/native-app-identity.cjs +1 -1
- package/dist-lib/native-app-identity.mjs +1 -1
- package/dist-lib/native-firebase-metadata.cjs +1 -1
- package/dist-lib/native-firebase-metadata.mjs +1 -1
- package/dist-lib/pdfium-raster.cjs +1 -1
- package/dist-lib/pdfium-raster.mjs +1 -1
- package/dist-lib/plist.cjs +1 -1
- package/dist-lib/plist.mjs +1 -1
- package/dist-lib/profiles.cjs +1 -1
- package/dist-lib/public-brand.cjs +1 -1
- package/dist-lib/public-origins-lib-esm.json +24 -24
- package/dist-lib/public-origins-lib.json +53 -53
- package/dist-lib/react-native-host-modules.cjs +1 -1
- package/dist-lib/react-native-host-modules.mjs +1 -1
- package/dist-lib/reap-browser.cjs +1 -1
- package/dist-lib/scripts/dev-server-scanner.cjs +1 -1
- package/dist-lib/sdk.cjs +1 -1
- package/dist-lib/sdk.mjs +1 -1
- package/dist-lib/skills.cjs +23 -12
- package/dist-lib/swift-compile.cjs +16 -5
- package/dist-lib/swift-compile.mjs +16 -5
- package/dist-lib/swift-package.cjs +1 -1
- package/dist-lib/swift-package.mjs +1 -1
- package/dist-lib/swift-submit.cjs +1 -1
- package/dist-lib/swift-submit.mjs +1 -1
- package/dist-lib/swift-toolchain.cjs +1 -1
- package/dist-lib/swift.cjs +1 -1
- package/dist-lib/vite-swift.cjs +17 -6
- package/dist-lib/vite.cjs +1 -1
- package/dist-lib/worklet-executable.cjs +1 -1
- package/dist-lib/worklet-executable.mjs +1 -1
- package/dist-types/packages/peach-engine/src/engine/canvaskit-renderer.d.ts +1 -0
- package/dist-types/packages/peach-engine/src/engine/scene-table.d.ts +1 -1
- package/package.json +1 -1
- package/sdk/ios/usr/include/MachO.modulemap +22 -0
- package/sdk/ios/usr/include/mach-o/arm/reloc.h +67 -0
- package/sdk/ios/usr/include/mach-o/arm64/reloc.h +254 -0
- package/sdk/ios/usr/include/mach-o/dyld.h +265 -11
- package/sdk/ios/usr/include/mach-o/fixup-chains.h +362 -0
- package/sdk/ios/usr/include/mach-o/ldsyms.h +133 -0
- package/sdk/ios/usr/include/mach-o/nlist.h +315 -29
- package/sdk/ios/usr/include/mach-o/ranlib.h +90 -0
- package/sdk/ios/usr/include/mach-o/reloc.h +203 -0
- package/sdk/ios/usr/include/mach-o/swap.h +284 -0
- package/sdk/ios/usr/include/mach-o/x86_64/reloc.h +191 -0
- package/sdk/ios/usr/include/module.modulemap +1 -0
- package/src/nitro-adapter.lock.json +277 -277
- package/src/nitro-superset.lock.json +4 -4
- package/src/swift-distribution.lock.json +11 -11
- package/src/swift-guest-image-ledger.ts +1 -1
- package/src/swift-shared-sdk.ts +12 -1
- package/src/turbo-runtime.lock.json +21 -21
|
@@ -0,0 +1,203 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 1999 Apple Computer, Inc. All rights reserved.
|
|
3
|
+
*
|
|
4
|
+
* @APPLE_LICENSE_HEADER_START@
|
|
5
|
+
*
|
|
6
|
+
* This file contains Original Code and/or Modifications of Original Code
|
|
7
|
+
* as defined in and that are subject to the Apple Public Source License
|
|
8
|
+
* Version 2.0 (the 'License'). You may not use this file except in
|
|
9
|
+
* compliance with the License. Please obtain a copy of the License at
|
|
10
|
+
* http://www.opensource.apple.com/apsl/ and read it before using this
|
|
11
|
+
* file.
|
|
12
|
+
*
|
|
13
|
+
* The Original Code and all software distributed under the License are
|
|
14
|
+
* distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
|
|
15
|
+
* EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
|
|
16
|
+
* INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
* FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
|
|
18
|
+
* Please see the License for the specific language governing rights and
|
|
19
|
+
* limitations under the License.
|
|
20
|
+
*
|
|
21
|
+
* @APPLE_LICENSE_HEADER_END@
|
|
22
|
+
*/
|
|
23
|
+
/* $NetBSD: exec.h,v 1.6 1994/10/27 04:16:05 cgd Exp $ */
|
|
24
|
+
|
|
25
|
+
/*
|
|
26
|
+
* Copyright (c) 1993 Christopher G. Demetriou
|
|
27
|
+
* All rights reserved.
|
|
28
|
+
*
|
|
29
|
+
* Redistribution and use in source and binary forms, with or without
|
|
30
|
+
* modification, are permitted provided that the following conditions
|
|
31
|
+
* are met:
|
|
32
|
+
* 1. Redistributions of source code must retain the above copyright
|
|
33
|
+
* notice, this list of conditions and the following disclaimer.
|
|
34
|
+
* 2. Redistributions in binary form must reproduce the above copyright
|
|
35
|
+
* notice, this list of conditions and the following disclaimer in the
|
|
36
|
+
* documentation and/or other materials provided with the distribution.
|
|
37
|
+
* 3. The name of the author may not be used to endorse or promote products
|
|
38
|
+
* derived from this software without specific prior written permission
|
|
39
|
+
*
|
|
40
|
+
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
|
|
41
|
+
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
|
42
|
+
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
|
43
|
+
* IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
|
|
44
|
+
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
|
45
|
+
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
|
46
|
+
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
|
47
|
+
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|
48
|
+
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
|
49
|
+
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
50
|
+
*/
|
|
51
|
+
|
|
52
|
+
#ifndef _MACHO_RELOC_H_
|
|
53
|
+
#define _MACHO_RELOC_H_
|
|
54
|
+
#include <stdint.h>
|
|
55
|
+
|
|
56
|
+
/*
|
|
57
|
+
* Format of a relocation entry of a Mach-O file. Modified from the 4.3BSD
|
|
58
|
+
* format. The modifications from the original format were changing the value
|
|
59
|
+
* of the r_symbolnum field for "local" (r_extern == 0) relocation entries.
|
|
60
|
+
* This modification is required to support symbols in an arbitrary number of
|
|
61
|
+
* sections not just the three sections (text, data and bss) in a 4.3BSD file.
|
|
62
|
+
* Also the last 4 bits have had the r_type tag added to them.
|
|
63
|
+
*/
|
|
64
|
+
struct relocation_info {
|
|
65
|
+
int32_t r_address; /* offset in the section to what is being
|
|
66
|
+
relocated */
|
|
67
|
+
uint32_t r_symbolnum:24, /* symbol index if r_extern == 1 or section
|
|
68
|
+
ordinal if r_extern == 0 */
|
|
69
|
+
r_pcrel:1, /* was relocated pc relative already */
|
|
70
|
+
r_length:2, /* 0=byte, 1=word, 2=long, 3=quad */
|
|
71
|
+
r_extern:1, /* does not include value of sym referenced */
|
|
72
|
+
r_type:4; /* if not 0, machine specific relocation type */
|
|
73
|
+
};
|
|
74
|
+
#define R_ABS 0 /* absolute relocation type for Mach-O files */
|
|
75
|
+
|
|
76
|
+
/*
|
|
77
|
+
* The r_address is not really the address as it's name indicates but an offset.
|
|
78
|
+
* In 4.3BSD a.out objects this offset is from the start of the "segment" for
|
|
79
|
+
* which relocation entry is for (text or data). For Mach-O object files it is
|
|
80
|
+
* also an offset but from the start of the "section" for which the relocation
|
|
81
|
+
* entry is for. See comments in <mach-o/loader.h> about the r_address feild
|
|
82
|
+
* in images for used with the dynamic linker.
|
|
83
|
+
*
|
|
84
|
+
* In 4.3BSD a.out objects if r_extern is zero then r_symbolnum is an ordinal
|
|
85
|
+
* for the segment the symbol being relocated is in. These ordinals are the
|
|
86
|
+
* symbol types N_TEXT, N_DATA, N_BSS or N_ABS. In Mach-O object files these
|
|
87
|
+
* ordinals refer to the sections in the object file in the order their section
|
|
88
|
+
* structures appear in the headers of the object file they are in. The first
|
|
89
|
+
* section has the ordinal 1, the second 2, and so on. This means that the
|
|
90
|
+
* same ordinal in two different object files could refer to two different
|
|
91
|
+
* sections. And further could have still different ordinals when combined
|
|
92
|
+
* by the link-editor. The value R_ABS is used for relocation entries for
|
|
93
|
+
* absolute symbols which need no further relocation.
|
|
94
|
+
*/
|
|
95
|
+
|
|
96
|
+
/*
|
|
97
|
+
* For RISC machines some of the references are split across two instructions
|
|
98
|
+
* and the instruction does not contain the complete value of the reference.
|
|
99
|
+
* In these cases a second, or paired relocation entry, follows each of these
|
|
100
|
+
* relocation entries, using a PAIR r_type, which contains the other part of the
|
|
101
|
+
* reference not contained in the instruction. This other part is stored in the
|
|
102
|
+
* pair's r_address field. The exact number of bits of the other part of the
|
|
103
|
+
* reference store in the r_address field is dependent on the particular
|
|
104
|
+
* relocation type for the particular architecture.
|
|
105
|
+
*/
|
|
106
|
+
|
|
107
|
+
/*
|
|
108
|
+
* To make scattered loading by the link editor work correctly "local"
|
|
109
|
+
* relocation entries can't be used when the item to be relocated is the value
|
|
110
|
+
* of a symbol plus an offset (where the resulting expresion is outside the
|
|
111
|
+
* block the link editor is moving, a blocks are divided at symbol addresses).
|
|
112
|
+
* In this case. where the item is a symbol value plus offset, the link editor
|
|
113
|
+
* needs to know more than just the section the symbol was defined. What is
|
|
114
|
+
* needed is the actual value of the symbol without the offset so it can do the
|
|
115
|
+
* relocation correctly based on where the value of the symbol got relocated to
|
|
116
|
+
* not the value of the expression (with the offset added to the symbol value).
|
|
117
|
+
* So for the NeXT 2.0 release no "local" relocation entries are ever used when
|
|
118
|
+
* there is a non-zero offset added to a symbol. The "external" and "local"
|
|
119
|
+
* relocation entries remain unchanged.
|
|
120
|
+
*
|
|
121
|
+
* The implemention is quite messy given the compatibility with the existing
|
|
122
|
+
* relocation entry format. The ASSUMPTION is that a section will never be
|
|
123
|
+
* bigger than 2**24 - 1 (0x00ffffff or 16,777,215) bytes. This assumption
|
|
124
|
+
* allows the r_address (which is really an offset) to fit in 24 bits and high
|
|
125
|
+
* bit of the r_address field in the relocation_info structure to indicate
|
|
126
|
+
* it is really a scattered_relocation_info structure. Since these are only
|
|
127
|
+
* used in places where "local" relocation entries are used and not where
|
|
128
|
+
* "external" relocation entries are used the r_extern field has been removed.
|
|
129
|
+
*
|
|
130
|
+
* For scattered loading to work on a RISC machine where some of the references
|
|
131
|
+
* are split across two instructions the link editor needs to be assured that
|
|
132
|
+
* each reference has a unique 32 bit reference (that more than one reference is
|
|
133
|
+
* NOT sharing the same high 16 bits for example) so it move each referenced
|
|
134
|
+
* item independent of each other. Some compilers guarantees this but the
|
|
135
|
+
* compilers don't so scattered loading can be done on those that do guarantee
|
|
136
|
+
* this.
|
|
137
|
+
*/
|
|
138
|
+
#if defined(__BIG_ENDIAN__) || defined(__LITTLE_ENDIAN__)
|
|
139
|
+
/*
|
|
140
|
+
* The reason for the ifdef's of __BIG_ENDIAN__ and __LITTLE_ENDIAN__ are that
|
|
141
|
+
* when stattered relocation entries were added the mistake of using a mask
|
|
142
|
+
* against a structure that is made up of bit fields was used. To make this
|
|
143
|
+
* design work this structure must be laid out in memory the same way so the
|
|
144
|
+
* mask can be applied can check the same bit each time (r_scattered).
|
|
145
|
+
*/
|
|
146
|
+
#endif /* defined(__BIG_ENDIAN__) || defined(__LITTLE_ENDIAN__) */
|
|
147
|
+
#define R_SCATTERED 0x80000000 /* mask to be applied to the r_address field
|
|
148
|
+
of a relocation_info structure to tell that
|
|
149
|
+
is is really a scattered_relocation_info
|
|
150
|
+
stucture */
|
|
151
|
+
struct scattered_relocation_info {
|
|
152
|
+
#ifdef __BIG_ENDIAN__
|
|
153
|
+
uint32_t r_scattered:1, /* 1=scattered, 0=non-scattered (see above) */
|
|
154
|
+
r_pcrel:1, /* was relocated pc relative already */
|
|
155
|
+
r_length:2, /* 0=byte, 1=word, 2=long, 3=quad */
|
|
156
|
+
r_type:4, /* if not 0, machine specific relocation type */
|
|
157
|
+
r_address:24; /* offset in the section to what is being
|
|
158
|
+
relocated */
|
|
159
|
+
int32_t r_value; /* the value the item to be relocated is
|
|
160
|
+
refering to (without any offset added) */
|
|
161
|
+
#endif /* __BIG_ENDIAN__ */
|
|
162
|
+
#ifdef __LITTLE_ENDIAN__
|
|
163
|
+
uint32_t
|
|
164
|
+
r_address:24, /* offset in the section to what is being
|
|
165
|
+
relocated */
|
|
166
|
+
r_type:4, /* if not 0, machine specific relocation type */
|
|
167
|
+
r_length:2, /* 0=byte, 1=word, 2=long, 3=quad */
|
|
168
|
+
r_pcrel:1, /* was relocated pc relative already */
|
|
169
|
+
r_scattered:1; /* 1=scattered, 0=non-scattered (see above) */
|
|
170
|
+
int32_t r_value; /* the value the item to be relocated is
|
|
171
|
+
refering to (without any offset added) */
|
|
172
|
+
#endif /* __LITTLE_ENDIAN__ */
|
|
173
|
+
};
|
|
174
|
+
|
|
175
|
+
/*
|
|
176
|
+
* Relocation types used in a generic implementation. Relocation entries for
|
|
177
|
+
* normal things use the generic relocation as discribed above and their r_type
|
|
178
|
+
* is GENERIC_RELOC_VANILLA (a value of zero).
|
|
179
|
+
*
|
|
180
|
+
* Another type of generic relocation, GENERIC_RELOC_SECTDIFF, is to support
|
|
181
|
+
* the difference of two symbols defined in different sections. That is the
|
|
182
|
+
* expression "symbol1 - symbol2 + constant" is a relocatable expression when
|
|
183
|
+
* both symbols are defined in some section. For this type of relocation the
|
|
184
|
+
* both relocations entries are scattered relocation entries. The value of
|
|
185
|
+
* symbol1 is stored in the first relocation entry's r_value field and the
|
|
186
|
+
* value of symbol2 is stored in the pair's r_value field.
|
|
187
|
+
*
|
|
188
|
+
* A special case for a prebound lazy pointer is needed to beable to set the
|
|
189
|
+
* value of the lazy pointer back to its non-prebound state. This is done
|
|
190
|
+
* using the GENERIC_RELOC_PB_LA_PTR r_type. This is a scattered relocation
|
|
191
|
+
* entry where the r_value feild is the value of the lazy pointer not prebound.
|
|
192
|
+
*/
|
|
193
|
+
enum reloc_type_generic
|
|
194
|
+
{
|
|
195
|
+
GENERIC_RELOC_VANILLA, /* generic relocation as discribed above */
|
|
196
|
+
GENERIC_RELOC_PAIR, /* Only follows a GENERIC_RELOC_SECTDIFF */
|
|
197
|
+
GENERIC_RELOC_SECTDIFF,
|
|
198
|
+
GENERIC_RELOC_PB_LA_PTR, /* prebound lazy pointer */
|
|
199
|
+
GENERIC_RELOC_LOCAL_SECTDIFF,
|
|
200
|
+
GENERIC_RELOC_TLV /* thread local variables */
|
|
201
|
+
};
|
|
202
|
+
|
|
203
|
+
#endif /* _MACHO_RELOC_H_ */
|
|
@@ -0,0 +1,284 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 1999 Apple Computer, Inc. All rights reserved.
|
|
3
|
+
*
|
|
4
|
+
* @APPLE_LICENSE_HEADER_START@
|
|
5
|
+
*
|
|
6
|
+
* This file contains Original Code and/or Modifications of Original Code
|
|
7
|
+
* as defined in and that are subject to the Apple Public Source License
|
|
8
|
+
* Version 2.0 (the 'License'). You may not use this file except in
|
|
9
|
+
* compliance with the License. Please obtain a copy of the License at
|
|
10
|
+
* http://www.opensource.apple.com/apsl/ and read it before using this
|
|
11
|
+
* file.
|
|
12
|
+
*
|
|
13
|
+
* The Original Code and all software distributed under the License are
|
|
14
|
+
* distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
|
|
15
|
+
* EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
|
|
16
|
+
* INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
* FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
|
|
18
|
+
* Please see the License for the specific language governing rights and
|
|
19
|
+
* limitations under the License.
|
|
20
|
+
*
|
|
21
|
+
* @APPLE_LICENSE_HEADER_END@
|
|
22
|
+
*/
|
|
23
|
+
#ifndef _MACH_O_SWAP_H_
|
|
24
|
+
#define _MACH_O_SWAP_H_
|
|
25
|
+
|
|
26
|
+
#include <stdint.h>
|
|
27
|
+
#include <architecture/byte_order.h>
|
|
28
|
+
#include <mach-o/fat.h>
|
|
29
|
+
#include <mach-o/loader.h>
|
|
30
|
+
#include <mach-o/nlist.h>
|
|
31
|
+
#include <mach-o/reloc.h>
|
|
32
|
+
#include <mach-o/ranlib.h>
|
|
33
|
+
#include <Availability.h>
|
|
34
|
+
#include <TargetConditionals.h>
|
|
35
|
+
|
|
36
|
+
#ifndef __CCTOOLS_DEPRECATED
|
|
37
|
+
#define __CCTOOLS_DEPRECATED __API_DEPRECATED("No longer supported", macos(10.0, 13.0), ios(1.0, 16.0), watchos(1.0, 8.0), tvos(1.0, 16.0))
|
|
38
|
+
#define __CCTOOLS_DEPRECATED_MSG(_msg) __API_DEPRECATED_WITH_REPLACEMENT(_msg, macos(10.0, 13.0), ios(1.0, 16.0), watchos(1.0, 8.0), tvos(1.0, 16.0))
|
|
39
|
+
#endif
|
|
40
|
+
|
|
41
|
+
#ifdef __cplusplus
|
|
42
|
+
extern "C" {
|
|
43
|
+
#endif /* __cplusplus */
|
|
44
|
+
|
|
45
|
+
extern void swap_fat_header(
|
|
46
|
+
struct fat_header *fat_header,
|
|
47
|
+
enum NXByteOrder target_byte_order) __CCTOOLS_DEPRECATED_MSG("use macho_for_each_slice()");
|
|
48
|
+
|
|
49
|
+
extern void swap_fat_arch(
|
|
50
|
+
struct fat_arch *fat_archs,
|
|
51
|
+
uint32_t nfat_arch,
|
|
52
|
+
enum NXByteOrder target_byte_order) __CCTOOLS_DEPRECATED_MSG("use macho_for_each_slice()");
|
|
53
|
+
|
|
54
|
+
extern void swap_fat_arch_64(
|
|
55
|
+
struct fat_arch_64 *fat_archs64,
|
|
56
|
+
uint32_t nfat_arch,
|
|
57
|
+
enum NXByteOrder target_byte_order) __CCTOOLS_DEPRECATED_MSG("use macho_for_each_slice()");
|
|
58
|
+
|
|
59
|
+
extern void swap_mach_header(
|
|
60
|
+
struct mach_header *mh,
|
|
61
|
+
enum NXByteOrder target_byte_order) __CCTOOLS_DEPRECATED;
|
|
62
|
+
|
|
63
|
+
extern void swap_mach_header_64(
|
|
64
|
+
struct mach_header_64 *mh,
|
|
65
|
+
enum NXByteOrder target_byte_order) __CCTOOLS_DEPRECATED;
|
|
66
|
+
|
|
67
|
+
extern void swap_load_command(
|
|
68
|
+
struct load_command *lc,
|
|
69
|
+
enum NXByteOrder target_byte_order) __CCTOOLS_DEPRECATED;
|
|
70
|
+
|
|
71
|
+
extern void swap_segment_command(
|
|
72
|
+
struct segment_command *sg,
|
|
73
|
+
enum NXByteOrder target_byte_order) __CCTOOLS_DEPRECATED;
|
|
74
|
+
|
|
75
|
+
extern void swap_segment_command_64(
|
|
76
|
+
struct segment_command_64 *sg,
|
|
77
|
+
enum NXByteOrder target_byte_order) __CCTOOLS_DEPRECATED;
|
|
78
|
+
|
|
79
|
+
extern void swap_section(
|
|
80
|
+
struct section *s,
|
|
81
|
+
uint32_t nsects,
|
|
82
|
+
enum NXByteOrder target_byte_order) __CCTOOLS_DEPRECATED;
|
|
83
|
+
|
|
84
|
+
extern void swap_section_64(
|
|
85
|
+
struct section_64 *s,
|
|
86
|
+
uint32_t nsects,
|
|
87
|
+
enum NXByteOrder target_byte_order) __CCTOOLS_DEPRECATED;
|
|
88
|
+
|
|
89
|
+
extern void swap_symtab_command(
|
|
90
|
+
struct symtab_command *st,
|
|
91
|
+
enum NXByteOrder target_byte_order) __CCTOOLS_DEPRECATED;
|
|
92
|
+
|
|
93
|
+
extern void swap_dysymtab_command(
|
|
94
|
+
struct dysymtab_command *dyst,
|
|
95
|
+
enum NXByteOrder target_byte_sex) __CCTOOLS_DEPRECATED;
|
|
96
|
+
|
|
97
|
+
extern void swap_symseg_command(
|
|
98
|
+
struct symseg_command *ss,
|
|
99
|
+
enum NXByteOrder target_byte_order) __CCTOOLS_DEPRECATED;
|
|
100
|
+
|
|
101
|
+
extern void swap_fvmlib_command(
|
|
102
|
+
struct fvmlib_command *fl,
|
|
103
|
+
enum NXByteOrder target_byte_order) __CCTOOLS_DEPRECATED;
|
|
104
|
+
|
|
105
|
+
extern void swap_dylib_command(
|
|
106
|
+
struct dylib_command *dl,
|
|
107
|
+
enum NXByteOrder target_byte_sex) __CCTOOLS_DEPRECATED;
|
|
108
|
+
|
|
109
|
+
extern void swap_sub_framework_command(
|
|
110
|
+
struct sub_framework_command *sub,
|
|
111
|
+
enum NXByteOrder target_byte_sex) __CCTOOLS_DEPRECATED;
|
|
112
|
+
|
|
113
|
+
extern void swap_sub_umbrella_command(
|
|
114
|
+
struct sub_umbrella_command *usub,
|
|
115
|
+
enum NXByteOrder target_byte_sex) __CCTOOLS_DEPRECATED;
|
|
116
|
+
|
|
117
|
+
extern void swap_sub_library_command(
|
|
118
|
+
struct sub_library_command *lsub,
|
|
119
|
+
enum NXByteOrder target_byte_sex) __CCTOOLS_DEPRECATED;
|
|
120
|
+
|
|
121
|
+
extern void swap_sub_client_command(
|
|
122
|
+
struct sub_client_command *csub,
|
|
123
|
+
enum NXByteOrder target_byte_sex) __CCTOOLS_DEPRECATED;
|
|
124
|
+
|
|
125
|
+
extern void swap_prebound_dylib_command(
|
|
126
|
+
struct prebound_dylib_command *pbdylib,
|
|
127
|
+
enum NXByteOrder target_byte_sex) __CCTOOLS_DEPRECATED;
|
|
128
|
+
|
|
129
|
+
extern void swap_dylinker_command(
|
|
130
|
+
struct dylinker_command *dyld,
|
|
131
|
+
enum NXByteOrder target_byte_sex) __CCTOOLS_DEPRECATED;
|
|
132
|
+
|
|
133
|
+
extern void swap_fvmfile_command(
|
|
134
|
+
struct fvmfile_command *ff,
|
|
135
|
+
enum NXByteOrder target_byte_order) __CCTOOLS_DEPRECATED;
|
|
136
|
+
|
|
137
|
+
extern void swap_thread_command(
|
|
138
|
+
struct thread_command *ut,
|
|
139
|
+
enum NXByteOrder target_byte_order) __CCTOOLS_DEPRECATED;
|
|
140
|
+
|
|
141
|
+
extern void swap_ident_command(
|
|
142
|
+
struct ident_command *ident,
|
|
143
|
+
enum NXByteOrder target_byte_order) __CCTOOLS_DEPRECATED;
|
|
144
|
+
|
|
145
|
+
extern void swap_routines_command(
|
|
146
|
+
struct routines_command *r_cmd,
|
|
147
|
+
enum NXByteOrder target_byte_sex) __CCTOOLS_DEPRECATED;
|
|
148
|
+
|
|
149
|
+
extern void swap_routines_command_64(
|
|
150
|
+
struct routines_command_64 *r_cmd,
|
|
151
|
+
enum NXByteOrder target_byte_sex) __CCTOOLS_DEPRECATED;
|
|
152
|
+
|
|
153
|
+
extern void swap_twolevel_hints_command(
|
|
154
|
+
struct twolevel_hints_command *hints_cmd,
|
|
155
|
+
enum NXByteOrder target_byte_sex) __CCTOOLS_DEPRECATED;
|
|
156
|
+
|
|
157
|
+
extern void swap_prebind_cksum_command(
|
|
158
|
+
struct prebind_cksum_command *cksum_cmd,
|
|
159
|
+
enum NXByteOrder target_byte_sex) __CCTOOLS_DEPRECATED;
|
|
160
|
+
|
|
161
|
+
extern void swap_uuid_command(
|
|
162
|
+
struct uuid_command *uuid_cmd,
|
|
163
|
+
enum NXByteOrder target_byte_sex) __CCTOOLS_DEPRECATED;
|
|
164
|
+
|
|
165
|
+
extern void swap_linkedit_data_command(
|
|
166
|
+
struct linkedit_data_command *ld,
|
|
167
|
+
enum NXByteOrder target_byte_sex) __CCTOOLS_DEPRECATED;
|
|
168
|
+
|
|
169
|
+
extern void swap_version_min_command(
|
|
170
|
+
struct version_min_command *ver_cmd,
|
|
171
|
+
enum NXByteOrder target_byte_sex) __CCTOOLS_DEPRECATED;
|
|
172
|
+
extern void swap_rpath_command(
|
|
173
|
+
struct rpath_command *rpath_cmd,
|
|
174
|
+
enum NXByteOrder target_byte_sex) __CCTOOLS_DEPRECATED;
|
|
175
|
+
|
|
176
|
+
extern void swap_encryption_command(
|
|
177
|
+
struct encryption_info_command *ec,
|
|
178
|
+
enum NXByteOrder target_byte_sex) __CCTOOLS_DEPRECATED;
|
|
179
|
+
|
|
180
|
+
extern void swap_encryption_command_64(
|
|
181
|
+
struct encryption_info_command_64 *ec,
|
|
182
|
+
enum NXByteOrder target_byte_sex) __CCTOOLS_DEPRECATED;
|
|
183
|
+
|
|
184
|
+
extern void swap_linker_option_command(
|
|
185
|
+
struct linker_option_command *lo,
|
|
186
|
+
enum NXByteOrder target_byte_sex) __CCTOOLS_DEPRECATED;
|
|
187
|
+
|
|
188
|
+
extern void swap_dyld_info_command(
|
|
189
|
+
struct dyld_info_command *ed,
|
|
190
|
+
enum NXByteOrder target_byte_sex) __CCTOOLS_DEPRECATED;
|
|
191
|
+
|
|
192
|
+
extern void swap_entry_point_command(
|
|
193
|
+
struct entry_point_command *ep,
|
|
194
|
+
enum NXByteOrder target_byte_sex) __CCTOOLS_DEPRECATED;
|
|
195
|
+
|
|
196
|
+
extern void swap_source_version_command(
|
|
197
|
+
struct source_version_command *sv,
|
|
198
|
+
enum NXByteOrder target_byte_sex) __CCTOOLS_DEPRECATED;
|
|
199
|
+
|
|
200
|
+
extern void swap_note_command(
|
|
201
|
+
struct note_command *nc,
|
|
202
|
+
enum NXByteOrder target_byte_sex) __CCTOOLS_DEPRECATED;
|
|
203
|
+
|
|
204
|
+
extern void swap_build_version_command(
|
|
205
|
+
struct build_version_command *bv,
|
|
206
|
+
enum NXByteOrder target_byte_sex) __CCTOOLS_DEPRECATED;
|
|
207
|
+
|
|
208
|
+
extern void swap_build_tool_version(
|
|
209
|
+
struct build_tool_version *bt,
|
|
210
|
+
uint32_t ntools,
|
|
211
|
+
enum NXByteOrder target_byte_sex) __CCTOOLS_DEPRECATED;
|
|
212
|
+
|
|
213
|
+
extern void swap_prebind_cksum_command(
|
|
214
|
+
struct prebind_cksum_command *cksum_cmd,
|
|
215
|
+
enum NXByteOrder target_byte_sex) __CCTOOLS_DEPRECATED;
|
|
216
|
+
|
|
217
|
+
extern void swap_uuid_command(
|
|
218
|
+
struct uuid_command *uuid_cmd,
|
|
219
|
+
enum NXByteOrder target_byte_sex) __CCTOOLS_DEPRECATED;
|
|
220
|
+
|
|
221
|
+
extern void swap_twolevel_hint(
|
|
222
|
+
struct twolevel_hint *hints,
|
|
223
|
+
uint32_t nhints,
|
|
224
|
+
enum NXByteOrder target_byte_sex) __CCTOOLS_DEPRECATED;
|
|
225
|
+
|
|
226
|
+
extern void swap_fileset_entry_command(
|
|
227
|
+
struct fileset_entry_command *lc,
|
|
228
|
+
enum NXByteOrder target_byte_sex) __CCTOOLS_DEPRECATED;
|
|
229
|
+
|
|
230
|
+
extern void swap_nlist(
|
|
231
|
+
struct nlist *symbols,
|
|
232
|
+
uint32_t nsymbols,
|
|
233
|
+
enum NXByteOrder target_byte_order) __CCTOOLS_DEPRECATED;
|
|
234
|
+
|
|
235
|
+
extern void swap_nlist_64(
|
|
236
|
+
struct nlist_64 *symbols,
|
|
237
|
+
uint32_t nsymbols,
|
|
238
|
+
enum NXByteOrder target_byte_order) __CCTOOLS_DEPRECATED;
|
|
239
|
+
|
|
240
|
+
extern void swap_ranlib(
|
|
241
|
+
struct ranlib *ranlibs,
|
|
242
|
+
uint32_t nranlibs,
|
|
243
|
+
enum NXByteOrder target_byte_order) __CCTOOLS_DEPRECATED;
|
|
244
|
+
|
|
245
|
+
extern void swap_ranlib_64(
|
|
246
|
+
struct ranlib_64 *ranlibs,
|
|
247
|
+
uint64_t nranlibs,
|
|
248
|
+
enum NXByteOrder target_byte_order) __CCTOOLS_DEPRECATED;
|
|
249
|
+
|
|
250
|
+
extern void swap_relocation_info(
|
|
251
|
+
struct relocation_info *relocs,
|
|
252
|
+
uint32_t nrelocs,
|
|
253
|
+
enum NXByteOrder target_byte_order) __CCTOOLS_DEPRECATED;
|
|
254
|
+
|
|
255
|
+
extern void swap_indirect_symbols(
|
|
256
|
+
uint32_t *indirect_symbols,
|
|
257
|
+
uint32_t nindirect_symbols,
|
|
258
|
+
enum NXByteOrder target_byte_sex) __CCTOOLS_DEPRECATED;
|
|
259
|
+
|
|
260
|
+
extern void swap_dylib_reference(
|
|
261
|
+
struct dylib_reference *refs,
|
|
262
|
+
uint32_t nrefs,
|
|
263
|
+
enum NXByteOrder target_byte_sex) __CCTOOLS_DEPRECATED;
|
|
264
|
+
|
|
265
|
+
extern void swap_dylib_module(
|
|
266
|
+
struct dylib_module *mods,
|
|
267
|
+
uint32_t nmods,
|
|
268
|
+
enum NXByteOrder target_byte_sex) __CCTOOLS_DEPRECATED;
|
|
269
|
+
|
|
270
|
+
extern void swap_dylib_module_64(
|
|
271
|
+
struct dylib_module_64 *mods,
|
|
272
|
+
uint32_t nmods,
|
|
273
|
+
enum NXByteOrder target_byte_sex) __CCTOOLS_DEPRECATED;
|
|
274
|
+
|
|
275
|
+
extern void swap_dylib_table_of_contents(
|
|
276
|
+
struct dylib_table_of_contents *tocs,
|
|
277
|
+
uint32_t ntocs,
|
|
278
|
+
enum NXByteOrder target_byte_sex) __CCTOOLS_DEPRECATED;
|
|
279
|
+
|
|
280
|
+
#ifdef __cplusplus
|
|
281
|
+
}
|
|
282
|
+
#endif /* __cplusplus */
|
|
283
|
+
|
|
284
|
+
#endif /* _MACH_O_SWAP_H_ */
|
|
@@ -0,0 +1,191 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2006 Apple Computer, Inc. All rights reserved.
|
|
3
|
+
*
|
|
4
|
+
* @APPLE_LICENSE_HEADER_START@
|
|
5
|
+
*
|
|
6
|
+
* This file contains Original Code and/or Modifications of Original Code
|
|
7
|
+
* as defined in and that are subject to the Apple Public Source License
|
|
8
|
+
* Version 2.0 (the 'License'). You may not use this file except in
|
|
9
|
+
* compliance with the License. Please obtain a copy of the License at
|
|
10
|
+
* http://www.opensource.apple.com/apsl/ and read it before using this
|
|
11
|
+
* file.
|
|
12
|
+
*
|
|
13
|
+
* The Original Code and all software distributed under the License are
|
|
14
|
+
* distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
|
|
15
|
+
* EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
|
|
16
|
+
* INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
* FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
|
|
18
|
+
* Please see the License for the specific language governing rights and
|
|
19
|
+
* limitations under the License.
|
|
20
|
+
*
|
|
21
|
+
* @APPLE_LICENSE_HEADER_END@
|
|
22
|
+
*/
|
|
23
|
+
|
|
24
|
+
#ifndef _MACHO_X86_64_RELOC_H_
|
|
25
|
+
#define _MACHO_X86_64_RELOC_H_
|
|
26
|
+
|
|
27
|
+
/*
|
|
28
|
+
* Relocations for x86_64 are a bit different than for other architectures in
|
|
29
|
+
* Mach-O: Scattered relocations are not used. Almost all relocations produced
|
|
30
|
+
* by the compiler are external relocations. An external relocation has the
|
|
31
|
+
* r_extern bit set to 1 and the r_symbolnum field contains the symbol table
|
|
32
|
+
* index of the target label.
|
|
33
|
+
*
|
|
34
|
+
* When the assembler is generating relocations, if the target label is a local
|
|
35
|
+
* label (begins with 'L'), then the previous non-local label in the same
|
|
36
|
+
* section is used as the target of the external relocation. An addend is used
|
|
37
|
+
* with the distance from that non-local label to the target label. Only when
|
|
38
|
+
* there is no previous non-local label in the section is an internal
|
|
39
|
+
* relocation used.
|
|
40
|
+
*
|
|
41
|
+
* The addend (i.e. the 4 in _foo+4) is encoded in the instruction (Mach-O does
|
|
42
|
+
* not have RELA relocations). For PC-relative relocations, the addend is
|
|
43
|
+
* stored directly in the instruction. This is different from other Mach-O
|
|
44
|
+
* architectures, which encode the addend minus the current section offset.
|
|
45
|
+
*
|
|
46
|
+
* The relocation types are:
|
|
47
|
+
*
|
|
48
|
+
* X86_64_RELOC_UNSIGNED // for absolute addresses
|
|
49
|
+
* X86_64_RELOC_SIGNED // for signed 32-bit displacement
|
|
50
|
+
* X86_64_RELOC_BRANCH // a CALL/JMP instruction with 32-bit displacement
|
|
51
|
+
* X86_64_RELOC_GOT_LOAD // a MOVQ load of a GOT entry
|
|
52
|
+
* X86_64_RELOC_GOT // other GOT references
|
|
53
|
+
* X86_64_RELOC_SUBTRACTOR // must be followed by a X86_64_RELOC_UNSIGNED
|
|
54
|
+
*
|
|
55
|
+
* The following are sample assembly instructions, followed by the relocation
|
|
56
|
+
* and section content they generate in an object file:
|
|
57
|
+
*
|
|
58
|
+
* call _foo
|
|
59
|
+
* r_type=X86_64_RELOC_BRANCH, r_length=2, r_extern=1, r_pcrel=1, r_symbolnum=_foo
|
|
60
|
+
* E8 00 00 00 00
|
|
61
|
+
*
|
|
62
|
+
* call _foo+4
|
|
63
|
+
* r_type=X86_64_RELOC_BRANCH, r_length=2, r_extern=1, r_pcrel=1, r_symbolnum=_foo
|
|
64
|
+
* E8 04 00 00 00
|
|
65
|
+
*
|
|
66
|
+
* movq _foo@GOTPCREL(%rip), %rax
|
|
67
|
+
* r_type=X86_64_RELOC_GOT_LOAD, r_length=2, r_extern=1, r_pcrel=1, r_symbolnum=_foo
|
|
68
|
+
* 48 8B 05 00 00 00 00
|
|
69
|
+
*
|
|
70
|
+
* pushq _foo@GOTPCREL(%rip)
|
|
71
|
+
* r_type=X86_64_RELOC_GOT, r_length=2, r_extern=1, r_pcrel=1, r_symbolnum=_foo
|
|
72
|
+
* FF 35 00 00 00 00
|
|
73
|
+
*
|
|
74
|
+
* movl _foo(%rip), %eax
|
|
75
|
+
* r_type=X86_64_RELOC_SIGNED, r_length=2, r_extern=1, r_pcrel=1, r_symbolnum=_foo
|
|
76
|
+
* 8B 05 00 00 00 00
|
|
77
|
+
*
|
|
78
|
+
* movl _foo+4(%rip), %eax
|
|
79
|
+
* r_type=X86_64_RELOC_SIGNED, r_length=2, r_extern=1, r_pcrel=1, r_symbolnum=_foo
|
|
80
|
+
* 8B 05 04 00 00 00
|
|
81
|
+
*
|
|
82
|
+
* movb $0x12, _foo(%rip)
|
|
83
|
+
* r_type=X86_64_RELOC_SIGNED, r_length=2, r_extern=1, r_pcrel=1, r_symbolnum=_foo
|
|
84
|
+
* C6 05 FF FF FF FF 12
|
|
85
|
+
*
|
|
86
|
+
* movl $0x12345678, _foo(%rip)
|
|
87
|
+
* r_type=X86_64_RELOC_SIGNED, r_length=2, r_extern=1, r_pcrel=1, r_symbolnum=_foo
|
|
88
|
+
* C7 05 FC FF FF FF 78 56 34 12
|
|
89
|
+
*
|
|
90
|
+
* .quad _foo
|
|
91
|
+
* r_type=X86_64_RELOC_UNSIGNED, r_length=3, r_extern=1, r_pcrel=0, r_symbolnum=_foo
|
|
92
|
+
* 00 00 00 00 00 00 00 00
|
|
93
|
+
*
|
|
94
|
+
* .quad _foo+4
|
|
95
|
+
* r_type=X86_64_RELOC_UNSIGNED, r_length=3, r_extern=1, r_pcrel=0, r_symbolnum=_foo
|
|
96
|
+
* 04 00 00 00 00 00 00 00
|
|
97
|
+
*
|
|
98
|
+
* .quad _foo - _bar
|
|
99
|
+
* r_type=X86_64_RELOC_SUBTRACTOR, r_length=3, r_extern=1, r_pcrel=0, r_symbolnum=_bar
|
|
100
|
+
* r_type=X86_64_RELOC_UNSIGNED, r_length=3, r_extern=1, r_pcrel=0, r_symbolnum=_foo
|
|
101
|
+
* 00 00 00 00 00 00 00 00
|
|
102
|
+
*
|
|
103
|
+
* .quad _foo - _bar + 4
|
|
104
|
+
* r_type=X86_64_RELOC_SUBTRACTOR, r_length=3, r_extern=1, r_pcrel=0, r_symbolnum=_bar
|
|
105
|
+
* r_type=X86_64_RELOC_UNSIGNED, r_length=3, r_extern=1, r_pcrel=0, r_symbolnum=_foo
|
|
106
|
+
* 04 00 00 00 00 00 00 00
|
|
107
|
+
*
|
|
108
|
+
* .long _foo - _bar
|
|
109
|
+
* r_type=X86_64_RELOC_SUBTRACTOR, r_length=2, r_extern=1, r_pcrel=0, r_symbolnum=_bar
|
|
110
|
+
* r_type=X86_64_RELOC_UNSIGNED, r_length=2, r_extern=1, r_pcrel=0, r_symbolnum=_foo
|
|
111
|
+
* 00 00 00 00
|
|
112
|
+
*
|
|
113
|
+
* lea L1(%rip), %rax
|
|
114
|
+
* r_type=X86_64_RELOC_SIGNED, r_length=2, r_extern=1, r_pcrel=1, r_symbolnum=_prev
|
|
115
|
+
* 48 8d 05 12 00 00 00
|
|
116
|
+
* // assumes _prev is the first non-local label 0x12 bytes before L1
|
|
117
|
+
*
|
|
118
|
+
* lea L0(%rip), %rax
|
|
119
|
+
* r_type=X86_64_RELOC_SIGNED, r_length=2, r_extern=0, r_pcrel=1, r_symbolnum=3
|
|
120
|
+
* 48 8d 05 56 00 00 00
|
|
121
|
+
* // assumes L0 is in third section and there is no previous non-local label.
|
|
122
|
+
* // The rip-relative-offset of 0x00000056 is L0-address_of_next_instruction.
|
|
123
|
+
* // address_of_next_instruction is the address of the relocation + 4.
|
|
124
|
+
*
|
|
125
|
+
* add $6,L0(%rip)
|
|
126
|
+
* r_type=X86_64_RELOC_SIGNED_1, r_length=2, r_extern=0, r_pcrel=1, r_symbolnum=3
|
|
127
|
+
* 83 05 18 00 00 00 06
|
|
128
|
+
* // assumes L0 is in third section and there is no previous non-local label.
|
|
129
|
+
* // The rip-relative-offset of 0x00000018 is L0-address_of_next_instruction.
|
|
130
|
+
* // address_of_next_instruction is the address of the relocation + 4 + 1.
|
|
131
|
+
* // The +1 comes from SIGNED_1. This is used because the relocation is not
|
|
132
|
+
* // at the end of the instruction.
|
|
133
|
+
*
|
|
134
|
+
* .quad L1
|
|
135
|
+
* r_type=X86_64_RELOC_UNSIGNED, r_length=3, r_extern=1, r_pcrel=0, r_symbolnum=_prev
|
|
136
|
+
* 12 00 00 00 00 00 00 00
|
|
137
|
+
* // assumes _prev is the first non-local label 0x12 bytes before L1
|
|
138
|
+
*
|
|
139
|
+
* .quad L0
|
|
140
|
+
* r_type=X86_64_RELOC_UNSIGNED, r_length=3, r_extern=0, r_pcrel=0, r_symbolnum=3
|
|
141
|
+
* 56 00 00 00 00 00 00 00
|
|
142
|
+
* // assumes L0 is in third section, has an address of 0x00000056 in .o
|
|
143
|
+
* // file, and there is no previous non-local label
|
|
144
|
+
*
|
|
145
|
+
* .quad _foo - .
|
|
146
|
+
* r_type=X86_64_RELOC_SUBTRACTOR, r_length=3, r_extern=1, r_pcrel=0, r_symbolnum=_prev
|
|
147
|
+
* r_type=X86_64_RELOC_UNSIGNED, r_length=3, r_extern=1, r_pcrel=0, r_symbolnum=_foo
|
|
148
|
+
* EE FF FF FF FF FF FF FF
|
|
149
|
+
* // assumes _prev is the first non-local label 0x12 bytes before this
|
|
150
|
+
* // .quad
|
|
151
|
+
*
|
|
152
|
+
* .quad _foo - L1
|
|
153
|
+
* r_type=X86_64_RELOC_SUBTRACTOR, r_length=3, r_extern=1, r_pcrel=0, r_symbolnum=_prev
|
|
154
|
+
* r_type=X86_64_RELOC_UNSIGNED, r_length=3, r_extern=1, r_pcrel=0, r_symbolnum=_foo
|
|
155
|
+
* EE FF FF FF FF FF FF FF
|
|
156
|
+
* // assumes _prev is the first non-local label 0x12 bytes before L1
|
|
157
|
+
*
|
|
158
|
+
* .quad L1 - _prev
|
|
159
|
+
* // No relocations. This is an assembly time constant.
|
|
160
|
+
* 12 00 00 00 00 00 00 00
|
|
161
|
+
* // assumes _prev is the first non-local label 0x12 bytes before L1
|
|
162
|
+
*
|
|
163
|
+
*
|
|
164
|
+
*
|
|
165
|
+
* In final linked images, there are only two valid relocation kinds:
|
|
166
|
+
*
|
|
167
|
+
* r_type=X86_64_RELOC_UNSIGNED, r_length=3, r_pcrel=0, r_extern=1, r_symbolnum=sym_index
|
|
168
|
+
* This tells dyld to add the address of a symbol to a pointer sized (8-byte)
|
|
169
|
+
* piece of data (i.e on disk the 8-byte piece of data contains the addend). The
|
|
170
|
+
* r_symbolnum contains the index into the symbol table of the target symbol.
|
|
171
|
+
*
|
|
172
|
+
* r_type=X86_64_RELOC_UNSIGNED, r_length=3, r_pcrel=0, r_extern=0, r_symbolnum=0
|
|
173
|
+
* This tells dyld to adjust the pointer sized (8-byte) piece of data by the amount
|
|
174
|
+
* the containing image was loaded from its base address (e.g. slide).
|
|
175
|
+
*
|
|
176
|
+
*/
|
|
177
|
+
enum reloc_type_x86_64
|
|
178
|
+
{
|
|
179
|
+
X86_64_RELOC_UNSIGNED, // for absolute addresses
|
|
180
|
+
X86_64_RELOC_SIGNED, // for signed 32-bit displacement
|
|
181
|
+
X86_64_RELOC_BRANCH, // a CALL/JMP instruction with 32-bit displacement
|
|
182
|
+
X86_64_RELOC_GOT_LOAD, // a MOVQ load of a GOT entry
|
|
183
|
+
X86_64_RELOC_GOT, // other GOT references
|
|
184
|
+
X86_64_RELOC_SUBTRACTOR, // must be followed by a X86_64_RELOC_UNSIGNED
|
|
185
|
+
X86_64_RELOC_SIGNED_1, // for signed 32-bit displacement with a -1 addend
|
|
186
|
+
X86_64_RELOC_SIGNED_2, // for signed 32-bit displacement with a -2 addend
|
|
187
|
+
X86_64_RELOC_SIGNED_4, // for signed 32-bit displacement with a -4 addend
|
|
188
|
+
X86_64_RELOC_TLV, // for thread local variables
|
|
189
|
+
};
|
|
190
|
+
|
|
191
|
+
#endif /* #ifndef _MACHO_X86_64_RELOC_H_ */
|