Revision: 155 http://trac.macosforge.org/projects/odcctools/changeset/155 Author: peter@pogma.com Date: 2009-06-27 22:02:46 -0700 (Sat, 27 Jun 2009) Log Message: ----------- patches/force_load.diff: Add -force_load flag to ld64. patches/include/stuff/bytesex-floatstate.diff: Warn less on darwin. ld64-85.2.2.tar.gz: Update this. extract.sh: New ld64, chmod the non-writable files. Modified Paths: -------------- trunk/ChangeLog.odcctools trunk/extract.sh trunk/patches/include/stuff/bytesex-floatstate.diff Added Paths: ----------- trunk/ld64-85.2.2.tar.gz trunk/patches/force_load.diff Removed Paths: ------------- trunk/ld64-85.2.1.tar.gz Modified: trunk/ChangeLog.odcctools =================================================================== --- trunk/ChangeLog.odcctools 2009-06-17 04:06:44 UTC (rev 154) +++ trunk/ChangeLog.odcctools 2009-06-28 05:02:46 UTC (rev 155) @@ -1,3 +1,10 @@ +2009-06-27 Peter O'Gorman <peter@pogma.com> + + * patches/force_load.diff: Add -force_load flag to ld64. + * patches/include/stuff/bytesex-floatstate.diff: Warn less on darwin. + * ld64-85.2.2.tar.gz: Update this. + * extract.sh: New ld64, chmod the non-writable files. + 2009-06-16 Peter O'Gorman <peter@pogma.com> * files/otool/Makefile.in: Fix make warning. Modified: trunk/extract.sh =================================================================== --- trunk/extract.sh 2009-06-17 04:06:44 UTC (rev 154) +++ trunk/extract.sh 2009-06-28 05:02:46 UTC (rev 155) @@ -7,7 +7,7 @@ CCTOOLSDISTFILE=${CCTOOLSNAME}-${CCTOOLSVERS}.tar.gz LD64NAME=ld64 -LD64VERS=85.2.1 +LD64VERS=85.2.2 LD64DISTFILE=${LD64NAME}-${LD64VERS}.tar.gz DISTDIR=odcctools @@ -72,7 +72,7 @@ misc/libtool-ldpath.diff misc/libtool-pb.diff misc/ranlibname.diff \ misc/redo_prebinding.nogetattrlist.diff \ misc/redo_prebinding.nomalloc.diff misc/libtool_lipo_transform.diff \ -otool/nolibmstub.diff otool/noobjc.diff" +otool/nolibmstub.diff otool/noobjc.diff force_load.diff" ADDEDFILESDIR=${TOPSRCDIR}/files @@ -85,6 +85,7 @@ tar ${TARSTRIP}=1 -zxf ${CCTOOLSDISTFILE} -C ${DISTDIR} mkdir -p ${DISTDIR}/ld64 tar ${TARSTRIP}=1 -zxf ${LD64DISTFILE} -C ${DISTDIR}/ld64 +find ${DISTDIR}/ld64 ! -perm +200 -exec chmod u+w {} \; find ${DISTDIR}/ld64/doc/ -type f -exec cp "{}" ${DISTDIR}/man \; # Clean the source a bit Deleted: trunk/ld64-85.2.1.tar.gz =================================================================== (Binary files differ) Added: trunk/ld64-85.2.2.tar.gz =================================================================== (Binary files differ) Property changes on: trunk/ld64-85.2.2.tar.gz ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/patches/force_load.diff =================================================================== --- trunk/patches/force_load.diff (rev 0) +++ trunk/patches/force_load.diff 2009-06-28 05:02:46 UTC (rev 155) @@ -0,0 +1,184 @@ +--- ./misc/libtool.c.orig 2009-06-14 11:26:04.000000000 -0500 ++++ ./misc/libtool.c 2009-06-14 11:39:10.000000000 -0500 +@@ -699,6 +699,7 @@ + strcmp(argv[i], "-Y") == 0 || + strcmp(argv[i], "-dylib_file") == 0 || + strcmp(argv[i], "-final_output") == 0 || ++ strcmp(argv[i], "-force_load") == 0 || + strcmp(argv[i], "-headerpad") == 0 || + strcmp(argv[i], "-weak_reference_mismatches") == 0 || + strcmp(argv[i], "-u") == 0 || +--- ./man/libtool.1.orig 2009-06-14 11:39:35.000000000 -0500 ++++ ./man/libtool.1 2009-06-14 11:39:43.000000000 -0500 +@@ -288,6 +288,7 @@ + .B \-dylib_file, + .B \-run_init_lazily, + .B \-final_output, ++.B \-force_load, + .B \-macosx_version_min, + .B \-multiply_defined, + .B \-multiply_defined_unused, +--- ld64/src/ArchiveReader.hpp.orig 2009-06-14 11:37:02.000000000 -0500 ++++ ld64/src/ArchiveReader.hpp 2009-06-14 11:38:17.000000000 -0500 +@@ -54,7 +54,8 @@ + public: + static bool validFile(const uint8_t* fileContent, uint64_t fileLength); + Reader(const uint8_t fileContent[], uint64_t fileLength, +- const char* path, time_t modTime, ++ const char* path, time_t modTime, ++ const DynamicLibraryOptions& ArchiveOptions, + const ObjectFile::ReaderOptions& options, uint32_t ordinalBase); + virtual ~Reader() {} + +@@ -121,6 +122,7 @@ + std::set<const class Entry*> fInstantiatedEntries; + std::set<const class Entry*> fPossibleEntries; + NameToEntryMap fHashTable; ++ bool fForceLoad; + + static std::vector<class ObjectFile::Atom*> fgEmptyList; + }; +@@ -257,10 +259,11 @@ + } + + template <typename A> +-Reader<A>::Reader(const uint8_t fileContent[], uint64_t fileLength, const char* path, time_t modTime, ++Reader<A>::Reader(const uint8_t fileContent[], uint64_t fileLength, const char* path, time_t modTime, ++ const DynamicLibraryOptions& archiveOptions, + const ObjectFile::ReaderOptions& options, uint32_t ordinalBase) + : fPath(NULL), fModTime(modTime), fOptions(options), fOrdinalBase(ordinalBase), fFileContent(NULL), +- fTableOfContents(NULL), fTableOfContentCount(0), fStringPool(NULL) ++ fTableOfContents(NULL), fTableOfContentCount(0), fStringPool(NULL), fForceLoad(archiveOptions.fForceLoad) + { + fPath = strdup(path); + fFileContent = fileContent; +@@ -273,7 +276,7 @@ + if ( options.fLogAllFiles ) + printf("%s\n", path); + +- if ( !options.fFullyLoadArchives ) { ++ if ( !options.fFullyLoadArchives && !fForceLoad) { + const Entry* const firstMember = (Entry*)&fFileContent[8]; + if ( (strcmp(firstMember->getName(), SYMDEF_SORTED) == 0) || (strcmp(firstMember->getName(), SYMDEF) == 0) ) { + const uint8_t* contents = firstMember->getContent(); +@@ -324,7 +327,7 @@ + template <typename A> + std::vector<class ObjectFile::Atom*>& Reader<A>::getAtoms() + { +- if ( fOptions.fFullyLoadArchives ) { ++ if ( fOptions.fFullyLoadArchives || fForceLoad) { + // build vector of all atoms from all .o files in this archive + const Entry* const start = (Entry*)&fFileContent[8]; + const Entry* const end = (Entry*)&fFileContent[fFileLength]; +@@ -332,8 +335,12 @@ + const char* memberName = p->getName(); + if ( (p==start) && ((strcmp(memberName, SYMDEF_SORTED) == 0) || (strcmp(memberName, SYMDEF) == 0)) ) + continue; +- if ( fOptions.fWhyLoad ) +- printf("-all_load forced load of %s(%s)\n", this->getPath(), memberName); ++ if ( fOptions.fWhyLoad ) { ++ if (! fForceLoad) ++ printf("-all_load forced load of %s(%s)\n", this->getPath(), memberName); ++ else ++ printf("-force_load forced load of %s(%s)\n", this->getPath(), memberName); ++ } + ObjectFile::Reader* r = this->makeObjectReaderForMember(p); + std::vector<class ObjectFile::Atom*>& atoms = r->getAtoms(); + fAllAtoms.insert(fAllAtoms.end(), atoms.begin(), atoms.end()); +@@ -420,7 +427,7 @@ + template <typename A> + std::vector<class ObjectFile::Atom*>* Reader<A>::getJustInTimeAtomsFor(const char* name) + { +- if ( fOptions.fFullyLoadArchives ) { ++ if ( fOptions.fFullyLoadArchives || fForceLoad ) { + return NULL; + } + else { +--- ld64/src/Options.cpp.orig 2009-06-14 11:37:02.000000000 -0500 ++++ ld64/src/Options.cpp 2009-06-14 11:38:17.000000000 -0500 +@@ -1548,6 +1548,9 @@ + // if dylib is specified again but weak, record that it should be weak + if ( info.options.fWeakImport ) + fit->options.fWeakImport = true; ++ // Similarly for -force_load ++ if ( info.options.fForceLoad ) ++ fit->options.fForceLoad = true; + return; + } + } +@@ -1676,6 +1679,12 @@ + else if ( strcmp(arg, "-ObjC") == 0 ) { + fReaderOptions.fLoadAllObjcObjectsFromArchives = true; + } ++ // Similar to -all_load, but for the following archive only. ++ else if ( strcmp(arg, "-force_load") == 0 ) { ++ FileInfo info = findFile(argv[++i]); ++ info.options.fForceLoad = true; ++ addLibrary(info); ++ } + // Library versioning. + else if ( (strcmp(arg, "-dylib_compatibility_version") == 0) + || (strcmp(arg, "-compatibility_version") == 0)) { +--- ld64/src/ld.cpp.orig 2009-06-14 11:37:02.000000000 -0500 ++++ ld64/src/ld.cpp 2009-06-14 11:38:17.000000000 -0500 +@@ -2917,7 +2917,7 @@ + else if ( mach_o::dylib::Reader<ppc>::validFile(p, info.options.fBundleLoader) ) + return this->addDylib(new mach_o::dylib::Reader<ppc>::Reader(p, len, info.path, info.options, fOptions.readerOptions(), fNextInputOrdinal), info, len); + else if ( archive::Reader<ppc>::validFile(p, len) ) +- return this->addArchive(new archive::Reader<ppc>::Reader(p, len, info.path, info.modTime, fOptions.readerOptions(), fNextInputOrdinal), info, len); ++ return this->addArchive(new archive::Reader<ppc>::Reader(p, len, info.path, info.modTime, info.options, fOptions.readerOptions(), fNextInputOrdinal), info, len); + break; + case CPU_TYPE_POWERPC64: + if ( mach_o::relocatable::Reader<ppc64>::validFile(p) ) +@@ -2925,7 +2925,7 @@ + else if ( mach_o::dylib::Reader<ppc64>::validFile(p, info.options.fBundleLoader) ) + return this->addDylib(new mach_o::dylib::Reader<ppc64>::Reader(p, len, info.path, info.options, fOptions.readerOptions(), fNextInputOrdinal), info, len); + else if ( archive::Reader<ppc64>::validFile(p, len) ) +- return this->addArchive(new archive::Reader<ppc64>::Reader(p, len, info.path, info.modTime, fOptions.readerOptions(), fNextInputOrdinal), info, len); ++ return this->addArchive(new archive::Reader<ppc64>::Reader(p, len, info.path, info.modTime, info.options, fOptions.readerOptions(), fNextInputOrdinal), info, len); + break; + case CPU_TYPE_I386: + if ( mach_o::relocatable::Reader<x86>::validFile(p) ) +@@ -2933,7 +2933,7 @@ + else if ( mach_o::dylib::Reader<x86>::validFile(p, info.options.fBundleLoader) ) + return this->addDylib(new mach_o::dylib::Reader<x86>::Reader(p, len, info.path, info.options, fOptions.readerOptions(), fNextInputOrdinal), info, len); + else if ( archive::Reader<x86>::validFile(p, len) ) +- return this->addArchive(new archive::Reader<x86>::Reader(p, len, info.path, info.modTime, fOptions.readerOptions(), fNextInputOrdinal), info, len); ++ return this->addArchive(new archive::Reader<x86>::Reader(p, len, info.path, info.modTime, info.options, fOptions.readerOptions(), fNextInputOrdinal), info, len); + break; + case CPU_TYPE_X86_64: + if ( mach_o::relocatable::Reader<x86_64>::validFile(p) ) +@@ -2941,14 +2941,14 @@ + else if ( mach_o::dylib::Reader<x86_64>::validFile(p, info.options.fBundleLoader) ) + return this->addDylib(new mach_o::dylib::Reader<x86_64>::Reader(p, len, info.path, info.options, fOptions.readerOptions(), fNextInputOrdinal), info, len); + else if ( archive::Reader<x86_64>::validFile(p, len) ) +- return this->addArchive(new archive::Reader<x86_64>::Reader(p, len, info.path, info.modTime, fOptions.readerOptions(), fNextInputOrdinal), info, len); ++ return this->addArchive(new archive::Reader<x86_64>::Reader(p, len, info.path, info.modTime, info.options, fOptions.readerOptions(), fNextInputOrdinal), info, len); + case CPU_TYPE_ARM: + if ( mach_o::relocatable::Reader<arm>::validFile(p) ) + return this->addObject(new mach_o::relocatable::Reader<arm>::Reader(p, info.path, info.modTime, fOptions.readerOptions(), fNextInputOrdinal), info, len); + else if ( mach_o::dylib::Reader<arm>::validFile(p, info.options.fBundleLoader) ) + return this->addDylib(new mach_o::dylib::Reader<arm>::Reader(p, len, info.path, info.options, fOptions.readerOptions(), fNextInputOrdinal), info, len); + else if ( archive::Reader<arm>::validFile(p, len) ) +- return this->addArchive(new archive::Reader<arm>::Reader(p, len, info.path, info.modTime, fOptions.readerOptions(), fNextInputOrdinal), info, len); ++ return this->addArchive(new archive::Reader<arm>::Reader(p, len, info.path, info.modTime, info.options, fOptions.readerOptions(), fNextInputOrdinal), info, len); + break; + break; + } +--- ld64/src/Options.h.orig 2009-06-14 11:37:02.000000000 -0500 ++++ ld64/src/Options.h 2009-06-14 11:38:17.000000000 -0500 +@@ -43,12 +43,13 @@ + class DynamicLibraryOptions + { + public: +- DynamicLibraryOptions() : fWeakImport(false), fReExport(false), fBundleLoader(false), fLazyLoad(false) {} ++ DynamicLibraryOptions() : fWeakImport(false), fReExport(false), fBundleLoader(false), fLazyLoad(false), fForceLoad(false) {} + + bool fWeakImport; + bool fReExport; + bool fBundleLoader; + bool fLazyLoad; ++ bool fForceLoad; + }; + + // Modified: trunk/patches/include/stuff/bytesex-floatstate.diff =================================================================== --- trunk/patches/include/stuff/bytesex-floatstate.diff 2009-06-17 04:06:44 UTC (rev 154) +++ trunk/patches/include/stuff/bytesex-floatstate.diff 2009-06-28 05:02:46 UTC (rev 155) @@ -1,11 +1,15 @@ --- bytesex.h.orig 2006-09-17 13:54:31.000000000 -0700 +++ bytesex.h 2006-09-17 13:55:07.000000000 -0700 -@@ -227,7 +227,7 @@ +@@ -227,7 +227,11 @@ /* current i386 thread states */ #if i386_THREAD_STATE == 1 extern void swap_i386_float_state( - struct __darwin_i386_float_state *fpu, ++#ifdef _STRUCT_X86_FLOAT_STATE32 ++ _STRUCT_X86_FLOAT_STATE32 *fpu, ++#else + struct i386_float_state *fpu, ++#endif enum byte_sex target_byte_sex); extern void swap_i386_exception_state(