Merge pull request #76 from sbingner/master

Add arm64e patches from elucubratus
This commit is contained in:
Thomas Pöchtrager 2020-01-07 15:34:58 +01:00 committed by GitHub
commit 23f21436e0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 12 additions and 9 deletions

View File

@ -670,6 +670,9 @@ static const ArchInfo archInfoArray[] = {
#endif
#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 }
};

View File

@ -11,12 +11,12 @@ else
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

View File

@ -676,7 +676,7 @@ void Options::setArchitecture(cpu_type_t type, cpu_subtype_t subtype, ld::Platfo
#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
@ -4838,7 +4838,7 @@ void Options::reconfigureDefaults()
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:
@ -4903,7 +4903,7 @@ void Options::reconfigureDefaults()
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;
@ -4962,7 +4962,7 @@ void Options::reconfigureDefaults()
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;
@ -5361,7 +5361,7 @@ void Options::reconfigureDefaults()
}
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

View File

@ -1322,7 +1322,7 @@ void doPass(const Options& opts, ld::Internal& state)
#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;
}

View File

@ -235,7 +235,7 @@ ld::Atom* Pass::makeStub(const ld::Atom& target, bool weakImport)
#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 )