1To Do: 2- Add the -prebind_allow_overlap and -prebind_all_two_level_modules to libtool 3 see Radar bug 3417137. 4- Change to Doug's approach to relayout, namely something like reserving the 5 last 10% of the load region for new dylibs and then evenly spacing the 6 existing dylibs in the other 90% (for split libs). See email of 11/6/2000. 7- Have cmpdylib check Objc info Tracker bug #78124. 8- Fix a bug in strip on line 1105 where it uses missing_reloc_symbols when it 9 could have been set otherwise and does not print the next line. 10- Maybe add fat support for segedit(1) 11 12Changes for the 5.33 release (the cctools-845 release): 13- Changed strip(1) to use libc++ instead of libstdc++ . Radar bug #13470497. 14 15Changes for the 5.33 release (the cctools-842 release): 16- Changed lipo(1) to use a temporary file for its output and do a final 17 rename(2) to make it atomically create the output file. The changes were 18 in create_fat() in lipo.c . Radar bug #13045167. 19- Fixed a bug in install_name_tool(1) when more than one -add_rpath options are 20 used. Radar bug #13012481. 21- Changed lipo(1) so it uses 16k pages for ARM binaries. Radar bug #13080176. 22 23Changes for the 5.33 release (the cctools-840 release): 24- Added support for new archs: armv6m / armv7m / armv7em and updated lipo.c . 25 Radar bug #11314463. 26- Tried to changed to use libc++ instead of libstdc++ but libprunetrie.a needs 27 to be changed first. For now this is line in the Makefile: 28 #CXXLIB = -stdlib=libc++ 29 is commented out which is the needed change. Radar bug #12624622. 30 31Changes for the 5.33 release (the cctools-839 release): 32- Changed the Makefile so that strip(1)'s use of <mach-o/prune_trie.h> and 33 libprunetrie.a so that it comes from DT_TOOLCHAIN_DIR. Radar bug #12296255. 34 35Changes for the 5.32 release (the cctools-835 release): 36- Fixed a bug in strip(1) when the input was a .o file containg 37 LC_FUNCTION_STARTS load command. The code in get_starting_syminfo_offset() in 38 strip.c did not look for the load command which can be the start of the 39 symbolic offset in the file. Radar bug #11913911. 40 41Changes for the 5.32 release (the cctools-833 release): 42- Changed strip(1) to always use ld -r on ARM .o files to rename thumb symbols 43 so they don't get stripped. Radar bug #11795809. 44 45Changes for the 5.32 release (the cctools-830 release): 46- Fixed a bug in nmedit(1) when the input was a .o file containg a 47 LC_DATA_IN_CODE load command. The code in get_starting_syminfo_offset() in 48 strip.c did not look for the load command which can be the start of the 49 symbolic offset in the file. Radar bug #11554503. 50- Fixed a bug in libtool(1) when run as ranlib(1) to not update the table of 51 contents if the input archive's table of content's member name is not using 52 the extended long name format and we create an table of contents with a 53 extended long name format (or vice a versa). Radar bug #10399314. 54 55Changes for the 5.31 release (the cctools-827 release): 56- Added #ifdef guards for LTO_SUPPORT in lipo.c . Radar bug #11296366. 57 58Changes for the 5.31 release (the cctools-825 release): 59- Fixed the full strip case with -no_uuid that was not stripping the LC_UUID 60 load command. A call to strip_LC_UUID_commands() was added to strip_object() 61 in strip.c for the full strip case. Radar bug #11136733. 62 63Changes for the 5.31 release (the cctools-824 release): 64- Removed the creation of the link to /usr/local/bin/nmedit from 65 $(DSTROOT)$(LOCBINDIR)/nmedit in the Makefile. Radar bug #10688477. 66- Fixed a bunch of places in libtool(1) that was using 32-bit variables to hold 67 offsets and sizes. Radar bug #10645295. 68 69Changes for the 5.30 release (the cctools-822 release): 70- The "low risk fix to strip(1)" below in cctools-821 for Radar bug #10718585 71 breaks striping .o files with dwarf debug info. Because the input file has 72 an "ld -r" run on it so it is not the original input file. That change has 73 been backed out. 74- The correct fix for strip(1) in dealing with code signed binaries is to 75 added up the sizes of the output and input parts in the right order. So the 76 code in strip_object() has been updated to do this. Radar bug #10709632. 77 78Changes for the 5.30 release (the cctools-821 release): 79- Made a low risk fix to strip(1) to fix bugs when stripping objects with 80 code signature data. The problem is that the code in strip_object() that is 81 calculating object->input_sym_info_size is incorrect as it is not adding the 82 elements up in their order and rounding the size for elements that are aligned 83 like the code signature info. So as a low risk fix code was added in 84 dyld_order() in checkout.c in libstuff that records the size of the symbolic 85 information. Then in strip_object() it simply overwrites the previously 86 incorrectly calculated value for object->input_sym_info_size with that. 87 Radar bug #10718585. 88- Fixed a bug in codesign_allocate(1) that was incorrectly using the value of 89 sizeof(struct mach_header) for a 64-bit binary when testing if there was 90 enough room to add the load command. Radar bug #10652697. 91- Updated the code in pagestuff(1) to have parts for the dyld info and correctly 92 handle dylib stubs who's section contents do not appear in the binary. 93 94Changes for the 5.30 release (the cctools-820 release): 95- Removed the use of vers_string(1) from the Makefile. Radar bug #10596469. 96 - Updated libtool.c to print "Apple Inc." not "Apple Computer, Inc." and the 97 comment where apple_version[] comes from. 98 - Added a reference to apple_version[] in checksyms.c, cmpdylib.c, lipo.c, 99 size.c, strings.c, nm.c, redo_prebinding.c, seg_addr_table.c, check_dylib.c 100 codesign_allocate.c, ctf_insert.c, seg_hack.c, install_name_tool.c, indr.c, 101 strip.c and pagestuff.c. 102 103Changes for the 5.30 release (the cctools-818 release): 104- Fixed strip(1) to account for the size of the function starts data when the 105 binary does not have a dynamic symbol table command. It should have 106 conditionalized on having a dynamic symbol table command but just the load 107 command that has the data. Radar bug #10506809. 108 109Changes for the 5.30 release (the cctools-816 release): 110- Changed ctf_insert(1) to allow a static binary with a dynamic symbol table 111 load command that has local relocation entries. Radar bug #10405248. 112 113Changes for the 5.30 release (the cctools-815 release): 114- Added the os_tools_install target in the Makefile that only builds lipo(1) 115 and strings(1). Radar bug #10391158. 116 117Changes for the 5.30 release (the cctools-814 release): 118- Changed strip(1) to use "ld -r" on 32-bit objects now that the blocking 119 bug in ld(1) is fixed. Radar bug #7076828. 120- Added support for new load commands LC_MAIN, LC_DATA_IN_CODE, 121 LC_SOURCE_VERSION and LC_DYLIB_CODE_SIGN_DRS. 122 - Updated install_name_tool.c, pagestuff.c, redo_prebinding.c, strip.c, 123 codesign_allocate.c, ctf_insert.c, indr.c and inout.c . 124 Radar bug #10290817. 125- Fixed ctf_insert(1) to correctly handle the LC_FUNCTION_STARTS load command 126 and update it and move its data. Radar bug #10171548. 127 128Changes for the 5.30 release (the cctools-811 release): 129- Changed the Makefile setting CXX to use c++ not g++. Radar bug #10057952. 130 131Changes for the 5.30 release (the cctools-809 release): 132- Changed lipo(1) to determine the architecture of bitcode files, including 133 as archive members. Radar bug #9087924. 134 135Changes for the 5.30 release (the cctools-808 release): 136- Fixed a bug in create_library() in the loop that adjusted the ranlib structs 137 ran_off was using the incorrect index value for: 138 archs[0].toc_ranlibs[i].ran_off = archs[0].members[i].input_member_offset; 139 which should have been: 140 archs[0].toc_ranlibs[i].ran_off = archs[0].members[j].input_member_offset; 141 Radar bug #9830754. 142 143Changes for the 5.29 release (the cctools-805 release): 144- Changed create_library() in libtool.c to check the new ofile bad_toc field 145 and cause it to create a new library when this happens. Radar bug #9475790. 146 147Changes for the 5.29 release (the cctools-803 release): 148- Changed libtool.c when running as ranlib(1) to attempt to update the table 149 of contents in place for the common case for thin archives. And removed the 150 the time stamp checking for the "nop" ranlib case, which now ends up with just 151 "touching" the file and adjusting the timestamps. Radar bug #9354605. 152 - Factored out existing code into new routines get_target_byte_sex() and 153 put_toc_member(). 154 - Changed process() and removed the time stamp checking for the "nop" ranlib 155 case. 156 - Added the input_member_offset field to the struct member and added code to 157 set its value in add_member(). 158 - Changed create_library() to take an ofile which is non-NULL if run as 159 ranlib(1) and a thin archive. 160 - Added code in create_library() to update the table of contents in place. 161 And code to only "touch", write the SARMAG, if the table of contents is 162 the same. This code has to use the input_member_offset in cases that the 163 thin input archive would not be same as produced by libtool(1) but still 164 has member offsets at acceptable alignments. 165 166Changes for the 5.29 release (the cctools-802 release): 167- Fixed a problem with the change to libtool(1) for Radar bug #9354501. It was 168 not setting toc_uptodate to TRUE and was not doing this only when 169 cmd_flags.ranlib == TRUE. Radar bug #9418154. 170 171Changes for the 5.29 release (the cctools-801 release): 172- Changed process() in libtool.c to check that the table of contents was up to 173 date based on the file's time stamp and the table of contents time stamp for 174 archive files. Then if it ranlib(1) being run do nothing if it is up to date. 175 Radar bug #9354501. 176- Fixed a bug in the error handling of pagestuff(1) when used with the -arch 177 argument but missing an argument for which page. Radar bug #8979851. 178 179Changes for the 5.29 release (the cctools-800.3 release): 180- Added support for armv7[fsk] to print_arch() in lipo.c . Radar bug #8987684. 181 182Changes for the 5.28 release (the cctools-798 release): 183- Added this line to the Makefile: 184 CXX = $(shell xcrun -find -sdk $(SDKROOT) g++) 185 so that it uses the appropriate tool to link device-side code. Radar bug 186 #8684965. 187 188Changes for the 5.28 release (the cctools-797 release): 189- Added support for LC_DYLD_ENVIRONMENT in segedit.c . Radar bug #8653976. 190 191Changes for the 5.28 release (the cctools-796 release): 192- Added checks in strings(1) to better protect against crashes if it is handed 193 a malformed file. Radar bug #8599283. 194- Added the -arch option to pagestuff(1). Radar bug #8379048. 195 196Changes for the 5.28 release (the cctools-795 release): 197- Changed ctf_insert(1) to allow the LC_FUNCTION_STARTS load command. The 198 change was in ctf_insert() in ctf_insert.c to remove the test for 199 object->func_starts_info_cmd != NULL . Radar bug #8490836. 200 201Changes for the 5.28 release (the cctools-793 release): 202- Fixed a problem in nm(1) not checking that a symbol is not undefined before 203 checking that is a [symbol resolver] symbol. Radar bug #8429570. 204 205Changes for the 5.28 release (the cctools-792 release): 206- Fixed more problems with incorrect support for LC_FUNCTION_STARTS. There were 207 missing output_func_start_info_data and output_func_start_info_data_size 208 fields in the struct object that should have been used. Updated the code in 209 codesign_allocate.c, indr.c, inout.c, install_name_tool.c, redo_prebinding.c 210 and strip.c which was incorrectly using output_split_info_data and 211 output_split_info_data_size two use the new fields. Radar bug #8401082. 212 213Changes for the 5.28 release (the cctools-790 release): 214- Fixed problems with the incorrect support for LC_FUNCTION_STARTS. Radar bug 215 #8274584. 216 - Updated setup_code_signature() and setup_code_signature() in 217 codesign_allocate.c . 218 - Updated ctf_insert() in ctf_insert.c to treat objects with function starts 219 info as an error and not allowed for static binaries. 220 - Updated translate_dylib() in indr.c . 221 - Updated setup_object_symbolic_info() in inout.c . 222 - Updated setup_object_symbolic_info() and update_load_commands() in 223 install_name_tool.c . 224 - Updated build_new_symbol_table() in and update_load_commands() in 225 redo_prebinding.c . 226 - Updated strip_object(), strip_LC_UUID_commands() and 227 strip_LC_CODE_SIGNATURE_commands() in strip.c 228 229Changes for the 5.28 release (the cctools-787 release): 230- Changed libtool(1) and added testing the environment variable ZERO_AR_DATE to 231 set the ar date to zero to allow testing and comparing things for exact binary 232 equality. Radar bug #7919021. 233- Changed lipo(1) to attempt to stop a crash if the file can't be paged in after 234 it has been successfully mapped. Added a second fstat(2) call in 235 process_input_file(1) just before the first bytes of the mapped file are 236 referenced, and then checked that it has the same size and mod time of the 237 first stat. Radar bug #8087586. 238- Added support in nm(1) for symbols marked with N_SYMBOL_RESOLVER so that they 239 are printed with [symbol resolver]. This change is in print_mach_symbols() 240 in nm.c . Radar bug #7901954. 241 242Changes for the 5.28 release (the cctools-784 release): 243- Fixed the -arch_only flag in libtool(1) for arm so that each subtype is 244 treated as separate architecture. Radar bug #7864127. 245 246Changes for the 5.28 release (the cctools-782 release): 247- Added the -U option to nm(1) to not print undefined symbols. Radar bug 248 #7761111. 249- Changed nm(1)'s -m printing to support 'weak symbol automatically hidden' in 250 print_mach_symbols() in nm.c. Radar bug #5021217. 251 252Changes for the 5.28 release (the cctools-781 release): 253- Changed codesign_allocate(1) to allow it to be used on any Mach-O file. 254 Radar bug #7689781. 255- Added the program ctf_insert(1) to add a (__CTF,__ctf) section to a statically 256 linked Mach-O file. Radar bug #7016839. 257- Added support for LC_LOAD_UPWARD_DYLIB in update_load_commands() in 258 install_name_tool.c, in nm() in nm.c and in replace_sections() in segedit.c . 259 Radar bug #7659206. 260 261Changes for the 5.28 release (the cctools-780 release): 262- Changed trunc() to trnc() in libtool.c and removed -fno-builtin-trunc from the 263 Makefile. 264- Improved the error checking in the redo_prebinding code so that 265 contents_pointer_for_vmaddr() checks to make sure the pointer is not in the 266 object's headers or link edit information. Radar bug #6081358. 267 268Changes for the 5.28 release (the cctools-779 release): 269- Fixed bugs in install_name_tool.c in parsing -change and -rpath. Radar bug 270 #7477104. 271 272Changes for the 5.28 release (the cctools-777 release): 273- Changed round() to rnd() and stuff/round.h to stuff/rnd.h in all files and 274 removed -fno-builtin-round from the Makefile. Radar bug #7475139. 275- Changed the Makefile to use -Os for OFLAG. Radar bug #7475093. 276- Change contents_pointer_for_vmaddr() in redo_prebinding.c to ignore segments 277 with a zero vmaddr since these are unmapped segments. Radar bug #7467115. 278 279Changes for the 5.28 release (the cctools-776 release): 280- Improved the error checking in the redo_prebinding code so that 281 contents_pointer_for_vmaddr() checks to make sure the pointer is in the 282 section's contents of the segment. Checks also added to libstuff's 283 check_Mach_O() in ofile.c to make sure that sections are contained in 284 their segments. Radar bug #6081358. 285 286Changes for the 5.27 release (the cctools-773 release): 287- Fixed a typo in two lipo(1) error messages where "it's" should have been 288 "its". Radar bug 7362293. 289 290Changes for the 5.27 release (the cctools-772 release): 291- Fixed a bug in lipo(1) with the -extract option in main() in the loop that 292 was removing those thin files not marked for extraction where the inner loop 293 was looping once to many times. Radar bug #7255585. 294 295Changes for the 5.27 release (the cctools-768 release): 296- Fixed a bug in checksyms() that was not verifying read-only-relocs in 64-bit 297 binaries. The routine check_dynamic_binary() had a typo where LC_SEGMENT 298 should have been LC_SEGMENT_64. Also changed checksyms() to not call 299 check_dynamic_binary() if the filetype is MH_KEXT_BUNDLE. Radar bug #7236271. 300 301Changes for the 5.27 release (the cctools-762 release): 302- Changed the Makefile to set CC when when SDKROOT is set. Radar bug #7078805. 303 304Changes for the 5.27 release (the cctools-760 release): 305- Changed the lipo(1) so the the armv7 stuff is a no longer 306