TODO: - Change pad in PPC_THREAD_STATE to vrsave. Print the altivec state. - HPPA, bring the private version of mach/hppa/thread_status.h in sync with the kernel header and change ofile_print.c to recognize new thread states. Changes for the 5.31 release (the cctools-827 release): - Added -DLTO_SUPPORT to the CFLAGS in the Makefile and added code in to process() in main.c to print "is an LLVM bit-code file" if ofile->lto is not NULL. Radar bug #9087924. Changes for the 5.31 release (the cctools-825 release): - Added the -q and -Q flags to use the llvm or internal disassemblers. And removed code for the hacked llvm interface. Radar bug #11139995. - Removed the unneeded category_t struct from the category_t type in both print_objc2_32bit.c and print_objc2_64bit.c. Radar bug #11136207. - Fixed more places that should be using 64-bit values. Radar bug #11089424. - Changed the type of the local varaiable size from uint32_t to uint64_t in processor() in main.c . - Changed the type of the parameter library_size from uint32_t to uint64_t in print_library_toc() in ofile_print.[ch] . As well as the local variable toc_offset in print_library_toc(). Changes for the 5.31 release (the cctools-824 release): - Added support for annotations of x86_64 pc relative loads to using the llvm-mc disassembler. Radar bug #10922117. - Changed disassembly of stub sections, section type S_SYMBOL_STUBS, for binaries with CPU_TYPE_ARM have code that is always in arm mode not thumb mode. Radar bug #10539919. - Fixed printing of literal pointer sections for 64-bit pointers. Radar bug #10934543. Changes for the 5.31 release (the cctools-823 release): - Added mention of -arch in the usage message. Radar bug #10988552. - Added support for the i386 and x86_64 llvm-mc disassembler with the -q flag. Radar bug #9354143. - Most of the changes were in i386_disasm.[ch] - Added a local struct disassemble_info . - Two LLVMDisasmContextRef type parameters were added to i386_disassemble() one for the i386 and one for X86_64. - In i386_disassemble() if the qflag is set then dis_info struct is filled in and llvm_disasm_instruction() is called. - The new routines i386GetOpInfo(), x86_64GetOpInfo(), SymbolLookUp(), create_i386_llvm_disassembler(), delete_i386_llvm_disassembler(), create_x86_64_llvm_disassembler() and delete_x86_64_llvm_disassembler() were added. - Also fixed get_symbol() to handle the X86_64_RELOC_SUBTRACTOR relocation entries correctly. - Changed print_text() in main.c if the qflag is set to create the i386 and x86_64 disassemblers and pass their contexts to i386_disassemble(). - Also changed GetOpInfo() in arm_disasm.c to return if no reloc found and not search for a symbol with value in that case. Changes for the 5.30 release (the cctools-820 release): - Removed the use of vers_string(1) from the Makefile. Radar bug #10596469. - Added a reference to apple_version[] in main.c . Changes for the 5.30 release (the cctools-815 release): - Changed print_relocs() in ofile_print.c so that for CPU_TYPE_X86_64 there are never any scattered relocation types. Radar bug #10347403. Changes for the 5.30 release (the cctools-814 release): - Fixed a bug in displacement() in i386_disasm.c where it was missing a case for value_size of 4 to sign extend the 32-bit value to a 64-bit value when the sign bit is set. Radar bug #10193562. - Added support for new load commands LC_MAIN, LC_DATA_IN_CODE, LC_SOURCE_VERSION and LC_DYLIB_CODE_SIGN_DRS with code added to ofile_print.[ch] . Radar bug #10290817. Changes for the 5.30 release (the cctools-813 release): - Added support for annotations with the arm llvm-mc disassembler. Radar bug #10026561. Changes for the 5.30 release (the cctools-812 release): - Fix the encoding of the arm sev.w instruction. Radar bug #10133308. Changes for the 5.30 release (the cctools-811 release): - Changed the Makefile setting CXX to use c++ not g++. Radar bug #10057952. Changes for the 5.30 release (the cctools-810 release): - Fixed print_cstring_section() to print the address base on if the cputype is 64-bit or 32-bit. Radar bug #9957089. Changes for the 5.29 release (the cctools-803 release): - Added printing archive member offsets when -aV is specified. Radar bug #9354605. Changes for the 5.29 release (the cctools-800.3 release): - Added support for armv7[fk] to print_arch() and print_cputype() in ofile_print.c and to print_text() in main.c . Radar bug #8987684. Changes for the 5.29 release (the cctools-800 release): - Fixed the arm VCVT (between half-precision and single-precision) instructions encodings. Had the op bit inverted in the table. It should have been: VCVT.F32.F16 , Encoded as op = 1 (aka fcvtshp) VCVT.F16.F32
, Encoded as op = 0 (aka fcvthps) Radar bug #8951023. Changes for the 5.28 release (the cctools-798 release): - Changed arm_disasm.c to use the arm assembly comment character '@' instead of the intel comment character ';' so the output of otool(1) can be assembled. Changes for the 5.28 release (the cctools-797 release): - Added support for LC_DYLD_ENVIRONMENT in ofile_print.c . Radar bug #8653976. Changes for the 5.28 release (the cctools-796 release): - Fixed the arm disassembly of vq{r}shr{u}n instructions. The masks should have not included the 0x00300000 as those were part of the imm6 feild and not part of the opcode. Radar bug# 8597212. - Fixed the i386 (32-bit) disassembly of displacement to not have more than 32-bits. Radar bug #8454529. - Fixed the movabs disassembly to print the correct suffix. Changes for the 5.28 release (the cctools-795 release): - Fixed the disassemble of the first operand in the specific case for i386 of the "move doubleword to quadword with sign-extension" that was broken with the fix to Radar bug #8017633. Where it needed to only clear the rex byte when the opcode was not 0x63. Radar bug #8325388. Changes for the 5.28 release (the cctools-794 release): - Updated ofile_print.c to print the MH_NO_HEAP_EXECUTION flag. Radar bug #8457105. Changes for the 5.28 release (the cctools-790 release): - Added moves for the arm Media and VFP Feature Registers 1 and 0 to arm_disasm.c . Radar bug #8246341. Changes for the 5.27 release (the cctools-784 release): - Changed the handling of printing the Objective-C section to deal with iOS simulator binaries being 32-bit intel and in the Objective-C 2 ABI. The change was to have print_objc_segment() now return a bool if the binary does not have the __OBJC segment and is an I386 binrary. Then the code in main() sets up and calls print_objc2_32bit(). Radar bug #7912209. - Added print_version_min_command() to ofile_print.[ch] and support for printing the LC_FUNCTION_STARTS load command. Radar bug #7902277. - Fixed the disassembly of first operand of a movzw{l,q} in i386_disassemble() in i386_disasm.c for the case MOVZ by setting rex to 0 after calling get_reg_name() to get the second argument. Radar bug #8017633. - Fixed the disassembly of j*cxz instructions in i386_disassemble() in i386_disasm.c for the case BD to look at if the target is 64-bit and look for the Address-size override prefix byte to print the correct form of the mnemonic. Also fixed the constants in displacement() in i386_disasm.c when sign extending a byte and a word to be unsigned long long values. Radar bug #8061602. Changes for the 5.27 release (the cctools-783 release): - Added the -llvm_mc option to disassemble so llvm-mc will assemble. - Added printing the section types to support thread local variables, added printing the X86_64_RELOC_TLV and GENERIC_RELOC_TLV relocation types, and added printing the indirect table entries for sections of type S_THREAD_LOCAL_VARIABLE_POINTERS to ofile_print.c . Radar bug #7796734. Changes for the 5.28 release (the cctools-782 release): - Fixed a bug with disassembling crc32b in 64-bit when a register greater than 8 is used. In i386_disasm.c the array REG64_BYTE[] was extended to include the other 8 register names and the code that uses it had (REX_B(rex) << 3) or'ed into the index with the existing r_m bits. - Added support for disassembling the Intel aes instructions. Radar bug #7709572. Changes for the 5.28 release (the cctools-781 release): - Added support for LC_LOAD_UPWARD_DYLIB to print_loadcmds(), print_libraries(), print_dylib_command() and print_hints() in ofile_print.c . Radar bug #7659206. - Fixed a problem with 64-bit disassembly of call instructions getting the incorrect target. Radar bug #7615109. Changes for the 5.28 release (the cctools-777 release): - Removed -fno-builtin-round from the Makefile. Radar bug #7475139. - Changed the Makefile to use -Os for OFLAG. Radar bug #7475093. Changes for the 5.27 release (the cctools-775 release): - Added the print_immediate_func() to arm_disasm.c to print out the movw and movt instruction immediates with the new arm HALF relocation entries. Updated print_relocs() in ofile_print.c to print out the new arm HALF relocation entries. Radar bug #7421496. - Fixed a bug in the print_address_func() in arm_disasm.c where it needed the pc also passed to it be able to match that up with the r_address of a relocation entry. Changes for the 5.27 release (the cctools-774 release): - Fixed the intel disassembly in i386_disasm.c so that make a386_test and make ax86_64_test targets in the cctools as directory will work. Radar bug 7414888 - Added the disassembly of the invvpid and invept instructions to i386_disasm.c . Radar bug #7383743. Changes for the 5.27 release (the cctools-772 release): - Fixed the disassembly of vshll where the table entry on line 751 had the first and second register operands switched. Radar bug 7308888. Changes for the 5.27 release (the cctools-764 release): - Changed the license on all otool source files. Radar bug #6538662. Changes for the 5.27 release (the cctools-763 release): - Added the disassembly for the rrx instructions to arm_disasm.c . Radar bug #7098328. Changes for the 5.27 release (the cctools-762 release): - Changed the Makefile to set CC when when SDKROOT is set. Radar bug #7078805. Changes for the 5.27 release (the cctools-760 release): - Fixed a problem with the leading address for raw text bytes of x86_64 not being printed as a 64-bit hex value. The fix was in print_text() in main.c . Radar bug #7012357, Changes for the 5.27 release (the cctools-759 release): - Added the disassembly for the pldw, vcvt.f32.f16, vcvt.f16.f32, vcvtt and vcvtb instructions to arm_disasm.c . Radar bug #6959129. - Added printing the memory barrior options ish, ishst, osh and oshst and changed un to nsh and unst to nshst in arm_disasm.c . Radar bug #6982242. - Changed the Makefile to add -isysroot $(SDKROOT) to compile and link lines when SDKROOT is set. Radar bug #6965029. Changes for the 5.27 release (the cctools-757 release): - Fixed a problem with 64-bit call (near) instructions not showing 64-bit register names. This is a special case where in a 64-bit object the FF /2 opcode results in a 64-bit operand even without a rex prefix byte. So added logic for this in the case of indirect to memory or register operand to set the REX.W bit to indicate 64-bit operand size. Radar bug #6907058. Changes for the 5.27 release (the cctools-755 release): - Fixed a problem with 64-bit intel binaries not having their addresses correct for call targets when some of the high 32-bits are set. Changed the type of the parameter value of displacement() in i386_disasm.c from uint32_t to uint64_t. And change the two uses to use the variable imm0 instead of value0 in i386_disassemble() in i386_disasm.c . Radar bug #6740004. Changes for the 5.27 release (the cctools-754 release): - Changed the Objective C data printers to account for the LC_ENCRYPTION_INFO load command causing some of the sections to be encrypted. Code and fields were added to print_objc.c, print_objc2_32bit.c and print_objc2_64bit.c to set the protected field of the sections structure based on the range of the LC_ENCRYPTION_INFO load command if present. Radar bug #6784286. Changes for the 5.27 release (the cctools-753 release): - Change the #ifdef around the print_x86_thread_state32 lable in ofile_print.c to removed a warning when compiled on Tiger. Changes for the 5.27 release (the cctools-752 release): - Ported to build with clang. - Changed Makefile to work around bugs 6761248 and 6756912. - Added cast to int in ofile_print.c (two places) in switch statements. - Removed an extra '%' in a printf() statement in "%movsldup\t" on line 2152 in i386_disasm.c. - Fixed typos in the usage line for "symbolically". Radar bug #6700325. - Changed the printing of the uuid in print_uuid_command in ofile_print.c so it matches how dwarfdump(1) prints it. Radar bug #6723850. Changes for the 5.27 release (the cctools-751 release): - Changed the printing of Objective-C data so that strings from protected sections are printed as "some string from a protected section" instead of what looks like junk when the protected string is printed as characters. Radar bug #5578032. Changes for the 5.26 release (the cctools-750 release): - Changed so that armv7 defaults to printing in thumb mode. Moved in_thumb boolean to a global in arm_disasm.[ch] and set it to TRUE in main.c if the binary is armv7. Radar bug 6651124. - Fixed a problem with print_objc_segment() in print_objc.c that was incorrectly using sizeof(void *) when it should have been using sizeof(uint32_t). Radar bug #6652270. - Updated ofile_print.c for the places it was missing code for S_16BYTE_LITERALS. Radar bug #5947957. - Fixed the x86_64 disassembly of with and SIB byte when mode is 0 and base is 5 and ss is not zero so that it does not print a base register. Radar bug #6533811 Changes for the 5.26 release (the cctools-749 release): - Fixed the printing of Objective-C meta data from 64-bit object files. So that every "dereference" of a pointer looks for a relocation entry. Also added the -V option to print the symbol names from the relocation entries. Radar bug #6549235. Changes for the 5.26 release (the cctools-737 release): - Changed arm_r_types[] for entry 7 to T_BR32 in ofile_print.c for the new ARM_THUMB_32BIT_BRANCH relocation type. Radar bug #6511482. - In print_insn() in arm_disasm.c removed the code at the end to check for status of running into the end of the section's memory and returning a -1 for the size of bytes it disassembled (as that caused it to loop). Radar bug #6504790. Changes for the 5.26 release (the cctools-733 release): - In arm_dis.c, updated thumb ldmia instruction to handle the case where Rn is in the register list and thus shouldn't be updated. Radar bug #6394340. Changes for the 5.26 release (the cctools-725 release): - Changed print_library_toc() in ofile_print.c to set toc_byte_sex to the host_byte_sex if it is passed as UNKNOWN_BYTE_SEX as a better guess. Radar bug #6303685. - Added support for new compressed LINKEDIT information. Radar bug #6232822. - Changed otool -lv to print out dyld_info command in ofile_print.[ch] . Changes for the 5.26 release (the cctools-724 release): - Updated print_mach_header() in ofile_print.c to print the MH_KEXT_BUNDLE file type and the MH_DEAD_STRIPPABLE_DYLIB flag. Radar bug #6272534. Changes for the 5.26 release (the cctools-722 release): - Changed print_ivar_list_t() in both print_objc2_32bit.c and print_objc2_64bit.c to print the pointer value for ivar offsets in hex and dereference that pointer and print the real offset as well. Radar bug #5733291. Changes for the 5.26 release (the cctools-715 release): - Fixed problems with the printing of the Objective-C meta data in print_objc.c where if an object file has a non-zero sized section from the __OBJC segment at address zero it will think NULL pointer feilds point to valid data. The fixes were to the get_* routines to check the addr parameter to see it it has the value of zero and if so return FALSE. Also a few checks for lists like ivars being past the end of a section needed a break not a continue to terminate the loop. Radar bug #6164922. Changes for the 5.26 release (the cctools-714 release): - Added the missing stuff for arm in print_arch() and print_cputype() in ofile_print.c. Radar bug #6155212. Changes for the 5.26 release (the cctools-712 release): - Picked up fix to otool(1) -Lv when running on 64-bit hosts and calling ctime() in print_libraries(). Radar bug #6107717. - Picked up fix to otool(1) -ov when running on 64-bit hosts in print_objc_segment() in print_objc.c when trying to print the Category Definition count where it was using sizeof(void *) which should have been sizeof(uint32_t). Radar bug #6107717. - Fixed another integer overflow problems in print_reloc() in ofile_print.c Radar bug #5796857. Changes for the 5.26 release (the cctools-708 release): - Fixed integer overflows problems in ofile_print.c . Radar bug #5796857. Changes for the 5.26 release (the cctools-705 release): - Ported to work on 64-bit hosts. Radar bug #6022298. Changes for the 5.26 release (the cctools-701 release): - Added printing the meta class for Objective-C 2 to both 32bit and 64bit printing. Radar bug #5909952. Changes for the 5.26 release (the cctools-700 release): - Fix section printf format strings in print_objc2_64bit.c to limit segment and section string lengths at 16 characters. Radar bug #5912294. Changes for the 5.26 release (the cctools-699 release): - Added support for armv7 disassembly. Radar bug #5874064. - Removed the old arm-opc.h header and from the Makefile. - Ported the GNU binutils version of src/opcodes/arm-dis.c into arm_disasm.c that supports armv7. Changes for the 5.25 release (the cctools-693 release): - Added support for printing the objc 2.0 metadata in 32-bit Mach-O files. Radar bug #5739542. - Moved print_objc2.c to print_objc2_64bit.c and changed print_objc2() to print_objc2_64bit() - Copied print_objc2_64bit.c to print_objc2_32bit.c and changed every where a 64-bit, pointer, name or value was used to used a 32-bit version. - In print_objc2_32bit.c removed the reserved field from the class_ro_t as it is a 64-bit only padding field. - Made a change in print_indirect_symbols() in ofile_print.c so it does not get spurious error about a load command extending past the end of the load commands. Radar bug #5728302. - Made a change in print_indirect_symbols() in ofile_print.c to print ABSOLUTE for cputype CPU_TYPE_I386 and S_SYMBOL_STUBS sections marked with just INDIRECT_SYMBOL_ABS. Radar bug #5829053. Changes for the 5.25 release (the cctools-691 release): - Added support for the LC_ENCRYPTION_INFO load command. Radar bug #5811994. - Added print_encryption_info_command() in ofile_print.[ch] . - Added code in print_loadcmds() in ofile_print.c for LC_ENCRYPTION_INFO. Changes for the 5.25 release (the cctools-690 release): - Changed the Makefile to added -DEFI_SUPPORT if EFITOOLS is not via the top level Makefile. And #ifdef'ed EFI_SUPPORT the call to print_coff_reloc_section() in main.c .Radar bug #5826370. Changes for the 5.25 release (the cctools-688 release): - Maded changes for the new LC_LAZY_LOAD_DYLIB load command. Radar bug #5760930. - Added an test for the S_LAZY_DYLIB_SYMBOL_POINTERS section type in processor() in main.c . - In ofile_print.c these changes were made: - print_loadcmds() had a case for LC_LAZY_LOAD_DYLIB added. - print_loadcmds() had a case for LC_LAZY_LOAD_DYLIB added and a test of LC_LAZY_LOAD_DYLIB to print the string "LC_LAZY_LOAD_DYLIB". - print_section() had a test for S_LAZY_DYLIB_SYMBOL_POINTERS to print that as a string and a test for printing "(index into indirect symbol table)" after the reserved1 field. - print_dylib_command() had a test for LC_LAZY_LOAD_DYLIB to print that as a string. - print_indirect_symbols() had a test for the S_NON_LAZY_SYMBOL_POINTERS section type added. - print_hints() had a case for LC_LAZY_LOAD_DYLIB added. - guess_indirect_symbol() had a test for the S_NON_LAZY_SYMBOL_POINTERS section type added in two places. Changes for the 5.25 release (the cctools-683 release): - Changed the Makefile to use OBJC_ABI for -fobjc-abi-version=1 since this is not supported on Tiger. Changes for the 5.25 release (the cctools-682 release): - Added -fobjc-abi-version=1 to the Makefile rule for building print_objc.o Since we're trying to get the objective-C 1.0 definitions and not the 2.0 definitions, this avoids problems with platforms where 2.0 is the default. Radar bug #5725807. Changes for the 5.25 release (the cctools-681 release): - Removed all __OPEN_SOURCE__ references in Makefile, notes, arm_disasm.c, main.c, ofile_print.c and otool.h . - Fixed a bug in disassembly for the i386 SSE4.1 instruction insertps where it had the second parameter as a general register not a xmm register. The change was in i386_disam.c in the table entry for insertps to use SSE4i not SSE4ifm. Radar bug #5650346. Changes for the 5.25 release (the cctools-677 release): - Changed the Makefile to not use -Wno-long-double and -no-cpp-precomp . Radar bug #5563553. Changes for the 5.25 release (the cctools-676 release): - Added printing S_DTRACE_DOF section type to print_section() in ofile_print.c. - Fixed a problem with not all the i386 bad opcode bytes being printed. The fix was at the end of i386_disassemble() in i386_disasm.c for printing the bad opcode byte to loop through all the length bytes it tried to disassemble before it ran into the bad opcode. Radar bug #4760658. - Fixed a problem with warning message being printed for zero length sections appearing at the end of object files that should have not been printed. The test in get_sect_info() in main.c was testing for >= and not > against the object size. Radar bug #4455994. - Fixed the problems with x86_64 disassembly in printing the displacements or their target symbols. The problem was the code in displacement() in i386_disasm.c did not take into account that instructions with and without relocation entries are assembled differently than all other Mach-O files. For x86_64 if it has a relocation entry the then displacement is an offset even if the symbol is defined. If not the displacement plus the pc is the target address. As part of the fix for this the addr and sect_addr needed to be passed as 64-bit value to i386_disassemble() and displacement(). Then the fix in displacement() was to construct a 64-bit target guess_addr if there was no relocation entry found for the x86_64 case. Radar bug #5122861. - Added support to print the PECOFF base relocation table. Radar bug #5218665. - The new routine print_coff_reloc_section() was added to the files coff_print.[ch]. - Added code in main.c to test for the (__RELOC,__reloc) section being passed as the -s arguments and call print_coff_reloc_section(). - The routine get_sect_info() was made extern in main.c and added to ofile_print.h so it could be called by print_coff_reloc_section(). - Fixed a bug in print_label() where the addr argument was a unsigned long not a uint64_t. Changes in ofile_print.[ch] and print_objc.c. Radar bug #5186450. Changes for the 5.25 release (the cctools-675 release): - Changed print_indirect_symbols() so it would not crash if given a malformed object file that had a segment command with a very large number of sections. The fix was to add some size checking calculating the expected size in a 64 bit value compare that to see if it too large. Radar bug #5405675. Changes for the 5.25 release (the cctools-673 release): - Changed the sources so the arm stuff is not in the open source version. Radar bug #5326431. - Changed the Makefile to #ifndef __OPEN_SOURCE__ out the arm files - Added #ifndef __OPEN_SOURCE__ to the following files to bracket arm code: main.c, ofile_print.c, otool.h and arm_disasm.c . Changes for the 5.24 release (the cctools-665 release): - Added the SSE4 instructions to the i386 disassembler. The changes are in i386_disasm.c . Radar bug #4943015. Changes for the 5.24 release (the cctools-659 release): - Fixed a bug in the i386 disassembler to correctly assume 64-bit immediates for 64-bit object files with the MOV accumulator from memory operand (the to memory operand was already fixed in cctools-646 for this radar). The fix was for the OA case in i386_disassemble() in i386_disasm.c to test if it was a 64-bit object and pass the last argument to OPSIZE as 1 in that case. Also changed for both the OA and AO case was to change the mnemonic to "movabsl". Radar bug 4693534. - Changed print_objc2() in print_objc2.c to handle the move all metadata for objc-abi-version=2 out of segments __OBJC and __OBJC into the __DATA segment. The section mappings that applied were as follows: __DATA,__objc_classlist was __OBJC2,__class_list __DATA,__objc_catlist was __OBJC2,__category_list __DATA,__objc_protolist was __OBJC2,__protocol_list __DATA,__objc_msgrefs was __OBJC2,__message_refs __DATA,__objc_classrefs was __OBJC2,__class_refs __DATA,__objc_superrefs was __OBJC2,__super_refs __DATA,__objc_imageinfo was __OBJC,__image_info otool -ov for LP64 examines the sections named above, and looks for both names (to avoid compiler revision lock). Radar bug #5066149. Changes for the 5.24 release (the cctools-656 release): - Updated ofile_print.c to print the MH_PIE and MH_NO_REEXPORTED_DYLIBS flags. Radar bug #5041291. Changes for the 5.24 release (the cctools-653 release): - Updated ofile_print.c to handle the LC_REEXPORT_DYLIB load command. Radar bug #4986624. - Added printing the (__OBJC,__image_info) section info for 32-bit Mach-O files. Radar bug #4983418. Changes for the 5.24 release (the cctools-649 release): - Added support for printing the objc 2.0 metadata in 64-bit Mach-O files. Radar bug #4560930. Changes for the 5.24 release (the cctools-648 release): - Added the print_init_term_pointer_section() routine to ofile_print.[ch] and code to call in process() in main.c. This is called when the section specified with -s is a of the type S_MOD_{INIT,TERM}_FUNC_POINTERS. Radar bug #4880624. - Changed the check in get_symbol_table_info() in main.c to for the size of the symbol table extending past the end of the file so the check does not overflow and later cause problems. Also changed the check in get_toc_info() get_indirect_symbol_table_info(), get_module_table_info(), get_ref_info() and get_hints_table_info in main.c so it does not have the same problems. Radar bug #4868234. - Changed the check in print_fat_headers() in ofile_print.c for the nfat_arch being too large so the check does not overflow and later cause a crash. Then changed the loop printing the fat_arch structs to break out if it gets past the size of the file. Radar bug #4860769. Changes for the 5.24 release (the cctools-646 release): - Fixed a bug in the i386 disassembler to correctly assume 64-bit immediates for 64-bit object files with the MOV accumulator to memory operand. The fix was for the AO case in i386_disassemble() in i386_disasm.c to test if it was a 64-bit object and pass the last argument to OPSIZE as 1 in that case. Radar bug 4693534. - Fixed a bug in the i386 disassembler to print the prefix rep not repz with the ins, outs, movs, lods, and stos instructions. The change was to check the delayed prefix being printed to see if it was repz and the opcode was for one of the instruction then print rep instead. The change was in in i386_disassemble() in i386_disasm.c . Radar bug #4467453. - Fixed a bug in the i386 disassembler for opcodes with an SIB byte and with mod = 0 which means disp32 with no base. Also changed the 32-bit disassembly to not print the scale if ss = 0. These changes were in get_operand() in i386_disasm.c . Also changed print_text() in main.c to print the raw bytes for CPU_TYPE_X86_64 objects as bytes not 32-bit values. Radar bug #4523901. Changes for the 5.24 release (the cctools-645 release): - Added code in print_loadcmds() in ofile_print.[ch] to parse and print an LC_RPATH load command. Radar bug #4822880. Changes for the 5.24 release (the cctools-644 release): - Changed print_argstrings() in main.c to work with 64-bit Mach-O core files. Radar bug #4458775. Changes for the 5.24 release (the cctools-642 release): - Changed i386_disassemble() in i386_disasm.c to understand x86 branch prediction. Radar bug #4474395. Changes for the 5.24 release (the cctools-640 release): - Changed the code in ofile_print.c use CPU_SUBTYPE_MASK to mask out the capability bits from the cpusubtype on comparisons. Also added printing the capability bits. Radar bug #4754462. Changes for the 5.24 release (the cctools-634 release): - Changed print_loadcmds() and print_linkedit_data_command() in ofile_print.c to handle LC_SEGMENT_SPLIT_INFO the same as LC_CODE_SIGNATURE. Radar bug #4695477. Changes for the 5.24 release (the cctools-633 release): - Changed main.c, i386_disasm.[ch], ppc_disasm.[ch], m68k_disasm.[ch], sparc_disasm.[ch] and ofile_print.[ch] to deal with the change of type for indirect symbols to uint32_t * when ported to 64-bit. Radar bug #4407440. Changes for the 5.24 release (the cctools-630 release): - Picked up a change that got dropped from the cctools-622.5 release which was: - Support the new x86-64 relocation entry types for signed relocations with offsets. Radar bug #4664658. Radar bug #4678307. Changes for the 5.24 release (the cctools-629 release): - Changed print_mach_header() to print MH_DSYM symbolically. Radar bug #4511760. - Added the i386 memory nop to the i386 disassembler. Radar bug #4096964. Changes for the 5.24 release (the cctools-627 release): - Ported the code to unify otool(1) and otool64(1). Radar bug #3903136. - Eliminated the #include "stuff/target_arch.h" and all the *_t typedefs that were used from the header, the *_VALUE and *_NAME from the source files. - Eliminated the use of #ifdefs and ARCH64 from the source files. - Made many many changes passing extra parameters and adding test of the CPU_ARCH_ABI64 bit in the cputype to determine if it is 64-bit ofile. - Changed the Makefile to only build otool(1). Changes for the 5.24 release (the cctools-626 release): - Added code in print_loadcmds() in ofile_print.[ch] to parse and print an LC_CODE_SIGNATURE load command. Radar bug #4588023. - Changed the Makefile to not build otool(1) -static. Radar bug #4624240 and fix to that in Radar bug #4633942. Changes for the 5.23 release (the cctools-620 release): - Added code in print_thread_states() in ofile_print.c to print the new and missing x86 thread states. Radar bug #4491230. - Changed main.c to use target_addr_t instead of unsigned long for section addresses, which causes 64-bit section addresses to be displayed correctly. Radar bug #4591066. Changes for the 5.23 release (the cctools-619 release): - Changed displacement() in i386_disasm.c and #ifdef'ed out for ARCH64 so to not add the addr and lenght. Also changed get_symbol() in i386_disasm.c and #ifdef'ed out for ARCH64 then handling of scattered_relocation_info . Radar bug #4483416. Changes for the 5.23 release (the cctools-618 release): - Added support for displaying S_16BYTE_LITERALS sections. Radar bug #4555162. Changes for the 5.23 release (the cctools-617 release): - Don't display a suffix when diassembling setCC instructions for i386. Radar bug #3873844. - Disassemble x86-64 MOV instructions which take 8, 16, and 32-bit immediates properly. Radar bug #4555277. - Changed i386_disasm.c to allow us to mark various instructions as being implicitly pointer-sized and marked those instructions like that. Radar bug #4563547. Changes for the 5.23 release (the cctools-614 release): - Changed ofile_print.c to add macros that rename structure members of the ppc and i386 thread states for Unix conformance. Radar bug #4508798. Changes for the 5.23 release (the cctools-610 release): - Added a few ifdef x86_THREAD_STATE64 to a few places to ofile_print.c to allow it to build on Tiger. Radar bug #4535019. Changes for the 5.23 release taken from cctools-590.43 (the cctools-610 release): - Added support for disassembling the Vanderpool instructions to the i386 disassembler. Was radar bug #4427573 in cctools-590.43. Radar bug #4534436. Changes for the 5.22 release (the cctools-590.37.3 release): - Add back support for the E9 form of the jmp instruction for x86-64 disassembly. Radar bug #4489937. - Use a 'q' suffix rather than an 'l' suffix when disassembling call and jmp instructions for x86-64. Radar bug #4483621. Changes for the 5.22 release (the cctools-590.36.3 release): - Add support for the new relocation entry types for x86-64. Radar bug #4475165. - Print %cs, %fs, and %gs as 64-bit values in x86_64 thread states in otool. Radar bug #4468148. - Disassemble pushq instructions with extended x86_64 registers correctly. Radar bug #4476218. Changes for the 5.22 release (the cctools-590.36.1 release): - Fix suffixes in x86-64 disassembly for push, pop, and moves to and from control and debug registers, as well as disassembly of short jumps. Radar bug #4467441. Changes for the 5.22 release (the cctools-590.34.1 release): - Disassemble x86-64 instructions with SIB bytes correctly. Radar bug #4436608. - Disassemble x86-64-specific instructions properly and don't recognize i386-specific instructions when disassembling x86-64 code. Radar bug #4437391. - Disassemble the movslq instruction correctly for x86-64. Radar bug #4437197. - Eliminated extraneous suffixes from disassembly of some i386 and x86-64 instructions. Radar bug #4441526. - Fixed x86-64 disassembly for moves to and from control and debug registers. Radar bug #4439907. Changes for the 5.22 release (the cctools-590.31.2 release): - Added printing x86_THREAD_STATE64 in otool64. Radar bug #4424303. Changes for the 5.22 release (the cctools-590.31.1 release): - Added support for the x86_64 architecture. Radar bug #4345090. - Added support for the Merom New Instructions. Radar bug #4407298. - Improved otool's output for a number of i386 instructions. Changes for the 5.20 release (the cctools-590.25 release): - Changed print_uuid_command() in ofile_print.c to use two line for the uuid[] values. Radar bug #3415593. Changes for the 5.20 release (the cctools-590.24 release): - Added support for DWARF. Radar bug #4367423. - Added printing S_ATTR_DEBUG to print_section() in ofile_print.c. - Added print_uuid_command() to ofile_print.[ch] Changes for the 5.20 release (the cctools-590.23 release): - Changed print_thread_states() in ofile_print.c for the current i386 thread states (#if i386_THREAD_STATE == 1 case) so that it does use the fields of the i386_float_state struct when i386_EXCEPTION_STATE_COUNT is defined. Radar bug #4350771. Changes for the 5.20 release (the cctools-590.20 release): - Removed the warnings when building. Radar bug #4340147. - Added -fno-builtin-round to the Makefile. Changes for the 5.19 release (the cctools-590.15 release): - Adding printing SG_PROTECTED_VERSION_1 in print_segment_command() in ofile_print.c . Radar bug #4298526. Changes for the 5.19 release (the cctools-590.14 release): - Changed print_thread_states() in ofile_print.c for the current i386 thread states (#if i386_THREAD_STATE == 1 case) so that it does not use the fields of the i386_float_state struct. Radar bug #4303606. Changes for the 5.19 release (the cctools-590.12 release): - Added printing MH_ALLOW_STACK_EXECUTION print_mach_header() in ofile_print.c . Radar bug #4281171. Changes for the 5.19 release (the cctools-590.11 release): - Changed print_thread_states() in ofile_print.c for the current i386 thread states (#if i386_THREAD_STATE == 1 case) so that it does not print the obsolete1, obsolete2 or obsolete3 fields (or the same fields with the names fpkind, initialized, exc_status via the #defines). Removed the three added #defined's from the change below now that they are no longer needed. Radar bug #4282026. Changes for the 5.19 release (the cctools-590.10 release): - Added three #defined's to ofile_print.c: #define obsolete1 fpkind #define obsolete2 initialized #define obsolete3 exc_status allow the source to build on Leopard with different fields in the struct i386_float_state in . Radar bug #4279472. - Added printing S_ATTR_SELF_MODIFYING_CODE to print_section() in ofile_print.c. Radar bug #4202415. Changes for the 5.19 release (the cctools-590.8 release): - Changed print_thread_states() in ofile_print.c adding a #if for the new and old i386 thread states. And added code to print the new thread states. Radar bug #4200908. Changes for the 5.18 release (the cctools-589 release): - Changed the Makefile and added a LEGACY macro with two defines to allow the code to use the old field name "environ" from the i386 structs. Radar bug #4113580. Changes for the 5.18 release (the cctools-583 release): - Changed the Makefile so that when RC_XBS is set to YES then the compiler options -MD and -dependency-file as well as the md(1) program are not used. Radar bug #4029936. Changes for the 5.18 release (the cctools-580 release): - Fixed the i386 opcode for the ud2 instruction. It was disassembled from 0x0f 0xff. And should be disassembled from 0x0f 0x0b according to the Intel manual. The change was in i386_disasm.c . Radar bug #4085845. - Changed the PowerPC disassembler to use "mtocrf" instead of "mtcrf" when bit 11 is set and likewise "mfocrf" instead "mfcr" in ppc_disasm.c. Radar bug # 4034280. - Changed the i386 disassembler to print constants so they would assemble with the same width as they were in the object file. The change was in print_operand() in i386_disasm.c. To see if the the value_size is smaller than 32-bits and signed, then sign extend it and force the size to be 32-bits. Radar bug #4079507. Changes for the 5.18 release (the cctools-578 release): - Added support for sse3 instructions. Changes were in i386_disasm.c . Radar bug #4014327. Changes for the 5.17 release (the cctools-571 release): - Changed the Makefile to treat SUPanWheat the same as Panther to build for a Mac OS X 10.3 (Panther) system. Radar bug #3979451. Changes for the 5.17 release (the cctools-568 release): - Changed print_section() in ofile_print.c to print the section type S_INTERPOSING. Radar bug #3965794. Changes for the 5.17 release (the cctools-563 release): - Changed print_mach_header() in ofile_print.c to print the new flags MH_WEAK_DEFINES and MH_BINDS_TO_WEAK. Radar bug #3799069. Changes for the 5.17 release (the cctools-562 release): - Changed print_thread_states() in ofile_print.c to use cpu.vrsave instead of cpu.pad. Radar bug #3930480. Changes for the 5.17 release (the cctools-558 release): - Fixed a problem in print_hints() in ofile_print.c that would always cause the check about Inconsistent mh_sizeofcmds to be printed if the verbose option was not used. Radar bug #3902811. Changes for the 5.17 release (the cctools-557 release): - Removed support for the INTERIM_PPC64. The changes were to remove the #ifdef INTERIM_PPC64 source changes in main.c and ofile_print.c . Radar bug #3600419. Changes for the 5.17 release (the cctools-554 release): - Fixed a problem with the sorted_symbols not being correctly sorted causing symbol names not to be printed. The problem was the sym_compare() routine in main() used for the qsort() routine did not have its parameters updated to struct symbol * from nlist_t * for the 64-bit port work. Radar bug #3889188. Changes for the 5.17 release (the cctools-551 release): - Changed print_thread_states() in ofile_print.c to handle printing a PPC_THREAD_STATE64. Radar bug #3866755. Changes for the 5.17 release (the cctools-546 release): - Fixed a bug in print_mach_header() in ofile_print.c that was missing a case statement for CPU_SUBTYPE_POWERPC_970 and printing "ppc970". Radar bug #3825281. Changes for the 5.17 release (the cctools-533 release): - Changes to support 32-bit & 64-bit tools in the same binary. Radar bug #3793394. - Changed the code in main.c, ofile_print.c and objc_print.c to use the swap_*_t new macros from "stuff/target_arch.h". - In process() in main.c added a new ofile_mh local variable and added a few ifdef ARCH64 to set it to ofile->mh64 or ofile->mh. And changed places where it used ofile->mh to ofile_mh. Changes for the 5.17 release (the cctools-531 release): - Changed print_segment_command() in ofile_print.c to print the fileoff and filesize fields with the correct format depending on the field with for ARCH64. Radar bug #3781406. Changes for the 5.17 release (the cctools-529 release): - Made changes to support 64-bit tools. Radar bug #3600431. - Changed the Makefile to build otool in a sub-directory and building of otool64 in a different sub-directory. Things are no longer built with -DINTERIM_PPC64 and otool64 is built with -DARCH64 and linked with libstuff64 . - Added the include "stuff/target_arch.h" to the following files: i386_disasm.c m68k_disasm.c main.c ofile_print.c ppc_disasm.c print_objc.c sparc_disasm.c i386_disasm.h m68k_disasm.h ofile_print.h ppc_disasm.h sparc_disasm.h hppa_disasm.c i860_disasm.c m88k_disasm.c hppa_disasm.h i860_disasm.h m88k_disasm.h and changed the uses of structs, constants and names that are different for 64-bit files to the typedefs in "stuff/target_arch.h". - In all places that used sorted_symbols this was changed to the new type in "stuff/symbol.h" to struct symbol. Which contains a name and an nlist_t. - Changed the places in main.c and ofile_print.c with #ifdef DINTERIM_PPC64 to have code for 64-bit architectures. Changes for the 5.16 release (the cctools-528.5 release): - Changed the Makefile to treat MuonSeed the same as MuonPrime to build for a Mac OS X 10.3 (Panther) system. Changes for the 5.16 release (the cctools-528 release): - Print the new GENERIC_RELOC_LOCAL_SECTDIFF reloc, handle it in i386_disasm.c. Changes for the 5.16 release (the cctools-527 release): - Print the new PPC_RELOC_LOCAL_SECTDIFF reloc. Changes for the 5.16 release (the cctools-526 release): - Fixed warnings for the changes in mach-o headers for types changing from unsigned long to uint32_t and from long to int32_t. Radar bug #3744082. - Changed a number of uses of "%lu" to "%u" and "%ld to "%d" in ofile_print.c. - Added support for 3DNow! instructions. Changes were in i386_disasm.c . Radar bug #3737535. Changes for the 5.16 release (the cctools-524 release): - Fixed a bug in print_fat_headers() in ofile_print.c in the loop that was looking for illegal duplicate architectures. The loop was using unsigned indexes and testing for j < i - 1 without checkin that i could be zero. Radar bug #3709358. Changes for the 5.16 release (the cctools-522 release): - Fixed the problem with the changes to libc in Radar bug #3535291 causing the symbols ___fegetfltrounds and ___fpclassifyd to be undefined. Changed the Makefile to cause -lm_static to be used for releases after Panther. And changed main.c to remove the ifdef's around the stubs __fpclassifyd() and __fpclassify(). Radar bug #3685865. Changes for the 5.16 release (the cctools-520 release): - Fixed a bug in the disassembly of the i386 movdq2q instruction. Radar bug #3488840. - Fixed a bug in the disassembly of the i386 move word to accumulator instructions. It was incorrectly using the data-size attribute to determines the size of the offset. For move to accumulator instructions the address-size attribute of the instruction determines the size of the offset. Radar bug #3515794. Changes for the 5.16 release (the cctools-509 release): - Added #ifdef INTERIM_PPC64 to the source changes to support the interim ppc64 file format. And added -DINTERIM_PPC64 to the Makefile. - Changed print_thread_states() in ofile_print.c to treat CPU_TYPE_POWERPC64 the same as CPU_TYPE_POWERPC and CPU_TYPE_VEO. Changes for the 5.16 release (the cctools-501 release): - Added the printing of MH_SUBSECTIONS_VIA_SYMBOLS to print_mach_header() in ofile_print.c . Radar bug #2284500. Changes for the 5.16 release (the cctools-500 release): - Added printing S_ATTR_LIVE_SUPPORT and S_ATTR_NO_DEAD_STRIP to print_section() in ofile_print.c . Radar bug #2284500. Changes for the 5.16 release (the cctools-499.1 release): - Made changes to support the interim ppc64 file format. Radar bug #3562133 and #3562232. - Changed print_text() in main.c to treat CPU_TYPE_POWERPC64 the same as CPU_TYPE_POWERPC and CPU_TYPE_VEO. - Changed print_relocs() in ofile_print.c to print "quad" for an r_length == 3 and cputype == CPU_TYPE_POWERPC64 and r_type == PPC_RELOC_VANILLA in 2 places. - Changed print_indirect_symbols() and guess_indirect_symbol() in ofile_print.c to set the stride to 8 for CPU_TYPE_POWERPC64 otherwise 4. - Updated print_arch(), print_cputype(), print_mach_header(), print_relocs() and print_r_type() in ofile_print.c for CPU_TYPE_POWERPC64 to be the same as CPU_TYPE_POWERPC. Changes for the 5.14 release (the cctools-498 release): - Added code to disassemble the PowerPC pseudo-instruction 'jmp' as the non-linking form of 'jbsr' in ppc_disasm.c . Radar bug #3458928. Changes for the 5.13.2 release (the cctools-495.3 release): - Updated print_mach_header() in ofile_print.c to print the new mach_header flags MH_PREBINDABLE, MH_ALLMODSBOUND and MH_CANONICAL. Radar bug #3176679. Changes for the 5.12 release (the cctools-489 release): - Added stub functions for the notify API in the new file notify.c and picked up notify.h to allow otool to build on Panther7B40. Radar bug #3378781. Changes for the 5.12 release (the cctools-477 release): - Added stub functions for __fpclassifyd(), for ppc, and __fpclassify() for i386 to the end of main.c to allow otool to link with just libc.a given the new code in __ldtoa(). Radar bug #3271830. Changes for the 5.12 release (the cctools-476 release): - Fixed a bug in the i386 disassembly of movd instructions with the 0x7e sub opcode. Radar bug #3268255. Changes for the 5.12 release (the cctools-472 release): - Fixed a bug in disassembling the movq SSE2 instruction opcodes. The operands for register to memory and memory to register were switch. Radar bug #3250086. Changes for the 5.12 release (the cctools-468 release): - Added support for the new use of the previously unused value 3 for r_length to mean that the conditional branch was predicted using the Y-bit and the sign of the displacement and opcode. Radar bug #3223045. - Changed in print_r_type() in ofile_print.c to take a new boolean parameter predicted to tell it to print "+/-" after the r_type. - Changed print_relocs() in ofile_print.c to set a local boolean predicted to TRUE when r_length is 3 and pass it to print_r_type(). - Added the new routine get_reloc_r_length() to ppc_disasm.c . - Changed the routine get_reloc() to get_reloc_r_type() in ppc_disasm.c . - Change bc() in ppc_disasm.c to take 3 new parameters sect_offset, relocs and nrelos so it can look for a relocation entry with a r_length value of 3 to know to always print the prediction in this case. Changes for the 5.12 release (the cctools-467 release): - Added support for the PPC_RELOC_LO14_SECTDIFF relocation type used with double word load/store instructions. Radar bug #3218027. - Changed print_relocs() and in ofile_print.c to expect and print a pair relocation entry for PPC_RELOC_LO14_SECTDIFF relocation type. - Changed the 14th entry in ppc_r_types[] from " 14 (?) " to "LO14DIF " in ofile_print.c that print_r_type() uses. - Changed print_immediate() in ppc_disasm.c to handle PPC_RELOC_LO14_SECTDIFF. Changes for the 5.12 release (the cctools-466 release): - Fixed the incorrect cast on the comparison of the nlist struct's n_strx field where the value being compared to was casted to a long. The correct fix was to cast n_strx to an unsigned long. This is because the test is: if(something.n_un.n_strx >= string_size) error(...) And the incorrect cast like this: if(something.n_un.n_strx >= (long)string_size) error(...) will not catch the case when n_strx is negative. So the correct cast is: if((unsigned long)something.n_un.n_strx >= string_size) error(...) which was made in print_indirect_symbols() in ofile_print.c and a number of other places. Changes for the 5.12 release (the cctools-465 release): - Fixed the disassembly of "movd -12(%ebp),%mm0" which incorrectly disassembled without the displacement. Radar bug #3206331. Changes for the 5.12 release (the cctools-464 release): - Made changes to build cleanly with gcc3.3 - Removed -Wno-precomp from the Makefile - Fixed warnings for "comparison between signed and unsigned" in main.c, ofile_print.c, m68k_disasm.c, i860_disasm.c, m88k_disasm.c, i386_disasm.c, ppc_disasm.c, hppa_disasm.c, sparc_disasm.c, and print_objc.c . Changes for the 5.11 release (the cctools-463 release): - Added support for the MH_DYLIB_STUB filetype. Radar bug #3193744. - Changed processor() in main.c when printing the section contents from an MH_DYLIB_STUB that has indirect symbol table entries to force the section size to zero and not try to print the contents that were stripped. - Added the printing of the MH_DYLIB_STUB filetype to print_mach_header() in ofile_print.c . Changes for the 5.11 release (the cctools-450 release): - Fixed the disassembly of movd instructions that used GPR registers so things like: movd %edx, %xmm0 movd %xmm0, %edx disassembled correctly. Radar bug #3117176. Changes for the 5.11 release (the cctools-454 release): - Fixed a bug in disassembling a bad i386 instruction that had a value for a segment register greater than 6. The array SEGREG[] was changed to add two more entries to cover all 8 possible values with the last two values being "%?6" and "%?7" for the illegal values. Radar bug #3144846. Changes for the 5.11 release (the cctools-439 release): - Made the needed changes to main.c and ofile_print.c for VEO support. Radar bug #3068161. - Added the disassembly of the SSE2 instructions. Radar bug #2972491. - Changed the disassembly of i386 opcode "fildl" and "fistpl" to not use the 'l' suffix because of the added i386 opcode "fildll" to be the same as "fildq" and "fistpll" to be the same as "fistpq" (done for Radar bug #2909568). Changes for the 5.11 release (the cctools-437 release): - Fixed the disassembly of jbsr ppc instruction's (those with JBSR relocation entries) so the "true target address" is correctly printed. This fix is in print_immediate() in ppc_disasm.c where the value should just be other_half not "other_half + value". Radar bug #3046962. - Fixed the printing of the pair JBSR relocation when it is a scattered relocation to point at the r_value as the other half "<- other_half". This fix is in print_relocs() in ofile_print.c. Radar bug #3046962. - Added the disassembly of the fxsave instruction in i386_disasm.c. Radar bug #2972491. Changes for the 5.10 release (the cctools-422 release): - Added the disassembly of some pentium pro instructions in i386_disasm.c. Radar bug #2928507. - Added printing S_ATTR_STRIP_STATIC_SYMS to print_section() in ofile_print.c . Radar bug #2945659. Changes for the 5.10 release (the cctools-421 release): - Added printing MH_NOFIXPREBINDING in print_mach_header() in ofile_print.c . Radar bug #2941669. Changes for the 5.10 release (the cctools-416 release): - Removed the printing S_ATTR_WEAK_DEFS to print_section() in ofile_print.c. Radar bug #2919646. - Added the -m option to not use the archive(member_syntax) for file names. Radar bug #2904708. Changes for the 5.10 release (the cctools-414 release): - Added printing S_ATTR_WEAK_DEFS to print_section() in ofile_print.c. Radar bug #2898558. Changes for the 5.10 release (the cctools-409.1 release): - Changed print_literal8() in ofile_print.c to use: /* l0 is the high word, so this is equivalent to if(isfinite(d)) */ if((l0 & 0x7ff00000) != 0x7ff00000) instead of: if(finite(d)) so otool will not have to link with libm. The Makefile was also changed. Changes for the 5.10 release (the cctools-403 release): - Removed the hack in the Makefile to use cc when $(CC) is gcc3 when linking to work that was working around Radar bug #2814731 now that gcc-1009 fixes it. Changes for the 5.10 release (the cctools-400 release): - Changed the Makefile back to again use the -dependency-file with gcc. - Changed the hack in the Makefile to use cc when $(CC) is gcc3 when linking to work around Radar bug #2814731. Changes for the 5.10 release (the cctools-396 release): - Added a hack in the Makefile to use cc when $(CC) is gcc when linking to work around Radar bug #2814731. - Changed the Makefile to not use the -dependency-file with gcc as well as mwccppc. - Added an include to m68k_disasm.c, i860_disasm.c, m88k_disasm.c, and ppc_disasm.c to pick up the prototype for memcpy(). Changes for the 5.10 release (the cctools-393 release): - Added code to ofile_print.c to deal with the new LC_LOAD_WEAK_DYLIB command. Changes for the 5.10 release (the cctools-392 release): - Changed the call to ofile_process() in main.c to pass TRUE for the new use_member_syntax parameter. Radar bug #2730127. Changes for the 5.10 release (the cctools-389 release): - Added the -D option to print just the LC_ID_DYLIB name. Changes for the 5.10 release (the cctools-388 release): - Fixed the spelling of Inconsistant to be Inconsistent in main.c and ofile_print.c. Radar bug #2783706. Changes for the 5.10 release (the cctools-386 release): - Added code in print_loadcmds() in ofile_print.c to parse and print LC_PREBIND_CKSUM load commands. Changes for the 5.9 release (the cctools-370 release): - Added printing MH_NOMULTIDEFS in print_mach_header() in ofile_print.c . - Added code in main() in main.c and the routine print_hints() to ofile_print.c to print the two-level namespace hints. Changes for the 5.9 release (the cctools-367 release): - Added code in print_loadcmds() in ofile_print.c to parse and print LC_SUB_LIBRARY load commands. Radar bug #2697458 - Added code in print_loadcmds() in ofile_print.c to parse and print LC_TWOLEVEL_HINTS load commands. Radar bug #2558069. Changes for the 5.9 release (the cctools-360 release): - Picked up the changes to print_objc.c from Radar bug #2660421 (open source submittion). Changes for the 5.9 release (the cctools-359 release): - Added -Wno-long-double to shutup the compiler for . Changes for the 5.8 release (the cctools-357 release): - Added support for the CPU_SUBTYPE_POWERPC_7450 in ofile_print.c . Radar bug #2599869. Changes for the 5.8 release (the cctools-355 release): - Changed the printing of sections marked with S_ATTR_SOME_INSTRUCTIONS so that they are disassembled. This is to aid coalesced sections created by the compiler that are not marked with S_ATTR_PURE_INSTRUCTIONS as they contain jump tables (Radar bug #2580311). Changes for the 5.8 release (the cctools-342 release): - Added a print_sub_client_command() to ofile_print.c . Radar bug #2533649. - Added printing MH_TWOLEVEL and MH_FORCE_FLAT to print_mach_header() in ofile_print.c. Radar bug #2534043. Changes for the 5.8 release (the cctools-341 release): - Changed print_immediate() in ppc_disasm.c to also check for PPC_RELOC_SECTDIFF as it is incorrectly printing out "Stray PPC_RELOC_PAIR relocation entry". This is happening because switch tables for (__TEXT,__coalesced_text) sections are placed in line. This is done because ld(1) complains about illegal references to coalesced symbols being used with section difference relocation entries. Changes for the 5.7 release (the cctools-336 release): - Added printing NO_TOC to print_section(). Radar bug #2494286. Changes for the 5.7 release (the cctools-334 release): - Added printing LAZY_INIT to print_mach_header() in ofile_print.c. Radar bug #2490396. Changes for the 5.7 release (the cctools-329 release): - Changed iinit and ninit fields of the struct dylib_module in print_module_table() in ofile_print.c to iinit_iterm and ninit_nterm and printed them as 2 numbers each. Radar bug #2469527. Changes for the 5.7 release (the cctools-328 release): - Changed the Makefile so that it would use -L/usr/local/lib/system moving forward and -L/Local/Developer/System when RC_RELEASE is Gonzo, Bunsen or Beaker. Changes for the 5.7 release (the cctools-327 release): - Changed the Makefile so that it would use -L/AppleInternal/Developer/System moving forward and -L/Local/Developer/System when RC_RELEASE is Gonzo, Bunsen or Beaker. Changes the 5.6 release (the cctools-320 release): - Added support for the new LC_SUB_FRAMEWORK load command to support "Guarding against direct linking of non-umbrella frameworks". The files ofile_print.c and ofile_print.h were updated. Radar bug 2443212. Changes the 5.6 release (the cctools-316 release): - Added printing the mach header flag MH_SPLIT_SEGS to ofile_print.c. Changes the 5.5 release (the cctools-307 release): - Fixed some bugs in print_relocs() in ofile_print.c for ppc section difference relocations. It was incorrectly printing "half = 0x????\n" some times which lead to an extra "\n" and difficulty in determining which relocation entry an error message was refering to due to the extra lines in the output. - Added support for the CPU_SUBTYPE_POWERPC_7400 in ofile_print.c . Radar bug #2397523. - Fixed a bug in get_sect_info() where it was not comparing the segment name in an object file. This caused it to pick the first section if their were segments with the same section names. Changes the 5.4 release (the cctools-300 release): - Added printing the new LC_ROUTINES load command. - Added the S_COALESCED section type in section structures. Changes the 5.3 release (the cctools-292 release): - Added some braces to get rid of the warning message from the egcs compiler "warning: suggest explicit braces to avoid ambiguous `else'". This was done to m68k_disasm.c, i860_disasm.c and sparc_disasm.c . - Changed the return type of main() in main.c from void to int to remove a warning from the egcs compiler. Also changed the exit()'s calls at the end to return()'s. Changes for the 5.3 release, (the cctools-286 release): - Added support for printing S_MOD_TERM_FUNC_POINTERS in print_section() in ofile_print.c . Changes for the 5.3 release, (the cctools-285 release): - Fixed the i386 opcode of cmpxchg from 0x0fa6 (as it is in the i486 manual) to 0x0fb0 which is correct (as it is in the Pentium manual). Changes for the 5.3 release, MacOS X bring up (the cctools-282 release): - Changed the printing of the ppc_thread_state to not use bit fields for srr1, cr and exr to match the ppc_thread_state for Rhapsody/MacOS X. - Changed the Makefile to allow for RC_OS=macos for MacOS X builds. - Added a few casts in places to get it to compile with the MetroWerks compiler without -relax_pointers. - To get around the problem with the MetroWerks compiler using -framework System when -static is used the Makefile was changed to if out the -static flag and -static link for mwcc. Changes for the 5.2 release (the cctools-274 release): - Removed the uses of CPU_SUBTYPE_586SX in ofile_print.c and added support for new intel subtypes. Radar bug #2231830. Changes for the 5.2 release (the cctools-272 release): - Removed the reference to the header file "objc/NXString.h" in print_objc.c as this file is going away. print_objc.c now just defines the layout of struct objc_string_object directly. Radar bug #2231010. Changes for the 5.2 release (the cctools-267 release): - Added all the suport needed for the 4.4BSD extended format #1 for long names. Radar bug #1670513. Changes for the 5.1 release (the cctools-261 release): - Added disassembling dcba to ppc_disasm.c. - Updated print_special_register_name() in ppc_disasm.c to add the special register names to match the assembler. - Changed otool's use of CPU_SUBTYPE_POWERPC_740 to CPU_SUBTYPE_POWERPC_750. - Fixed a bug that in processor() in main.c where indirect_symbols and nindirect_symbols were not initialized. This caused printing of symbol stub sections to to call guess_indirect_symbol() with bad results (print incorrect stuff or crash). - Fixed a bug in the ppc disasembler where it was printing the prediction of branch conditionals which had the BO 1z1zz (20 decimal) encoding. See page 4-53 of the PowerPC green book. Changes for the 5.1 release (the cctools-260 release): - Added -c to all the install commands in the Makefile. Changes for the 5.1 release (the cctools-255 release): - Added disassembling the VMX opcodes. Radar bug 2004760. Changes for the 5.1 release (the cctools-253 release): - Changed the Makefile to only create the needed dst directories. Changes for the 5.1 release (the cctools-252 release): - Changed the ppc dissassembly of "addis rX,0,immed" to "lis rX,immed" and "addi rX,0,immed" to "li rX,immed". - Added guess_indirect_symbol() to be used by the disassemblers to print as a comment the stub name. Changed the ppc, i386, m68k and sparc disassemblers to use this. Changes for the 5.1 release (the cctools-247 release): - Added MKDIRS if code to the Makefile to build native on Rhapsody. - Changed the Makefile to use gnutar instead of tar because it works on Rhapsody where tar does not. - Changed the Makefile to install otool in /usr/bin for RC_OS teflon and in /bin for RC_OS nextstep (Radar 1673496). Changes for the 5.0 release (the cctools-242 release): - Removed the non-existant instructions "stmd", "mtpmr" and "mfpmr". Changes for the 5.0 release (the cctools-240 release): - Changed printing the first agrument of fcmpo and fcmpu to crX not just a number. - Changed ldu, lfdu, lfsu, lhau, lwzu, stbu, stdu, stfdu, stfsu, sthu and stwu to print the RA parameter r0 not 0 when it is zero. Note these are an invalid forms. - Changed lbzx, ldx, lfdx, lfsx, lhax, lhbrx, lhzx, lwax, lwbrx, lwzx, stbx, stdx, stfdx, stfiwx, stfsx, sthbrx, sthx, stwbrx, stwx, dcbi, eciwx, ecowx, icbi to print the RA parameter as 0 not r0 when it is zero. - Removed the non-existant instruction "lmd". Changes for the 5.0 release (the cctools-236 release): - Added disassembling mulld[o][.] . - Changed printing the first operand of mcrfs and mcrxr to print it as a cr register name not just a number. - Changed printing the operands of mcrf to print them as cr register names not just numbers. - Added the -Z to don't use simplified ppc mnemonics in disassembly. Code was added for "cmp", "bc", "cmpi", "cmpl" and "cmpli". - Added disassembling the "mttbl rS" for "mtspr 284,rS" and "mttbu rS" for "mtspr 285,rS". - Removed the incorrect PowerPC disassembly of mttb and mttbu. Changes for the 5.0 release (the cctools-235 release): - Added printing the PPC_RELOC_JBSR and disassembling with it. - Removed the #if 0 code that was replaced by print_relocs(). - Fixed a bug with otool -s __TEXT __text core dumping. Line 365 in main.c needs an else (bug #79050). - Added the PowerPC disassembly of the eciwx, ecowx, fres[.], fsqrts[.], frsqrte[.], fsel[.], fsqrt[.], stfiwx and tlbsync instructions. Changes for the 5.0 release (the cctools-227 release): - Changed print_argstrings() used for -c to use get_stack_addr_from_flag() from libstuff and removed all the *_usrstack.c files. - Made otool -c work for PowerPC core files. Changes for the 5.0 release (the cctools-224 release): - Changed including to which uses unsigned long instead of off_t (64 bits on Teflon). - Added printing of the ppc_float_state_t and ppc_exception_states. - Updated ofile_print.c with the updated PowerPC subtypes. Changes for the 5.0 release (the cctools-221 release): - Picked up the changes for the correct Rhapsody thread state changes into ofile_print.c. Changes for the 5.0 release (the cctools-215 release): - Fixed disassembly for the PowerPC instructions mftb and mftbu. Changes for the 5.0 release (the cctools-214 release): - Added support for PowerPC disassembly using SECTDIFF relocation types. - Added support for printing PPC_RELOC_HI16_SECTDIFF, PPC_RELOC_LO16_SECTDIFF, and PPC_RELOC_HA16_SECTDIFF relocation types. Changes for the 5.0 release (the cctools-212 release): - Changed tlbiex to tlbie and slbiex to slbie (also corrected the opcodes). - Added the ppc specific cpu subtypes to be printed. Changes for the 5.0 release (the cctools-210 release): - Changed mulwd to mulhw . - Changed mull to mullw and mullo to mullwo . - Changed m98k to ppc. Changes for the 4.0 release (the cctools-189 release): - Updated objc_print.c to reflect changes in Objc-C runtime structures. Changes for the 4.0 release (the cctools-188 release): - Added printing the __cstring_object section like the __string_object section (bug #61840). Changes for the 4.0 release (the cctools-185 release): - Printed the time stamp for -Lv for dynamic libraries. Changes for the 4.0 release (the cctools-173 release): - Added printing the LC_PREBOUND_DYLIB load command. Changes for the 4.0 release (the cctools-170 release): - Added printing MH_PREBOUND. Changes for the 4.0 release (the cctools-168 release): - Picked up the sparc changes to sparc_disasm.c . - Picked up the sparc changes to sparc_r_types[] in ofile_print.c . - Change the version numbers of dynamic library to the form X[.Y[.Z]] to match how next does versioning of it's projects. This effected libtool(1), ld(1), otool(1), dyld, libstuff(version_number.c) and man pages for ld and libtool bug #55627). In here the changes were in ofile_print.c . - Added -T, -M, -R and -I to the usage print out. Changes for the 4.0 release (the cctools-156 release): - Fixed a that caused sections with S_ATTR_PURE_INSTRUCTIONS set not to be disassembled. This was casued by S_ATTR_SOME_INSTRUCTIONS also being set and the code in main.c checking the SECTION_ATTRIBUTES equal to S_ATTR_PURE_INSTRUCTIONS and not just checking for that bit. Changes for the 4.0 release (the cctools-158 release): - Fixed a bug that caused printing of shlib and dyld names to be wrong. Basicly the part of the structure that needed to be swapped was copied but the original pointer needed to be passed to the routine to print the name part of the structure. This was introduced with the change for cctools-150 below. Changes for the 4.0 release (the cctools-154 release): - Added support for printing indirect symbol table entries for stripped defined externals. Strip uses the values INDIRECT_SYMBOL_LOCAL and INDIRECT_SYMBOL_ABS to represent the symbols that are defined that were stripped otool prints these as LOCAL and ABSOLUTE. Changes for the 4.0 release (the cctools-150 release): - Fixed a bug in printing load commands that caused the thread commands on hppa to be printed swapped. This was the same bug as the otool -L bug below where the wrong size to memcpy was used to copy the load command. Changes for the 4.0 release (the cctools-149 release): - Added printing the section attribute SOME_INSTRUCTIONS. - Removed printing the section attribute RELOC_AT_LAUNCH. - Added printing the mach header flag BINDATLOAD. - Fixed a bug in print_libraries for otool -L with dynamic libraries that memcpy'ed the wrong size into the dylib_command (bug #50440). Changes for the 4.0 release (the cctools-148 release): - Changed how otool gets built. It how gets built with -static. Changes for the 4.0 release (the cctools-140 release): - Picked up sparc changes to sparc_disasm.c. - Added printing MH_BUNDLE filetype. Changes for the 4.0 release (the cctools-138 release): - Picked up a change to sparc_disass.c. It was getting the targets for branches with negative displacements wrong. Changes for the 4.0 release (the cctools-135 release): - Fixed a bug in otool for sparc disassembly in the routine print_symbolic() which printed the wrong value for branch instructions when relocation entries were not present. The problem was it was adding in the pc to the target value which already had the pc added to it. - Fix for Tracker 41317 [as(hppa) : does not support cache control hints.] otool/hppa-dissasm.c changed to disassemble the new parsing rule changes. Changes for the 4.0 release (the cctools-133 release): - Picked up the sparc changes to sparc_disasm.c. - Picked up the sparc changes for printing the floating-point sparc thread. Changes for the 4.0 release (the cctools-132 release): - Picked up the sparc changes for sparc_disasm.c and m88k_disasm.c. - Picked up the sparc changes for printing the sparc thread. Changes for the 3.3 release (the cctools-128 release): - Fixed otool -c for the hppa. Had to add special code in print_argstrings() in main.c to deal with the different stack layout (bug #40373). - Removed the spaces printed before the register names for the hppa disassembler in 4 places. Changes for the 3.3 release (the cctools-127 release): - Fixed a bug when the a zero fill section was attempted to be printed without -v which caused otool to core dump (bug #42127). Changes for the 3.3 release (the cctools-122 release): - Fixed a bug in printed byte swapped tocs for a dylib. The code in main.c had some copy and paste errors in it's allocate() and memcpy() before the call to swap_dylib_table_of_contents(). Changes for the 3.3 release (the cctools-119 release): - Picked up first round of changes for the sparc target. This work is incomplete. - HPPA, changed main.c, otool.h, ofile_print.c and Makefile to fix bug # 39398 (otool does not understand certain thread states for hppa). Added hppa_usrstack.c for the same. Changes for the 3.3 release (the cctools-115 release): - Changed print_symbol() in ofile_print.c to take an extra parameter, dot_value, the value of the address being dissassembled which is only used for the value of the -symbol in a SECTDIFF relocation entry if their is no symbol that matches that value. Changes for the 3.3 release (the cctools-104 release): - Made a quick but incorrect fix for jbsr disassembly in hppa_disasm.c by passing the sect_addr as the first parameter to print_immediate() in the jbsr case '@' this will not work if a jbsr to a different section is used. Changes for the 3.3 release (the cctools-103 release): - Fixed a bug in hppa_r_types[] array which has only 15 (not 16 enties). Changes for the 3.3 release (the cctools-102 release): - Integrated in the hppa support. different otool/Makefile (integrated for cctools-102) Using cctoolshppa-37. New hppa files. Changed to remove hppa-opcode.h. different otool/i386_usrstack.c (no changes for cctools-102) Using cctools-29. Late 3.2 fixes the hppa base did not have. different otool/m68k_usrstack.c (no changes for cctools-102) Using cctools-29. Late 3.2 fixes the hppa base did not have. different otool/main.c (integrated for cctools-102) Using cctoolshppa-37. Call to hppa_disassemble() added. different otool/ofile_print.c (integrated for cctools-102) Using cctoolshppa-37. Printing hppa cputypes and relocs added. Fixed some print space problems in the master clone ~comp/cctools-29. Only in cctoolshppa-37/otool: hppa_disasm.c (integrated for cctools-102) Pickup cctoolshppa-37/otool/hppa_disasm.c from cctoolshppa-37 and Changed line 9 from: #include "hppa-opcode.h" to #include "../as/hppa-opcode.h" Changed line 412 from: struct scattered_relocation_info *srp, *spairp; to struct scattered_relocation_info *srp; to remove a warning. Changed line 630 from: return HPPA_RELOC_NORELOC; to return 0xffffffff; since HPPA_RELOC_NORELOC was removed from mach-o/hppa/reloc.h Changes for cctools-102: moved some functions into libstuff/hppa.c as suggested by the comments. Only in cctoolshppa-37/otool: hppa_disasm.h (integrated for cctools-102) Pickup cctoolshppa-37/otool/hppa_disasm.h from cctoolshppa-37. Only in cctoolshppa-37/otool: hppa-opcode.h (also NOT pick up for cctools-102) This is simmilar but different to hppa-opcode.h in ../as . This was not picked up but hppa_disasm.c was changed to include ../as/hppa-opcode.h Changes for the 3.3 release (the cctools-101 release): - Made sections with the attribute S_ATTR_PURE_INSTRUCTIONS disassemble with the -v flag. Also had to fix the disassemblers to add sect_addr parameter to subract from the address when looking for relocation entries. - Added -I to print the indirect symbol tables. - Added code to print the dysymtab. Changes for the 3.3 release (the cctools-100 release): - First major round of changes for the new shlib stuff. 1) In otool's disassemblers (m68k and i386) support for possition-independent code through the SECTDIFF relocataion type. - Fixed a bug in the m68k disassembler for mulsl where the 2 register form did not disassemble the Dl register correctly (bug #38530). - Fixed a bug in the m68k disassembler for bcc branches of 16-bit and 8-bit displacements not getting their target calculated correctly (bug #38531). - Fixed a bug in the m68k disassembler for dbcc instructions where the 16-bit displacements were not getting their target calculated correctly. Changes for the 3.2 release (the cctools-24 release): - Fixed a bug in print_argstrings() which was using printf(%s) and that could not correctly deal with a string that did not end in a '\0' before the memory that contained the string ended (bug #33672). Changes for the 3.1 release (the cctools-22 release): - Added printing for these (bug #32553): { "any", CPU_TYPE_ANY, CPU_SUBTYPE_MULTIPLE }, { "little", CPU_TYPE_ANY, CPU_SUBTYPE_LITTLE_ENDIAN }, { "big", CPU_TYPE_ANY, CPU_SUBTYPE_BIG_ENDIAN }, Changes for the 3.1 release (the cctools-21 release): - Fixed a few bugs in print_objc.c the had arguments reversed so things got swapped when they shouldn't have. Changes for the 3.1 release (the cctools-15 release): - Flushed out the swap_* stubs in print_objc.c. - Updated the printing of the m98k cpu flavor to use it's correct definition. Changes for the 3.1 release (the cctools-14 release): - Added the opcodes for tlbiex (31,338) and tlbia (31,370). - Changed the m98k instructions: lwarx, ldarx, stwcx. and stdcx. second arg from just a greg to 0 or a greg (r1-r31). - For the m98k disassembler removed "mr" for "ori Rx,Ry,0" because the 0 could have a relocation entry and it really could be an "ori" not a "mr" (move register). Changes for the 3.1 release (the cctools-13 release): - Added the m98k (PowerPC) architecture. This includes a kludged mach/m98k/thread_status.h with only an entry point. Changes for the 3.1 release (the cctools-10 release): - Fixed two bugs in the i386 disassembler. First the displacement routine needed to sign extend it's value if it was a byte or short before doing the addition. Second for the 8-bit jumps the operand size needs to be printed as a long not a byte (bug #29789). Changes for the 3.1 release (the cctools-9 release): - Fixed otool -c for the m88k and i386 architectures (bug #29639). This required a file for each arch that included so the value of USRSTACK could be returned. Changes for the 3.1 release (the cctools-8 release): - Added symbolic disassembly for the i386 arch. This involved a major clean up of i386_disasm.c . Changes for the 3.1 release (the cctools-7 release): - Added the i485 and i586 instructions to the dissembler for the i386 arch. - Added a comment character '#' before in the sprintf lines "#***** Error - bad opcode" in _bits.c for disassembling the i386. Changes for the 3.1 release (the cctools-5 release): - Picked up the lono team's mods to ofile_print.c for changes to the i386 thread_status.h. Changes for the 3.1 release (the cctools-4 release): - Changed the arch name from ix86 to i386. - Changed CPU_TYPE_I80x86 to CPU_TYPE_I386 in main.c that was missed. Changes for the 3.1 release (the cctools-3 release): - Changed CPU_TYPE_I80x86 to CPU_TYPE_I386 and removed CPU_SUBTYPE_AT386 CPU_SUBTYPE_EXL . Changes for the 3.1 release (the cctools-1 release) - Created the otool directory with the 3.1 otool.