TODO: Add flags for: -debug -no_dos_header Add support for: - Remove empty __IMPORT segment Changes for the 5.27 release (the cctools-754 release): - Changed mtoc(1) to not create a .reloc section if it would have a zero size. Also changed mtoc(1) to include the SizeOfHeaders in SizeOfImage. Radar bug #6795386 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 a cast to int for a switch statement in process_32bit_arch() in mtoc.c - Commented out the if statement with an empty body with a TODO comment in create_base_reloc() in mtoc.c . Changes for the 4.26 release (the cctools-717 release): - Added the -d filename option to mtoc(1) which adds a debug directory entry in the .debug section with the file name. Radar bug #6211642. Changes for the 4.26 release (the cctools-716 release): - Fixed bugs in mtoc(1) in create_32bit_symbol_table() and create_64bit_symbol_table() that was not ignoring stabs with the N_STAB bits set when checking for undefined symbols. Radar bug #6194828. Changes for the 4.26 release (the cctools-715 release): - Changed mtoc(1) to remove the HACK_ARM_F_MAGIC_TO_BE_I386 define and code so now the f_magic field for arm gets set to IMAGE_FILE_MACHINE_ARM (0x01c0). Radar bug #6163015. Changes for the 4.26 release (the cctools-705 release): - Ported mtoc.c to run on 64-bit hosts by changing unsigned long to uint32_t and SWAP_LONG to SWAP_INT. Radar bug #6022298. Changes for the 5.26 release (the cctools-701 release): - Added the -align option to mtoc(1) to set the file and segment alignment. Changes for the 5.26 release (the cctools-699 release): - Fixed a problem with the SizeOfImage field in the aouthdr not including the "zerofill" part of the sections. This is also include in the bsize which causes it to be included in the SizeOfImage. Also removed the check to require the section alignment to be greater or equal to the file alignment. Changes for the 5.25 release (the cctools-688 release): - Fixed a problem in mtoc(1) selection of the address for the .reloc PECOFF section. To work around the unified linker incorrectly producing a LINKEDIT segment the code in process_32bit_arch() and process_64bit_arch() needed to ingore this segment when selecting the address. Changes for the 5.25 release (the cctools-687 release): - Added 64-bit checking for undefined symbols. Changes for the 5.25 release (the cctools-686 release): - Added the "-section_alignment <hex_value>" option. This should be passed the same value as passed to the linker in the -segalign value when creating the Mach-O file. This value is used to layout the added .reloc section and set into the PECOFF aouthdr. - Added a check to make sure the headers are not mapped on top of its sections. If it does you get an error message saying the Mach-O needed to be relinked and the -seg1addr value to use. - Added alternate names for the subsystem arguments. - Added checking for undefined symbols (32-bit only). Changes for the 5.25 release (the cctools-685 release): - Updated mtoc(1) to deal with MH_EXECUTE file types and MH_PIE flag. Changes for the 5.25 release (the cctools-681 release): - Added the new mtoc(1) program to the cctools project. Radar bug #5536661. - The -e entry_point is a temporary hack until 64-bit files are produced with MH_PRELOAD and have an entry point in the thread command. - The makerelocs(1) program in here is not installed as it would overwrite the existing one in the efitools project. But this one could replace it but the new mtoc(1) program includes that and makes it obsolete. But is useful to test with.