diff --git a/llvm/test/tools/llvm-objdump/MachO/dyld-info.test b/llvm/test/tools/llvm-objdump/MachO/dyld-info.test --- a/llvm/test/tools/llvm-objdump/MachO/dyld-info.test +++ b/llvm/test/tools/llvm-objdump/MachO/dyld-info.test @@ -3,7 +3,6 @@ RUN: llvm-otool -dyld_info %p/Inputs/chained-fixups.macho-x86_64 | \ RUN: FileCheck -DNAME=%p/Inputs/chained-fixups.macho-x86_64 %s - ## See chained-fixups.test for how the test input was generated. CHECK: [[NAME]]: CHECK-NEXT: dyld information: @@ -16,7 +15,17 @@ CHECK-NEXT: __DATA __data 0x3410 0x8010000000000002 bind 0x0 libdylib _dylib CHECK-NEXT: __DATA __data 0x3418 0x800000002A000002 bind 0x2A libdylib _dylib + ## TODO: Print opcode-based fixups/binds as well ## For now, test that execution doesn't fail if the input uses those. RUN: llvm-objdump --macho --dyld-info %p/Inputs/bind.macho-x86_64 RUN: llvm-objdump --macho --dyld-info %p/Inputs/bind.macho-x86_64 + + +## If both -chained_fixups and -dyld_info are passed, otool prints dyld_info +## output first. Match that. +RUN: llvm-otool -chained_fixups -dyld_info \ +RUN: %p/Inputs/chained-fixups.macho-x86_64 | \ +RUN: FileCheck --check-prefix=BOTH %s +BOTH: dyld information: +BOTH: chained fixups header diff --git a/llvm/tools/llvm-objdump/MachODump.cpp b/llvm/tools/llvm-objdump/MachODump.cpp --- a/llvm/tools/llvm-objdump/MachODump.cpp +++ b/llvm/tools/llvm-objdump/MachODump.cpp @@ -2182,10 +2182,10 @@ DumpSectionContents(FileName, MachOOF, Verbose); if (InfoPlist) DumpInfoPlistSectionContents(FileName, MachOOF); - if (ChainedFixups) - PrintChainedFixups(MachOOF); if (DyldInfo) PrintDyldInfo(MachOOF); + if (ChainedFixups) + PrintChainedFixups(MachOOF); if (DylibsUsed) PrintDylibs(MachOOF, false); if (DylibId)