X-Git-Url: https://git.saurik.com/apple/ld64.git/blobdiff_plain/b2fa67a80bc53211e4d1ea81f23e9f953ee1dd6c..b1f7435d66a93f03b77932b3a9ad8a83ce5e1ebc:/src/other/rebase.cpp diff --git a/src/other/rebase.cpp b/src/other/rebase.cpp index 2255789..d1e3194 100644 --- a/src/other/rebase.cpp +++ b/src/other/rebase.cpp @@ -674,6 +674,7 @@ void Rebaser::doLocalRelocation(const macho_relocation_info

* reloc) } } +#if SUPPORT_ARCH_arm_any template <> void Rebaser::doLocalRelocation(const macho_relocation_info

* reloc) { @@ -693,6 +694,7 @@ void Rebaser::doLocalRelocation(const macho_relocation_info

* reloc) } } } +#endif template void Rebaser::doLocalRelocation(const macho_relocation_info

* reloc) @@ -1008,27 +1010,18 @@ int main(int argc, const char* argv[]) highAddress = strtoull(argv[++i], &endptr, 16); } else if ( strcmp(arg, "-arch") == 0 ) { - const char* arch = argv[++i]; - if ( strcmp(arch, "ppc") == 0 ) - onlyArchs.insert(CPU_TYPE_POWERPC); - else if ( strcmp(arch, "ppc64") == 0 ) - onlyArchs.insert(CPU_TYPE_POWERPC64); - else if ( strcmp(arch, "i386") == 0 ) - onlyArchs.insert(CPU_TYPE_I386); - else if ( strcmp(arch, "x86_64") == 0 ) - onlyArchs.insert(CPU_TYPE_X86_64); - else { - bool found = false; - for (const ARMSubType* t=ARMSubTypes; t->subTypeName != NULL; ++t) { - if ( strcmp(t->subTypeName,arch) == 0 ) { - onlyArchs.insert(CPU_TYPE_ARM); - found = true; - break; - } + const char* archName = argv[++i]; + if ( archName == NULL ) + throw "-arch missing architecture name"; + bool found = false; + for (const ArchInfo* t=archInfoArray; t->archName != NULL; ++t) { + if ( strcmp(t->archName,archName) == 0 ) { + onlyArchs.insert(t->cpuType); + found = true; } - if ( !found ) - throwf("unknown architecture %s", arch); } + if ( !found ) + throwf("unknown architecture %s", archName); } else { usage();