X-Git-Url: https://git.saurik.com/apple/ld64.git/blobdiff_plain/afe874b1634377ecb27057ee76deb04915bb34d7..b1f7435d66a93f03b77932b3a9ad8a83ce5e1ebc:/src/other/ObjectDump.cpp diff --git a/src/other/ObjectDump.cpp b/src/other/ObjectDump.cpp index 3d7ac5e..cc673a3 100644 --- a/src/other/ObjectDump.cpp +++ b/src/other/ObjectDump.cpp @@ -738,33 +738,6 @@ void dumper::dumpFixup(const ld::Fixup* ref) case ld::Fixup::kindStoreBigEndian64: printf(", then store 64-bit big endian"); break; - case ld::Fixup::kindStorePPCBranch24: - printf(", then store as PPC branch24"); - break; - case ld::Fixup::kindStorePPCBranch14: - printf(", then store as PPC branch14"); - break; - case ld::Fixup::kindStorePPCPicLow14: - printf(", then store as PPC low14 pic"); - break; - case ld::Fixup::kindStorePPCPicLow16: - printf(", then store as PPC low14 pic"); - break; - case ld::Fixup::kindStorePPCPicHigh16AddLow: - printf(", then store as PPC high16 pic"); - break; - case ld::Fixup::kindStorePPCAbsLow14: - printf(", then store as PPC low14 abs"); - break; - case ld::Fixup::kindStorePPCAbsLow16: - printf(", then store as PPC low14 abs"); - break; - case ld::Fixup::kindStorePPCAbsHigh16AddLow: - printf(", then store as PPC high16 abs"); - break; - case ld::Fixup::kindStorePPCAbsHigh16: - printf(", then store as PPC high16 abs, no carry"); - break; case ld::Fixup::kindStoreX86BranchPCRel8: printf(", then store as x86 8-bit pcrel branch"); break; @@ -840,12 +813,6 @@ void dumper::dumpFixup(const ld::Fixup* ref) case ld::Fixup::kindStoreX86DtraceIsEnableSiteClear: printf("x86 dtrace static is-enabled site"); break; - case ld::Fixup::kindStorePPCDtraceCallSiteNop: - printf("ppc dtrace static probe site"); - break; - case ld::Fixup::kindStorePPCDtraceIsEnableSiteClear: - printf("ppc dtrace static is-enabled site"); - break; case ld::Fixup::kindStoreARMDtraceCallSiteNop: printf("ARM dtrace static probe site"); break; @@ -863,7 +830,25 @@ void dumper::dumpFixup(const ld::Fixup* ref) break; case ld::Fixup::kindSetLazyOffset: printf("offset of lazy binding info for %s", referenceTargetAtomName(ref)); - break; + break; + case ld::Fixup::kindDataInCodeStartData: + printf("start of data in code"); + break; + case ld::Fixup::kindDataInCodeStartJT8: + printf("start of jump table 8 data in code"); + break; + case ld::Fixup::kindDataInCodeStartJT16: + printf("start of jump table 16 data in code"); + break; + case ld::Fixup::kindDataInCodeStartJT32: + printf("start of jump table 32 data in code"); + break; + case ld::Fixup::kindDataInCodeStartJTA32: + printf("start of jump table absolute 32 data in code"); + break; + case ld::Fixup::kindDataInCodeEnd: + printf("end of data in code"); + break; case ld::Fixup::kindStoreTargetAddressLittleEndian32: printf("store 32-bit little endian address of %s", referenceTargetAtomName(ref)); break; @@ -909,9 +894,6 @@ void dumper::dumpFixup(const ld::Fixup* ref) case ld::Fixup::kindStoreTargetAddressARMLoad12: printf("ARM store 12-bit pc-rel branch to %s", referenceTargetAtomName(ref)); break; - case ld::Fixup::kindStoreTargetAddressPPCBranch24: - printf("PowerPC store 24-bit pc-rel load of %s", referenceTargetAtomName(ref)); - break; case ld::Fixup::kindSetTargetTLVTemplateOffset: case ld::Fixup::kindSetTargetTLVTemplateOffsetLittleEndian32: case ld::Fixup::kindSetTargetTLVTemplateOffsetLittleEndian64: @@ -1146,12 +1128,12 @@ static ld::relocatable::File* createReader(const char* path) } } - ld::relocatable::File* objResult = mach_o::relocatable::parse(p, fileLen, path, stat_buf.st_mtime, 0, objOpts); + ld::relocatable::File* objResult = mach_o::relocatable::parse(p, fileLen, path, stat_buf.st_mtime, ld::File::Ordinal::NullOrdinal(), objOpts); if ( objResult != NULL ) return objResult; // see if it is an llvm object file - objResult = lto::parse(p, fileLen, path, stat_buf.st_mtime, 0, sPreferredArch, sPreferredSubArch, false); + objResult = lto::parse(p, fileLen, path, stat_buf.st_mtime, ld::File::Ordinal::NullOrdinal(), sPreferredArch, sPreferredSubArch, false); if ( objResult != NULL ) return objResult; @@ -1219,28 +1201,20 @@ int main(int argc, const char* argv[]) sShowLineInfo = false; } else if ( strcmp(arg, "-arch") == 0 ) { - const char* arch = ++isubTypeName != NULL; ++t) { - if ( strcmp(t->subTypeName,arch) == 0 ) { - sPreferredArch = CPU_TYPE_ARM; - sPreferredSubArch = t->subType; - 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 ) { + sPreferredArch = t->cpuType; + if ( t->isSubType ) + sPreferredSubArch = t->cpuSubType; + found = true; } - if ( !found ) - throwf("unknown architecture %s", arch); } + if ( !found ) + throwf("unknown architecture %s", archName); } else if ( strcmp(arg, "-only") == 0 ) { sMatchName = ++i