X-Git-Url: https://git.saurik.com/apple/ld64.git/blobdiff_plain/afe874b1634377ecb27057ee76deb04915bb34d7..b2fa67a80bc53211e4d1ea81f23e9f953ee1dd6c:/src/ld/Resolver.cpp diff --git a/src/ld/Resolver.cpp b/src/ld/Resolver.cpp index a56cefe..2502820 100644 --- a/src/ld/Resolver.cpp +++ b/src/ld/Resolver.cpp @@ -297,26 +297,6 @@ void Resolver::buildAtomList() //_symbolTable.printStatistics(); } -unsigned int Resolver::ppcSubTypeIndex(uint32_t subtype) -{ - switch ( subtype ) { - case CPU_SUBTYPE_POWERPC_ALL: - return 0; - case CPU_SUBTYPE_POWERPC_750: - // G3 - return 1; - case CPU_SUBTYPE_POWERPC_7400: - case CPU_SUBTYPE_POWERPC_7450: - // G4 - return 2; - case CPU_SUBTYPE_POWERPC_970: - // G5 can run everything - return 3; - default: - throw "Unhandled PPC cpu subtype!"; - break; - } -} void Resolver::doFile(const ld::File& file) { @@ -363,29 +343,6 @@ void Resolver::doFile(const ld::File& file) // update cpu-sub-type cpu_subtype_t nextObjectSubType = file.cpuSubType(); switch ( _options.architecture() ) { - case CPU_TYPE_POWERPC: - // no checking when -force_cpusubtype_ALL is used - if ( _options.forceCpuSubtypeAll() ) - return; - if ( _options.preferSubArchitecture() ) { - // warn if some .o file is not compatible with desired output sub-type - if ( _options.subArchitecture() != nextObjectSubType ) { - if ( ppcSubTypeIndex(nextObjectSubType) > ppcSubTypeIndex(_options.subArchitecture()) ) { - if ( !_inputFiles.inferredArch() ) - warning("cpu-sub-type of %s is not compatible with command line cpu-sub-type", file.path()); - _internal.cpuSubType = nextObjectSubType; - } - } - } - else { - // command line to linker just had -arch ppc - // figure out final sub-type based on sub-type of all .o files - if ( ppcSubTypeIndex(nextObjectSubType) > ppcSubTypeIndex(_internal.cpuSubType) ) { - _internal.cpuSubType = nextObjectSubType; - } - } - break; - case CPU_TYPE_ARM: if ( _options.subArchitecture() != nextObjectSubType ) { if ( (_options.subArchitecture() == CPU_SUBTYPE_ARM_ALL) && _options.forceCpuSubtypeAll() ) { @@ -405,9 +362,6 @@ void Resolver::doFile(const ld::File& file) } break; - case CPU_TYPE_POWERPC64: - break; - case CPU_TYPE_I386: _internal.cpuSubType = CPU_SUBTYPE_I386_ALL; break; @@ -567,8 +521,6 @@ bool Resolver::isDtraceProbe(ld::Fixup::Kind kind) case ld::Fixup::kindStoreARMDtraceIsEnableSiteClear: case ld::Fixup::kindStoreThumbDtraceCallSiteNop: case ld::Fixup::kindStoreThumbDtraceIsEnableSiteClear: - case ld::Fixup::kindStorePPCDtraceCallSiteNop: - case ld::Fixup::kindStorePPCDtraceIsEnableSiteClear: case ld::Fixup::kindDtraceExtra: return true; default: @@ -770,7 +722,6 @@ void Resolver::markLive(const ld::Atom& atom, WhyLiveBackChain* previous) case ld::Fixup::kindStoreTargetAddressX86Abs32TLVLoadNowLEA: case ld::Fixup::kindStoreTargetAddressARMBranch24: case ld::Fixup::kindStoreTargetAddressThumbBranch22: - case ld::Fixup::kindStoreTargetAddressPPCBranch24: if ( fit->binding == ld::Fixup::bindingByContentBound ) { // normally this was done in convertReferencesToIndirect() // but a archive loaded .o file may have a forward reference @@ -1078,7 +1029,8 @@ void Resolver::checkUndefines(bool force) break; } std::vector unresolvableUndefines; - if ( _options.deadCodeStrip() ) + // LTO many have eliminated need for some undefines + if ( _options.deadCodeStrip() || _haveLLVMObjs ) this->liveUndefines(unresolvableUndefines); else _symbolTable.undefines(unresolvableUndefines);