1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
|
diff -ur ld64-450.3/src/abstraction/MachOFileAbstraction.hpp ld64-450.3+iOS/src/abstraction/MachOFileAbstraction.hpp
--- ld64-450.3/src/abstraction/MachOFileAbstraction.hpp 2019-04-09 13:33:07.000000000 -1000
+++ ld64-450.3+iOS/src/abstraction/MachOFileAbstraction.hpp 2019-12-09 16:47:35.000000000 -1000
@@ -667,6 +667,9 @@
#if SUPPORT_ARCH_arm64v8
{ "arm64v8", CPU_TYPE_ARM64, CPU_SUBTYPE_ARM64_V8, "arm64v8-", "aarch64-", true, false },
#endif
+#if SUPPORT_ARCH_arm64e
+ { "arm64e", CPU_TYPE_ARM64, CPU_SUBTYPE_ARM64E, "arm64e-", "aarch64-", true, false },
+#endif
{ NULL, 0, 0, NULL, NULL, false, false }
};
diff -ur ld64-450.3/src/create_configure ld64-450.3+iOS/src/create_configure
--- ld64-450.3/src/create_configure 2019-04-09 13:33:08.000000000 -1000
+++ ld64-450.3+iOS/src/create_configure 2019-12-09 16:46:32.000000000 -1000
@@ -11,12 +11,12 @@
fi
if [ -z "${RC_SUPPORTED_ARCHS}" ]; then
- RC_SUPPORTED_ARCHS="i386 x86_64 x86_64h armv6 armv7 armv7s armv7m armv7k arm64"
+ RC_SUPPORTED_ARCHS="i386 x86_64 x86_64h armv6 armv7 armv7s armv7m armv7k arm64 arm64e"
fi
for ANARCH in ${RC_SUPPORTED_ARCHS}
do
- KNOWN_ARCHS=",armv4t,armv5,armv6,armv7,armv7f,armv7k,armv7s,armv6m,armv7m,armv7em,armv8,arm64,arm64v8,i386,x86_64,x86_64h,"
+ KNOWN_ARCHS=",armv4t,armv5,armv6,armv7,armv7f,armv7k,armv7s,armv6m,armv7m,armv7em,armv8,arm64,arm64v8,arm64e,i386,x86_64,x86_64h,"
FOUND=`echo "$KNOWN_ARCHS" | grep ",$ANARCH,"`
if [ $FOUND ]; then
echo "#define SUPPORT_ARCH_$ANARCH 1" >> ${DERIVED_FILE_DIR}/configure.h
diff -ur ld64-450.3/src/ld/Architectures.hpp ld64-450.3+iOS/src/ld/Architectures.hpp
--- ld64-450.3/src/ld/Architectures.hpp 2019-04-09 13:33:08.000000000 -1000
+++ ld64-450.3+iOS/src/ld/Architectures.hpp 2019-12-09 16:46:32.000000000 -1000
@@ -61,7 +61,10 @@
typedef Pointer64<LittleEndian> P;
};
-
+struct arm64e
+{
+ typedef Pointer64<LittleEndian> P;
+};
#endif // __ARCHITECTURES__
diff -ur ld64-450.3/src/ld/Options.cpp ld64-450.3+iOS/src/ld/Options.cpp
--- ld64-450.3/src/ld/Options.cpp 2019-04-09 13:33:08.000000000 -1000
+++ ld64-450.3+iOS/src/ld/Options.cpp 2019-12-09 16:46:32.000000000 -1000
@@ -621,14 +621,14 @@
if ( platforms().contains(ld::kPlatform_iOS) && (platforms().minOS(ld::kPlatform_iOS) == 0) && (fOutputKind != Options::kObjectFile) ) {
#if defined(DEFAULT_IPHONEOS_MIN_VERSION)
warning("-ios_version_min not specified, assuming " DEFAULT_IPHONEOS_MIN_VERSION);
- setVersionMin(ld::kPlatformiOS, DEFAULT_IPHONEOS_MIN_VERSION);
+ setVersionMin(ld::kPlatform_iOS, DEFAULT_IPHONEOS_MIN_VERSION);
#else
warning("-ios_version_min not specified, assuming 6.0");
setVersionMin(ld::kPlatform_iOS, "6.0");
#endif
}
#if SUPPORT_ARCH_arm64e
- if ( (fArchitecture == CPU_TYPE_ARM64) && (fSubArchitecture == CPU_SUBTYPE_ARM64_E) ) {
+ if ( (fArchitecture == CPU_TYPE_ARM64) && (fSubArchitecture == CPU_SUBTYPE_ARM64E) ) {
fSupportsAuthenticatedPointers = true;
}
#endif
@@ -4412,7 +4412,7 @@
if ( (fOutputKind != Options::kObjectFile) && (fOutputKind != Options::kPreload) ) {
#if defined(DEFAULT_IPHONEOS_MIN_VERSION)
warning("-ios_version_min not specified, assuming " DEFAULT_IPHONEOS_MIN_VERSION);
- setVersionMin(ld::kPlatformiOS, DEFAULT_IPHONEOS_MIN_VERSION);
+ setVersionMin(ld::kPlatform_iOS, DEFAULT_IPHONEOS_MIN_VERSION);
#else
if ( fSubArchitecture == CPU_SUBTYPE_ARM_V7K ) {
warning("-watchos_version_min not specified, assuming 2.0");
@@ -4749,7 +4749,7 @@
break;
case Options::kDyld:
// arm64e has support for compressed LINKEDIT.
- if ( (fArchitecture == CPU_TYPE_ARM64) && (fSubArchitecture == CPU_SUBTYPE_ARM64_E) )
+ if ( (fArchitecture == CPU_TYPE_ARM64) && (fSubArchitecture == CPU_SUBTYPE_ARM64E) )
break;
case Options::kPreload:
case Options::kStaticExecutable:
@@ -4814,7 +4814,7 @@
if (fArchitecture == CPU_TYPE_ARM64) {
#if SUPPORT_ARCH_arm64e
- if (fSubArchitecture == CPU_SUBTYPE_ARM64_E)
+ if (fSubArchitecture == CPU_SUBTYPE_ARM64E)
{
// FIXME: Move some of these to arm64
fNoLazyBinding = true;
@@ -4873,7 +4873,7 @@
fUseLinkedListBinding = true;
fNoLazyBinding = true;
#if SUPPORT_ARCH_arm64e
- if ( (fArchitecture == CPU_TYPE_ARM64) && (fSubArchitecture == CPU_SUBTYPE_ARM64_E) )
+ if ( (fArchitecture == CPU_TYPE_ARM64) && (fSubArchitecture == CPU_SUBTYPE_ARM64E) )
fSupportsAuthenticatedPointers = true;
#endif
break;
@@ -5267,7 +5267,7 @@
}
else if ( platforms().minOS(ld::iOS_10_0) ) {
#if SUPPORT_ARCH_arm64e
- if ( (fArchitecture == CPU_TYPE_ARM64) && (fSubArchitecture == CPU_SUBTYPE_ARM64_E) ) {
+ if ( (fArchitecture == CPU_TYPE_ARM64) && (fSubArchitecture == CPU_SUBTYPE_ARM64E) ) {
fUnalignedPointerTreatment = Options::kUnalignedPointerError;
} else
#endif
diff -ur ld64-450.3/src/ld/passes/objc.cpp ld64-450.3+iOS/src/ld/passes/objc.cpp
--- ld64-450.3/src/ld/passes/objc.cpp 2019-04-09 13:33:08.000000000 -1000
+++ ld64-450.3+iOS/src/ld/passes/objc.cpp 2019-12-09 16:46:32.000000000 -1000
@@ -1322,7 +1322,7 @@
#if SUPPORT_ARCH_arm64
case CPU_TYPE_ARM64:
#if SUPPORT_ARCH_arm64e
- if (opts.subArchitecture() == CPU_SUBTYPE_ARM64_E) {
+ if (opts.subArchitecture() == CPU_SUBTYPE_ARM64E) {
doPass<arm64e, true>(opts, state);
break;
}
diff -ur ld64-450.3/src/ld/passes/stubs/stubs.cpp ld64-450.3+iOS/src/ld/passes/stubs/stubs.cpp
--- ld64-450.3/src/ld/passes/stubs/stubs.cpp 2019-04-09 13:33:08.000000000 -1000
+++ ld64-450.3+iOS/src/ld/passes/stubs/stubs.cpp 2019-12-09 16:46:32.000000000 -1000
@@ -235,7 +235,7 @@
#if SUPPORT_ARCH_arm64
case CPU_TYPE_ARM64:
#if SUPPORT_ARCH_arm64e
- if ( (_options.subArchitecture() == CPU_SUBTYPE_ARM64_E) && _options.useAuthenticatedStubs() ) {
+ if ( (_options.subArchitecture() == CPU_SUBTYPE_ARM64E) && _options.useAuthenticatedStubs() ) {
if ( (_options.outputKind() == Options::kKextBundle) && _options.kextsUseStubs() )
return new ld::passes::stubs::arm64e::NonLazyStubAtom(*this, target, weakImport);
else if ( usingCompressedLINKEDIT() && !forLazyDylib && _options.noLazyBinding() && !stubToResolver )
|