Index: include/stuff/bytesex.h =================================================================== --- include/stuff/bytesex.h (revision 280) +++ include/stuff/bytesex.h (working copy) @@ -69,12 +69,10 @@ (((a) >> 8) & 0x0000ff00) | \ ((unsigned int)(a) >> 24) ) -#ifndef __LP64__ #define SWAP_LONG(a) ( ((a) << 24) | \ (((a) << 8) & 0x00ff0000) | \ (((a) >> 8) & 0x0000ff00) | \ ((unsigned long)(a) >> 24) ) -#endif extern long long SWAP_LONG_LONG( long long ll); Index: include/i386/_types.h =================================================================== --- include/i386/_types.h (revision 280) +++ include/i386/_types.h (working copy) @@ -37,8 +37,6 @@ typedef unsigned short __uint16_t; typedef int __int32_t; typedef unsigned int __uint32_t; -typedef long long __int64_t; -typedef unsigned long long __uint64_t; typedef long __darwin_intptr_t; typedef unsigned int __darwin_natural_t; Index: include/mach-o/nlist.h =================================================================== --- include/mach-o/nlist.h (revision 280) +++ include/mach-o/nlist.h (working copy) @@ -75,9 +75,7 @@ */ struct nlist { union { -#ifndef __LP64__ char *n_name; /* for use when in-core */ -#endif int32_t n_strx; /* index into the string table */ } n_un; uint8_t n_type; /* type flag, see below */ Index: include/mach-o/ranlib.h =================================================================== --- include/mach-o/ranlib.h (revision 280) +++ include/mach-o/ranlib.h (working copy) @@ -60,9 +60,7 @@ struct ranlib { union { uint32_t ran_strx; /* string table index of */ -#ifndef __LP64__ char *ran_name; /* symbol defined by */ -#endif } ran_un; uint32_t ran_off; /* library member at this offset */ }; Index: ld64/Makefile.in =================================================================== --- ld64/Makefile.in (revision 280) +++ ld64/Makefile.in (working copy) @@ -37,7 +37,7 @@ MYWARNINGS = MYDEFS = -DDEBUG MYLDFLAGS = -L$(top_builddir)/libstuff -MYLIBS = -lstuff +MYLIBS = -lstuff -luuid MYCOMPILEFLAGS = $(WARNINGS) $(MYWARNINGS) $(DEFS) $(MYDEFS) \ $(CPPFLAGS) $(MYINCLUDES) $(CFLAGS) $(MDYNAMICNOPIC) Index: ld64/src/ld.cpp =================================================================== --- ld64/src/ld.cpp (revision 280) +++ ld64/src/ld.cpp (working copy) @@ -639,12 +639,12 @@ void Linker::getVMInfo(vm_statistics_data_t& info) { - mach_msg_type_number_t count = sizeof(vm_statistics_data_t) / sizeof(natural_t); - kern_return_t error = host_statistics(mach_host_self(), HOST_VM_INFO, - (host_info_t)&info, &count); - if (error != KERN_SUCCESS) { +// mach_msg_type_number_t count = sizeof(vm_statistics_data_t) / sizeof(natural_t); +// kern_return_t error = host_statistics(mach_host_self(), HOST_VM_INFO, +// (host_info_t)&info, &count); +// if (error != KERN_SUCCESS) { bzero(&info, sizeof(vm_statistics_data_t)); - } +// } } void Linker::printStatistics() Index: ld64/src/MachOWriterExecutable.hpp =================================================================== --- ld64/src/MachOWriterExecutable.hpp (revision 280) +++ ld64/src/MachOWriterExecutable.hpp (working copy) @@ -5029,6 +5029,29 @@ } template <> +StubHelperAtom::StubHelperAtom(Writer& writer, ObjectFile::Atom& target, ObjectFile::Atom& lazyPointer) + : WriterAtom(writer, Segment::fgTextSegment), fName(stubName(target.getName())), fTarget(target) +{ + writer.fAllSynthesizedStubHelpers.push_back(this); + + fReferences.push_back(new WriterReference(3, x86_64::kPCRel32, &lazyPointer)); + fReferences.push_back(new WriterReference(8, x86_64::kPCRel32, writer.fDyldHelper)); + if ( writer.fDyldHelper == NULL ) + throw "symbol dyld_stub_binding_helper not defined (usually in crt1.o/dylib1.o/bundle1.o)"; +} + +// specialize lazy pointer for x86_64 to initially pointer to stub helper +template <> +LazyPointerAtom::LazyPointerAtom(Writer& writer, ObjectFile::Atom& target) + : WriterAtom(writer, Segment::fgDataSegment), fName(lazyPointerName(target.getName())), fTarget(target) +{ + writer.fAllSynthesizedLazyPointers.push_back(this); + + StubHelperAtom* helper = new StubHelperAtom(writer, target, *this); + fReferences.push_back(new WriterReference(0, x86_64::kPointer, helper)); +} + +template <> StubAtom::StubAtom(Writer& writer, ObjectFile::Atom& target) : WriterAtom(writer, Segment::fgTextSegment), fName(stubName(target.getName())), fTarget(target) { @@ -5167,18 +5190,7 @@ -template <> -StubHelperAtom::StubHelperAtom(Writer& writer, ObjectFile::Atom& target, ObjectFile::Atom& lazyPointer) - : WriterAtom(writer, Segment::fgTextSegment), fName(stubName(target.getName())), fTarget(target) -{ - writer.fAllSynthesizedStubHelpers.push_back(this); - fReferences.push_back(new WriterReference(3, x86_64::kPCRel32, &lazyPointer)); - fReferences.push_back(new WriterReference(8, x86_64::kPCRel32, writer.fDyldHelper)); - if ( writer.fDyldHelper == NULL ) - throw "symbol dyld_stub_binding_helper not defined (usually in crt1.o/dylib1.o/bundle1.o)"; -} - template <> uint64_t StubHelperAtom::getSize() const { @@ -5211,18 +5223,7 @@ } -// specialize lazy pointer for x86_64 to initially pointer to stub helper -template <> -LazyPointerAtom::LazyPointerAtom(Writer& writer, ObjectFile::Atom& target) - : WriterAtom(writer, Segment::fgDataSegment), fName(lazyPointerName(target.getName())), fTarget(target) -{ - writer.fAllSynthesizedLazyPointers.push_back(this); - StubHelperAtom* helper = new StubHelperAtom(writer, target, *this); - fReferences.push_back(new WriterReference(0, x86_64::kPointer, helper)); -} - - template LazyPointerAtom::LazyPointerAtom(Writer& writer, ObjectFile::Atom& target) : WriterAtom(writer, Segment::fgDataSegment), fName(lazyPointerName(target.getName())), fTarget(target)