]> git.saurik.com Git - apple/ld64.git/commitdiff
ld64-59.3.tar.gz mac-os-x-10410x86 mac-os-x-10411x86 mac-os-x-1048x86 mac-os-x-1049x86 v59.3
authorApple <opensource@apple.com>
Tue, 31 Oct 2006 18:58:18 +0000 (18:58 +0000)
committerApple <opensource@apple.com>
Tue, 31 Oct 2006 18:58:18 +0000 (18:58 +0000)
ChangeLog
src/MachOReaderDylib.hpp
src/MachOReaderRelocatable.hpp
src/MachOWriterExecutable.hpp
src/Options.cpp

index 26a83cedf341d9b8aca72e72106f25c77912ba7d..7436b2b688ce6a840cbd9df757ae392c09502b4d 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,4 +1,24 @@
 
 
+----- Tagged ld64-59.4
+
+2006-07-11      Nick Kledzik    <kledzik@apple.com>
+
+       remove conditionals around x86_64 support
+
+----- Tagged ld64-59.3
+
+2006-07-02      Nick Kledzik    <kledzik@apple.com>
+
+       <rdar://problem/4664607> x86_64: instructions with immediate and rip-relative operands need to use new relocation types
+       back port fix for 4656617 to Inca branch
+
+----- Tagged ld64-59.2
+
+2006-06-28      Nick Kledzik    <kledzik@apple.com>
+
+       <rdar://problem/4603454> MySQL-36 fails to build with ld64-59
+       back port fix to Inca branch
+
 ----- Tagged ld64-59
 
 2006-06-22      Nick Kledzik    <kledzik@apple.com>
 ----- Tagged ld64-59
 
 2006-06-22      Nick Kledzik    <kledzik@apple.com>
        * src/Options.cpp: setup ReaderOptions.fForFinalLinkedImage
        * src/MachOReaderRelocatable.hpp: mark .eh symbols kSymbolTableNotIn when building final linked image
 
        * src/Options.cpp: setup ReaderOptions.fForFinalLinkedImage
        * src/MachOReaderRelocatable.hpp: mark .eh symbols kSymbolTableNotIn when building final linked image
 
+2006-03-21     Nick Kledzik    <kledzik@apple.com>
+
+       <rdar://problem/4475928> Inca ld64-45 fatal error with C++ and asm() renaming
+       * src/MachOReaderRelocatable.hpp: fix Reader<x86_64>::makeReferenceToEH(() to walk relocations to find
+       target of eh symbol, rather assume target name is eh symbol name less .eh
+
 2006-03-21     Nick Kledzik    <kledzik@apple.com>
 
        <rdar://problem/4473742> ld64 does not parse optional second argument to -filelist
        * unit-tests/test-cases/filelist: added
        * src/Options.cpp: in Options::loadFileList() handle comma option
 
 2006-03-21     Nick Kledzik    <kledzik@apple.com>
 
        <rdar://problem/4473742> ld64 does not parse optional second argument to -filelist
        * unit-tests/test-cases/filelist: added
        * src/Options.cpp: in Options::loadFileList() handle comma option
 
+2006-03-21     Nick Kledzik    <kledzik@apple.com>
+
+       <rdar://problem/4483625> 32-bit pointer difference out of range for cxx eh frame
+       * src/MachOReaderRelocatable.hpp: x86_64 doesn't have anonymous non-lazy-pointers
+       * src/machochecker.cpp: fix validFile() for x86_64
+       * unit-tests/run-all-unit-tests: add x86_64
+       * unit-tests/include/common.makefile: don't add -g to all compilers
+       * unit-tests/test-cases/relocs-asm/relocs-asm.s: add x86_64 test cases
+       * unit-tests/test-cases/relocs-c/Makefile: fix to work with x86_64
+       * src/ld.cpp: add hack to use i386 dylibs if x86_64 don't exist
+
+2006-03-19     Nick Kledzik    <kledzik@apple.com>
+
+       <rdar://problem/4483330> ld64 crashes whenever I try to link with dylib1.o
+       * src/MachOReaderRelocatable.hpp: in Reader<x86_64>::addRelocReference() fix local relocations
+
+----- Tagged ld64-47.1
+
+2006-03-16     Nick Kledzik    <kledzik@apple.com>
+
+       <rdar://problem/4459633> ld64-41 in Leopard doesn't have x86_64 support
+       * ld64.xcodeproj/project.pbxproj: enable x86_64 for Leopard
 
 ----- Tagged ld64-47
 
 
 ----- Tagged ld64-47
 
+2006-03-14     Nick Kledzik    <kledzik@apple.com>
+
+       * src/Architectures.hpp: redo x86_64 relocation types
+       * src/MachOReaderRelocatable.hpp: redo x86_64 relocation types, make some section type illegal for x86_64
+       * src/MachOWriterExecutable.hpp: redo x86_64 relocation types
+
+2006-03-13     Nick Kledzik    <kledzik@apple.com>
+
+       <rdar://problem/4467122> ld64 -r does not handle internal relocations for x86_64
+       * src/MachOWriterExecutable.hpp: handle internal relocations in Writer<x86_64>::fixUpReferenceRelocatable()
+         and Writer<x86_64>::addObjectRelocs().
 
 ----- Tagged ld64-46
 
 
 ----- Tagged ld64-46
 
        * src/Architectures.hpp: add x86_64::kPCRel32_*
        * src/MachOReaderRelocatable.hpp: generate x86_64::kPCRel32_*
        * src/MachOWriterExecutable.hpp: process x86_64::kPCRel32_*
        * src/Architectures.hpp: add x86_64::kPCRel32_*
        * src/MachOReaderRelocatable.hpp: generate x86_64::kPCRel32_*
        * src/MachOWriterExecutable.hpp: process x86_64::kPCRel32_*
+
+2006-03-02     Nick Kledzik    <kledzik@apple.com>
+
+       * src/MachOReaderRelocatable.hpp: <rdar://problem/4464370> tighten detection of anonymous non-lazy-pointer
+
+----- Tagged ld64-42
+
+2006-02-28     Nick Kledzik    <kledzik@apple.com>
+
+       * src/MachOReaderRelocatable.hpp: fix x86 __IMPORT permissions for class Segment
+
+2006-02-28     Nick Kledzik    <kledzik@apple.com>
+
+       <rdar://problem/4461240> SWB: ld64-37 (can't resolve symbol ___dso_handle)
+       * src/MachOWriterExecutable.hpp: add class DsoHandleAtom
+
+2006-02-28     Nick Kledzik    <kledzik@apple.com>
+
+       * unit-tests/test-cases/literals-coalesce-alignment: added test case
+       * src/ld.cpp: when coalescing strings pick one with greater alignment
+       <rdar://problem/4458660> ld64: CG link failed because lo14 reference to anonymous non-lazy-pointer not aligned
+       * unit-tests/test-cases/relocs-c/test.c: tweak to fail like 4458660
+       * src/MachOReaderRelocatable.hpp: detect anonymous non-lazy-pointer and transform into real non-lazy-pointers
+
+----- Tagged ld64-41
+
+2006-02-24     Nick Kledzik    <kledzik@apple.com>
+
+       * src/Options.cpp: Warning about -no_dead_strip_inits_and_terms and -i options.
+                                          Fix -weak-l option.
+
+----- Tagged ld64-40
+
+2006-02-24     Nick Kledzik    <kledzik@apple.com>
+
+       <rdar://problem/4454698> Leopard9A113: ppc64 libstdc++.dylib initializer crashes in pthread_once
+       * unit-tests/test-cases/multiple-entry-points: added
+       * src/MachOReaderRelocatable.hpp: make sure that if there are multiple symbols with the same
+       address, that we properly make zero length atoms for all but last symbol
+
+2006-02-24     Nick Kledzik    <kledzik@apple.com>
+
+       * src/Options.cpp: <rdar://problem/4456093> ld64 doesn't realpath(3) B&I tracing paths
+
+2006-02-24     Nick Kledzik    <kledzik@apple.com>
+
+       * src/Options.cpp: <rdar://problem/4457078> 9A110: ld64 can't deal with section names >16 chars
+
+2006-02-23     Nick Kledzik    <kledzik@apple.com>
+
+       * src/MachOWriterExecutable.hpp:  use vector.reserve() to minimize re-allocations
+       * src/Options.cpp: use vector.reserve() to minimize re-allocations
+       * src/MachOReaderRelocatable.hpp:  use vector.reserve() to minimize re-allocations
+       * src/MachOReaderDylib.hpp:  use vector.reserve() to minimize re-allocations
+       * src/ld.cpp:  use vector.reserve() to minimize re-allocations
+
+2006-02-23     Nick Kledzik    <kledzik@apple.com>
+
+       <rdar://problem/4455927> ld64 creates corrupt executables (and has malloc errors) with -headerpad option
+       * src/MachOWriterExecutable.hpp: Change LoadCommandsPaddingAtom<A>::setSize() to update fLargestAtomSize
+       * unit-tests/test-cases/header-pad: added
+
+2006-02-23     Nick Kledzik    <kledzik@apple.com>
+
+       <rdar://problem/4455192> ld64 creates invalid static executables
+       * src/MachOWriterExecutable.hpp: Change MachHeaderAtom<A>::copyRawContent() to create correct header
+       for static executables.  Change SymbolTableLoadCommandsAtom to skip LC_DYSYMTAB for static executables
+       * src/machochecker.cpp: Add tests that static executables are well formed
+       * unit-tests/test-cases/static-executable: added
+
+2006-02-22     Nick Kledzik    <kledzik@apple.com>
+
+       * src/Options.cpp: <rdar://problem/4453468> chnage printf on unknown arg to a throw
+
+----- Tagged ld64-39
+
+2006-02-20     Nick Kledzik    <kledzik@apple.com>
+
+       * unit-tests/test-cases/read-only-relocs: added new test case
+       * src/MachOWriterExecutable.hpp: <rdar://problem/4448922> detect and error on relocs in read-only sections
+       * src/MachOReaderRelocatable.hpp: fix parsing of i386 absolute addressing relocs
+
+2006-02-20     Nick Kledzik    <kledzik@apple.com>
+
+       * unit-tests/test-cases/stabs-coalesce: added new test case
+       * src/ld.cpp.hpp: <rdar://problem/4449226> in collectStabs removed unused stabs
+
+----- Tagged ld64-38
+
+2006-02-17     Nick Kledzik    <kledzik@apple.com>
+
+       * src/MachOWriterExecutable.hpp: <rdar://problem/4434578> set correct n_sect field of stabs
+
+2006-02-15     Nick Kledzik    <kledzik@apple.com>
+
+       * src/MachOReaderArchive.hpp: <rdar://problem/4441920> with -all_load skip over both kinds of SYMDEFs
+       * unit-tests/test-cases/archive-basic/Makefile: add -all_load test case
+
+----- Tagged ld64-37
+
+2006-02-13  Eric Christopher  <echristo@apple.com>
+
+       * src/MachOWriterExecutable.hpp (assignFileOffsets): Simplify. Add comments.
+       Adjust whitespace.
+
+2006-02-13     Nick Kledzik    <kledzik@apple.com>
+
+       * src/MachOWriterExecutable.hpp: in Writer<x86>::fixUpReferenceRelocatable() fix kPCRel32 for external case
+
+2006-02-13     Nick Kledzik    <kledzik@apple.com>
+
+       * unit-tests/test-cases/zero-fill: added
+       * src/machochecker.cpp: check that S_ZEROFILL have no file offset
+       * src/MachOWriterExecutable.hpp: rework assignFileOffsets() to fix rdar://problem/4441145
+
+2006-02-12     Nick Kledzik    <kledzik@apple.com>
+
+       * src/MachOReaderRelocatable.hpp: <rdar://problem/4440880> fix use of first zero-length c-string in .o file
+
+2006-02-12     Nick Kledzik    <kledzik@apple.com>
+
+       * src/MachOReaderRelocatable.hpp: <rdar://problem/4440905> fix uninitialized fAlignment
+
+2006-02-12     Nick Kledzik    <kledzik@apple.com>
+
+       * unit-tests/test-cases/relocs-asm/relocs-asm.s: add pointer-diff cases
+       * src/Architectures.hpp: make size explicit in ppc/ppc64 kPointerDiff
+       * src/MachOReaderRelocatable.hpp: don't allow kPointerDiff64 for ppc (just ppc64)
+       * src/MachOWriterExecutable.cpp: set proper r_length for ld -r of kPointerDiff
+
+----- Tagged ld64-36
+
+2006-02-08     Nick Kledzik    <kledzik@apple.com>
+
+       * src/MachOReaderRelocatable.cpp: rdar://problem/4438677 Handle when a .o file dwarf line info entries but no functions
+
+2006-02-08     Nick Kledzik    <kledzik@apple.com>
+
+       * src/MachOWriterExecutable.cpp: Properly set address of first TEXT section
+       Keep S_COALESCED attribute for __eh_frame
+
+2006-02-08     Nick Kledzik    <kledzik@apple.com>
+
+       * src/ld.cpp: Temporarily turn allowable client errors into warnings
+       * unit-tests/test-cases/allowable-clientMakefile: Temporarily let warnings be ok for above
+       * src/MachOWriterExecutable.hpp: fix ld -r to not use external relocations for symbols make static
+
+2006-02-08     Nick Kledzik    <kledzik@apple.com>
+
+       * src/ld.cpp: A sibling in an umbrella can always link with its other siblings
+       * unit-tests/test-cases/allowable-client: add test case for above
+
+2006-02-08     Nick Kledzik    <kledzik@apple.com>
+
+       * src/MachOReaderRelocatable.hpp: support LOCAL non-lazy pointers to hidden symbols
+       * src/machochecker.cpp: verify indirect symbol table
+       * unit-tests/test-cases/private-non-lazy: added test case
+
+2006-02-07     Nick Kledzik    <kledzik@apple.com>
+
+       * src/MachOWriterExecutable.hpp: fix calculation of file offsets in ld -r mode
+       * src/machochecker.cpp: verify segment file offsets are within file
+
+----- Tagged ld64-35
+
+2006-02-06     Nick Kledzik    <kledzik@apple.com>
+
+       * ld.cpp: allow parent of sub-framework to link
+       * unit-tests/test-cases/allowable-client/Makefile: added cases for parent and clients of parent
+
+2006-02-04     Nick Kledzik    <kledzik@apple.com>
+
+       * unit-tests/test-cases/relocs-c/test.c:  added some array cases
+       * src/MachOReaderRelocatable.hpp: factor out makeReferenceToEH()
+       * src/MachOWriterExecutable.hpp: add initial support for non-lazy pointer synthesis
+
+----- Tagged ld64-34
+
+2006-02-04     Nick Kledzik    <kledzik@apple.com>
+
+       * src/ld.cpp: <rdar://problem/4432917> fix -no_arch_warnings
+                                 <rdar://problem/4432932> fix -undefined warning
+                               Do BINCL/EINCL optimization for gfull stabs
+                               Implement "essential symbols" for stabs (-Sp)
+                               Fix allowable clients to only test on direct libraries
+       * src/MachOReaderRelocatable.hpp: support BINCL/EINCL stabs
+
+2006-02-03     Nick Kledzik    <kledzik@apple.com>
+
+       * src/machochecker.cpp: add code to check load command alignment
+       * src/MachOWriterExecutable.hpp: make load command alignment depend on architecture
+
+2006-02-03     Nick Kledzik    <kledzik@apple.com>
+
+       * unit-tests/test-cases/literals-coalesce: added
+       * src/MachOReaderRelocatable.hpp: assure all targets of low14 ppc relocs are at least 4-byte alignmented
+
+----- Tagged ld64-33
+
+2006-02-02     Nick Kledzik    <kledzik@apple.com>
+
+       * src/MachOReaderRelocatable.hpp: properly coalesce 8-byte literals
+       * src/MachOWriterExecutable.hpp: support ppc64::kPointerDiff32
+
+----- Tagged ld64-32
+
+2006-02-02     Nick Kledzik    <kledzik@apple.com>
+
+       * src/MachOReaderRelocatable.hpp: support anonymous zero fill atoms
+
+2006-02-02     Nick Kledzik    <kledzik@apple.com>
+
+       * src/ld.cpp: A weak definition is good enough, do not search archives for a non-weak one
+       * unit-tests/test-cases/archive-weak: add test case for above
+       * src/MachOReaderRelocatable.hpp: an atom should never have a by-name reference to itself
+       * src/Options.cpp: prevent .eh symbols from being exported via a -exported_symbols_list
+
+2006-02-01     Nick Kledzik    <kledzik@apple.com>
+
+       * src/MachOReaderRelocatable.hpp: Support -macosx_version_min 10.5
+
+2006-02-01     Nick Kledzik    <kledzik@apple.com>
+
+       * src/MachOReaderRelocatable.hpp: don't try to parse debug_line dwarf if no symboled atoms
+
+----- Tagged ld64-31
+
+2006-02-01  Eric Christopher  <echristo@apple.com>
+
+       * unit-tests/test-cases/allow-stack-execute/Makefile: Move otool handling...
+       * unit-tests/include/common.makefile: ... here.
+       * unit-tests/bin/fail-if-stdin.pl: New.
+       * unit-tests/test-cases/no-uuid: Ditto.
+       * src/ld.cpp (Linker::) Add fCreateUUID.
+       (::Linker): Initialize.
+       (::collectStabs): Use. Set if dwarf or we have a UUID already.
+       (::writeOutput): Pass as argument to Writer::write along with option.
+       * src/Options.h (Option::emitUUID): Declare.
+       (Option::fEmitUUID): Ditto.
+       * src/Options.cpp (Option::emitUUID): New.
+       (parse): Handle -no_uuid.
+       * src/MachOReaderRelocatable (Reader::Reader): Handle LC_UUID.
+       * src/ExecutableFile.h (Writer::Write): Add createUUID boolean.
+       * src/MachOWriterExecutable: Add UUID forward declaration.
+       (fUUIDAtom): New.
+       (UUIDLoadCommandAtom): Emit LC_UUID if fEmit. New function emit. Size
+       to zero at start.
+       (Writer::writer): Add handle for LC_UUID. If createUUID emit LC_UUID.
+       (MachHeaderAtom::copyRawContent): Don't count a load command if its size is
+       0.
+       (UUIDLoadCommandAtom::copyRawContent): Depend on fEmit.
+
+
+2006-01-31     Nick Kledzik    <kledzik@apple.com>
+
+       * unit-tests/test-cases/dwarf-debug-notes : Added
+       * src/ld.cpp: don't generate debug note for .eh symbols
+       * src/MachOReaderRelocatable.hpp: make dwarf line info to atom matching faster and better
+
+2006-01-31     Nick Kledzik    <kledzik@apple.com>
+
+       * ld64.xcodeproj/project.pbxproj : Make buildable on Leopard
+       * src/MachOFileAbstraction.hpp: make buildable without latest cctools headers
+
+2006-01-31     Nick Kledzik    <kledzik@apple.com>
+
+       * src/MachOReaderRelocatable.hpp: better error message for bad relocs
+       * src/ObjectDump.cpp: add emacs tab settings
+       * src/SectCreate.h: ditto
+       * src/SectCreate.cpp: ditto
+       * src/machochecker.cpp: ditto
+       * src/ExecutableFile.h: ditto
+
+2006-01-30  Eric Christopher  <echristo@apple.com>
+
+       * src/ExecutableFile.h: Indent.
+
+2006-01-30     Nick Kledzik    <kledzik@apple.com>
+
+       * src/MachOReaderRelocatable.hpp: performance improvements
+       * src/ld.cpp: now that stubs are synthesized in write, don't need to special case anymore
+
+2006-01-30     Nick Kledzik    <kledzik@apple.com>
+
+       * src/MachOReaderRelocatable.hpp: fix parsing of pcc relocs
+       * unit-tests/test-cases/relocs-asm/relocs-asm.s: add test case for above
+
+2006-01-29     Nick Kledzik    <kledzik@apple.com>
+
+       * unit-tests/test-cases/weak_import: added test case
+       * src/ld.cpp: move code for weak_import mismatch to writer
+       * src/ObjectFile.h: remove ImportWeakness methods
+       * src/MachOReaderDylib.hpp: ditto
+       * src/SectCreate.cpp: ditto
+       * src/Architectures.hpp: add new ReferenceKinds for weak_imports
+       * src/MachOReaderRelocatable.hpp: implement new ReferenceKinds
+       * src/MachOWriterExecutable.hpp: handle new ReferenceKinds and weak_import mismatches
+
+2006-01-29     Nick Kledzik    <kledzik@apple.com>
+
+       * src/Options.cpp: verify -allow_stack_execute is only used on main executables
+
+2006-01-29     Nick Kledzik    <kledzik@apple.com>
+
+       * src/MachOReaderRelocatable.hpp: sync with latest dwarf reader from Geoff
+       * src/debugline.c: sync with latest dwarf reader from Geoff
+
+2006-01-27  Eric Christopher  <echristo@apple.com>
+
+       * src/ld.cpp (Linker::syntesizeStabs): Correct spelling. Update all uses.
+
+2006-01-27  Eric Christopher  <echristo@apple.com>
+
+       * src/Options.h (Options): Add hasExecutableStack, fExecutableStack.
+       * src/Options.cpp (Options::hasExecutableStack): New.
+       (Options::parse): Parse -allow_stack_execute.
+       * src/MachOWriterExecutable.hpp (MachHeaderAtom::copyRawContent):
+       Implement MH_ALLOW_STACK_EXECUTION.
+       * unit-tests/include/common.makefile (FAIL_IF_EMPTY): New.
+       * unit-tests/bin/fail-if-no-stdin.pl: New file.
+       * unit-tests/test-cases/allow-stack-execute: New directory.
+
+2006-01-27     Nick Kledzik    <kledzik@apple.com>
+
+       * src/MachOFileAbstraction.hpp: rely on latest system headers
+       * src/MachOWriterExecutable.hpp: fix ppc stubs.
+               wrote new relocationNeededInFinalLinkedImage() to replace common code
+
+2006-01-27  Eric Christopher  <echristo@apple.com>
+
+       * src/ld.cpp (logTraceInfo): New.
+       (Linker::addArchive): Use.
+       (Linker::addDylib): Ditto.
+       * src/ObjectFile (ReaderOptions::fTraceOutputFile): New.
+       * src/MachOReaderArchive.hpp (Reader::Reader): Move trace
+       logging to Linker::addArchive.
+       * src/Options.cpp (parsePreCommandLineEnvironment): Check
+       LD_PRINT_FILE if tracing dylibs or archives.
+
+2006-01-26     Nick Kledzik    <kledzik@apple.com>
+
+       * src/MachOWriterExecutable.hpp: handle NULL strings in SO debug notes
+
+2006-01-26     Nick Kledzik    <kledzik@apple.com>
+
+       * src/MachOWriterExecutable.hpp: fix header padding calculation and thread state
+
+2006-01-26     Nick Kledzik    <kledzik@apple.com>
+
+       Rewrite all stabs processing.
+       Move sythesize of debug notes into ld.cpp
+
+2006-01-26     Nick Kledzik    <kledzik@apple.com>
+
+       * src/MachOWriterExecutable.hpp: fix ppc and ppc64 stub relocs
+
+2006-01-25     Nick Kledzik    <kledzik@apple.com>
+
+       * ld64.xcodeproj/project.pbxproj: special case building in Curry
+
+2006-01-25     Nick Kledzik    <kledzik@apple.com>
+
+       * src/MachOWriterExecutable.hpp: fix bugs in stub/lazy-pointer synthesis
+
+2006-01-24  Eric Christopher  <echristo@apple.com>
+
+       * src/ld.cpp (Linker::createReaders): Change logging title to XBS.
+       (Linker::addDylib): Ditto.
+       * src/MachOReaderArchive.hpp (Reader::Reader): Ditto.
+       * src/Options.h (fPrintOptions): New.
+       * src/Options.cpp (Options::Options): Initialize above.
+       (Options::checkForFile): Change logging title to XBS.
+       (Options::findFramework): Ditto.
+       (Options::parse): Add log for options.
+       (Options::parsePreCommandLineEnvironmentSettings): Add LD_TRACE_ARCHIVES,
+       LD_TRACE_DYLIBS, and LD_PRINT_OPTIONS.
+
+2006-01-24     Nick Kledzik    <kledzik@apple.com>
+
+       * src/MachOReaderRelocatable.hpp: better C++ eh parsing
+
+2006-01-23  Eric Christopher  <echristo@apple.com>
+
+       * unit-tests/bin/fail-if-exit-zero.pl: New.
+       * unit-tests/include/common.makefile (FAIL_IF_SUCCESS): Use.
+       * unit-tests/allowable-client: New test.
+       * src/ld.cpp (Linker::addDylib): Check allowable clients before adding dylib.
+       * src/Options.h (allowableClients): New.
+       (clientName): Ditto.
+       (fAllowableClients): Ditto.
+       (fClientName): Ditto.
+       * src/Options.cpp: Implement above.
+       (parse): Handle -allowable_client and -client_name.
+       * src/MachOReaderDylib.hpp (getAllowableClients): New.
+       (fAllowableClients): Ditto.
+       (Reader): Process LC_SUB_CLIENT load command.
+       * src/ObjectFile.h (parentUmbrella): New.
+       (getAllowableClients): New.
+       * src/MachOWriterExecutable.hpp (AllowableClientLoadCommandsAtom): New.
+
+2006-01-23     Nick Kledzik    <kledzik@apple.com>
+
+       * unit-tests/test-cases/archive-basic: added
+       * src/ld.cpp: fix shadowed local variable
+       * src/FileAbstraction.hpp: <rdar://problem/4417372> ld64 shouldn't inline when building debug
+
+2006-01-23     Nick Kledzik    <kledzik@apple.com>
+
+       * src/ld.cpp: fix symbol not found error message
+       * src/MachOReaderDylib.hpp: add logging to hash table
+       * src/MachOReaderRelocatable.hpp: enable stabs processing. Handle static functions with stubs
+                                                                       handle labeled cstrings.
+       * src/MachOWriterExecutable.hpp: properly suppress atoms not in symbol table. fix low14 error check.
+                                                                       add StubAtomHelper.
+       * unit-tests/test-cases/relocs-literals/test.c: add more interesting edge cases
+
+2006-01-17     Nick Kledzik    <kledzik@apple.com>
+
+       * src/MachOReaderRelocatable.hpp: tweaks to synthesizing debug notes
+
+2006-01-16     Nick Kledzik    <kledzik@apple.com>
+
+       * src/debugline.{sh}: added
+       * src/MachOReaderRelocatable.hpp: synthesize debug notes SOL from dwarf
+       * src/MachOWriterExecutable.hpp: fix lazy pointer section
+       * src/ObjectDump.hpp: Fix conditionalization
+       * unit-tests/test-cases/dwarf-strip: added
+
+2006-01-11     Nick Kledzik    <kledzik@apple.com>
+
+       * src/MachOReaderRelocatable.hpp: support Tiger crt1.o build with old ld64
+       * src/ObjectDump.hpp: Support -arch option
+
+2006-01-10     Nick Kledzik    <kledzik@apple.com>
+
+       * src/MachOWriterExecutable.hpp: fix stubs for ppc64
+       * src/MachOFileAbstraction.hpp: fix typo for macho_routines
+       * ld64.xcodeproj/project.pbxproj: add machochecker target
+       * src/machochecker.cpp: new skeleton for checking mach-o file bit
+       * unit-tests/: Add support for running machochecker
+
+2006-01-10     Nick Kledzik    <kledzik@apple.com>
+
+       * src/MachOReaderRelocatable.hpp: warn if dwarf can't be parsed
+       * src/MachOReaderArchive.hpp: modTime for OSO stabs from archives is .a modTime
+
+2006-01-09     Nick Kledzik    <kledzik@apple.com>
+
+       * track modification time of .o files so that sythesized OSO stab will have it
+
+2006-01-09     Nick Kledzik    <kledzik@apple.com>
+
+       * src/MachOFileAbstraction.hpp: add macho_uuid_command
+       * src/MachOWriterExecutable.cpp: add UUID load command to generated files
+
+2006-01-09     Nick Kledzik    <kledzik@apple.com>
+
+       * src/MachOReaderDylib.hpp: no longer keep dylib memory mapped
+       * src/ld.cpp: don't track dylib sizes because they are not longer memory mapped
+
+2006-01-05     Nick Kledzik    <kledzik@apple.com>
+
+       * src/MachOReaderRelocatable.hpp: support new relocations
+
+2006-01-05     Nick Kledzik    <kledzik@apple.com>
+
+       * src/MachOReaderDylib.hpp: support MH_DYLIB_STUB
+       * src/MachOReaderRelocatable.hpp: Add Geoff's comp unit extractor
+
+2006-01-05     Nick Kledzik    <kledzik@apple.com>
+
+       refactor: transform Atom::dontStripName() to getSymbolTableInclusion()
+       * src/ld.cpp: pass dyld_stub_binding_helper to writer
+       * src/MachOReaderRelocatable.hpp: update synthesized stabs
+         Ignore stubs and lazy pointers in .o files
+         Support initializers and terminators
+       * src/MachOWriterExecutable.hpp: synthesize stubs and lazy pointers as needed
+       * ld64.xcodeproj/project.pbxproj: change Release target to build with dwarf
+
+2006-01-03  Eric Christopher  <echristo@apple.com>
+
+       * src/Options.h (multipleDefinitionsInDylibs): Declare.
+       (overridingDefinitionInDependentDylib): Ditto.
+       (warnOnMultipleDefinitionsInObjectFiles): Ditto.
+       (multiplyDefined): Remove.
+       (multiplyDefinedUnused): Ditto.
+       (fMultiplyDefined): Ditto.
+       (fWarnOnMultiplyDefined): New.
+       (fMultiplyDefinedDynamic): Ditto.
+       * src/Options.cpp (Options::Options): Initialize above.
+       (overridingDefinitionInDependentDylib): New.
+       (multipleDefinitionsInDylibs): Ditto.
+       (warnOnMultipleDefinitionsInObjectFiles): Ditto.
+       (parse): Update comments. Fix parsing of -y option.
+       Update error message for -dead_strip. Parse above
+       options.
+
+2006-01-02     Nick Kledzik    <kledzik@apple.com>
+
+       * Refactor: move Atom::writeContent() to Writer
+
+2005-12-23     Nick Kledzik    <kledzik@apple.com>
+
+       * Reworked, simplify, and document test harness
+       * unit-tests/README: Added
+
+2005-12-23     Nick Kledzik    <kledzik@apple.com>
+
+       * src/MachOReaderRelocatable.hpp: fixes for Objective-C
+       * unit-tests/test-cases/relocs-objc: Added
+
+2005-12-22     Nick Kledzik    <kledzik@apple.com>
+
+       * src/MachOReaderRelocatable.hpp: fix check that next reloc is pair
+       * src/MachOReaderRelocatable.hpp: Add code to synthesize essential stabs from dwarf
+
+2005-12-21     Nick Kledzik    <kledzik@apple.com>
+
+       * src/MachOReaderRelocatable.hpp: Fix parsing of literal sections
+       * src/MachOWriterExecutable.hpp: Fix writing of literal sections
+       * unit-tests/test-cases/relocs-literals: Added
+
+2005-12-15  Eric Christopher  <echristo@apple.com>
+
+       * src/Options.h (enum Treatment): New.
+       (enum PICTreatment): Delete.
+       (enum VersionMin): New.
+       (prebind): Declare.
+       (macosxVersionMin): Ditto.
+       (multiplyDefined): Ditto.
+       (multiplyDefinedUnused): Ditto.
+       (setVersionMin): Ditto.
+       (setPICTreatment): Delete.
+       (setReadOnlyRelocTreatment): Ditto.
+       (picTreatment): Adjust return type.
+       (parseTreatment): New.
+       (fPrebind): Ditto.
+       (fVersionMin): Ditto.
+       (fPICTreatment): Change type.
+       (fMultiplyDefined): New.
+       (fMultiplyDefinedUnused): Ditto.
+       (fLimitUndefinedSymbols): Ditto.
+
+       * src/Options.cpp: Fix whitespace. Add comments on options.
+       (Options::Options): Add initializers for new variables.
+       (Options::prebind): New.
+       (Options::macosxVersionMin): Ditto.
+       (Options::parseTreatment): Ditto.
+       (Options::setVersionMin): Ditto.
+       (Options::setReadOnlyRelocTreatment): Delete.
+       (Options::setPICTreatment): Ditto.
+       (Options::Parse): Update for above. Add comments.
+
+2005-12-15     Nick Kledzik    <kledzik@apple.com>
+
+       * src/MachOReaderRelocatable.hpp: Add comments about dwarf
+
+2005-12-14     Nick Kledzik    <kledzik@apple.com>
+
+       * src/ELFFileAbstraction.hpp: Added
+       * src/ELFReaderRelocatable.hpp: Added
+       * Lot of fixes for new architecture
+       * Added __OPEN_SOURCE__ to "Preprocessor Macros" to disable new architecture support by default
+
+2005-12-13     Nick Kledzik    <kledzik@apple.com>
+
+       * src/MachOReaderRelocatable.hpp: check for S_ATTR_DEBUG and ignore those sections
+       * unit-tests/test-cases/dwarf-ignore: added
+
+2005-12-12     Nick Kledzik    <kledzik@apple.com>
+
+       * Added test harness and three initial tests:
+               relocs-asm, relocs-c, and hello-world
+
+2005-12-12     Nick Kledzik    <kledzik@apple.com>
+
+       * src/MachOReaderRelocatable.hpp: Massive refactoring:
+               Now there are three Atom classes, Chopping into Atoms
+               is done on label boundaries or by knowledge of special
+               sections, Share lots of ppc/ppc64 code.
+       Stabs process code is temporarily disabled.
+
+2005-12-12     Nick Kledzik    <kledzik@apple.com>
+
+       * src/ObjectDump.cpp: Add command line options: -no_content, -stabs, -no_sort
+
+2005-12-11  Eric Christopher  <echristo@apple.com>
+
+       * src/Options.cpp: Reformat.
+       * src/Options.h: Ditto.
+
+2005-12-07  Eric Christopher  <echristo@apple.com>
+
+       * src/MachOReaderRelocatable.hpp (Atom::getAlignment):
+       When calculating alignment of an Atom, take into account
+       the alignment from which we pulled the Atom.
+
+2005-12-06     Nick Kledzik    <kledzik@apple.com>
+
+       * src/Options.cpp src/Options.h: Add design comments
+
+2005-12-05  Eric Christopher  <echristo@apple.com>
+
+       * src/ld.cpp (Linker::createWriter): Uncomment ppc64 and
+       i386 linkers.
+
+2005-12-05  Eric Christopher  <echristo@apple.com>
+
+       * ChangeLog: New file.
+
+2005-12-02     Nick Kledzik    <kledzik@apple.com>
+
+       * src/ObjectFile.h: Add design comments
+
+2005-11-30     Nick Kledzik    <kledzik@apple.com>
+
+       * Fix uses of __OPEN_SOURCE__
+
+2005-11-28     Nick Kledzik    <kledzik@apple.com>
+
+       * Refactor Atom to use getDefinitionKind()
+
+2005-11-21     Nick Kledzik    <kledzik@apple.com>
+
+       * src/MachOWriterExecutable.hpp: don't generate section for commons in -r mode
+
+2005-11-18     Nick Kledzik    <kledzik@apple.com>
+
+       * x86 tweaks
+
+2005-11-18     Nick Kledzik    <kledzik@apple.com>
+
+       * src/ObjectDump.cpp: make work with command line arguments
+
+2005-11-18     Nick Kledzik    <kledzik@apple.com>
+
+       * Massive rework to remove preprocessor conditionals and use templates
+
+2005-11-14     Nick Kledzik    <kledzik@apple.com>
+
+       * Created new Subversion repository for ld64 from cvs tag ld64-27.2
index 9cadfbbe3c7446486ce33078bbb6ca03c610254e..4d1b2f051b357f47fb472f2f9be7131b1b7a9e3d 100644 (file)
@@ -503,6 +503,7 @@ bool Reader<x86_64>::validFile(const uint8_t* fileContent, bool executableOrDyli
 
 
 
 
 
 
+
 }; // namespace dylib
 }; // namespace mach_o
 
 }; // namespace dylib
 }; // namespace mach_o
 
index 7458d59e84f78c1565fbffcf6a4dda35ad67b647..ea6f6de2c9597558a741947c8eee06385d75516d 100644 (file)
@@ -1820,6 +1820,7 @@ Reference<x86_64>* Reader<x86_64>::makeReferenceToEH(const char* ehName, pint_t
        return NULL;
 }
 
        return NULL;
 }
 
+
 template <typename A>
 AtomAndOffset Reader<A>::findAtomAndOffset(uint32_t addr)
 {
 template <typename A>
 AtomAndOffset Reader<A>::findAtomAndOffset(uint32_t addr)
 {
@@ -2701,23 +2702,59 @@ bool Reader<x86_64>::addRelocReference(const macho_section<x86_64::P>* sect, con
                                makeReference(x86_64::kPointer, srcAddr, dstAddr);
                        break;
                case X86_64_RELOC_SIGNED:
                                makeReference(x86_64::kPointer, srcAddr, dstAddr);
                        break;
                case X86_64_RELOC_SIGNED:
+               case X86_64_RELOC_SIGNED_1:
+               case X86_64_RELOC_SIGNED_2:
+               case X86_64_RELOC_SIGNED_4:
                        if ( ! reloc->r_pcrel() )
                                throw "not pcrel and X86_64_RELOC_SIGNED not supported";
                        if ( reloc->r_length() != 2 ) 
                                throw "length != 2 and X86_64_RELOC_SIGNED not supported";
                        kind = x86_64::kPCRel32;
                        dstAddr = (int64_t)((int32_t)(E::get32(*fixUpPtr)));
                        if ( ! reloc->r_pcrel() )
                                throw "not pcrel and X86_64_RELOC_SIGNED not supported";
                        if ( reloc->r_length() != 2 ) 
                                throw "length != 2 and X86_64_RELOC_SIGNED not supported";
                        kind = x86_64::kPCRel32;
                        dstAddr = (int64_t)((int32_t)(E::get32(*fixUpPtr)));
-                       if ( dstAddr == (uint64_t)(-1) ) {
-                               dstAddr = 0;
-                               kind = x86_64::kPCRel32_1;
-                       }
-                       else if ( dstAddr == (uint64_t)(-2) ) {
-                               dstAddr = 0;
-                               kind = x86_64::kPCRel32_2;
-                       }
-                       else if ( dstAddr == (uint64_t)(-4) ) {
-                               dstAddr = 0;
-                               kind = x86_64::kPCRel32_4;
+                       switch ( reloc->r_type() ) {
+                               case X86_64_RELOC_SIGNED:
+                                       if ( reloc->r_extern() ) {
+                                               // Support older relocations
+                                               if ( dstAddr == (uint64_t)(-1) ) {
+                                                       kind = x86_64::kPCRel32_1;
+                                                       dstAddr = 0;
+                                               }
+                                               else if ( dstAddr == (uint64_t)(-2) ) {
+                                                       kind = x86_64::kPCRel32_2;
+                                                       dstAddr = 0;
+                                               }
+                                               else if ( dstAddr == (uint64_t)(-4) ) {
+                                                       kind = x86_64::kPCRel32_4;
+                                                       dstAddr = 0;
+                                               }
+                                       }
+                                       break;
+                               case X86_64_RELOC_SIGNED_1:
+                                       if ( reloc->r_extern() ) {
+                                               dstAddr = 0;
+                                       } else {
+                                               dstAddr += 1;
+                                       }
+                                       kind = x86_64::kPCRel32_1;
+                                       break;
+                               case X86_64_RELOC_SIGNED_2:
+                                       if ( reloc->r_extern() ) {
+                                               dstAddr = 0;
+                                       } else {
+                                               dstAddr += 2;
+                                       }
+                                       kind = x86_64::kPCRel32_2;
+                                       break;
+                               case X86_64_RELOC_SIGNED_4:
+                                       if ( reloc->r_extern() ) {
+                                               dstAddr = 0;
+                                       } else {
+                                               dstAddr += 4;
+                                       }
+                                       kind = x86_64::kPCRel32_4;
+                                       break;
+                               default:
+                                       break;
                        }
                        if ( reloc->r_extern() ) 
                                makeReferenceToSymbol(kind, srcAddr, targetSymbol, dstAddr);
                        }
                        if ( reloc->r_extern() ) 
                                makeReferenceToSymbol(kind, srcAddr, targetSymbol, dstAddr);
@@ -3136,6 +3173,7 @@ const char* Reference<x86_64>::getDescription() const
 }
 
 
 }
 
 
+
 }; // namespace relocatable
 }; // namespace mach_o
 
 }; // namespace relocatable
 }; // namespace mach_o
 
index 70798a6912f23492d886e7667b4fdd1158a8888a..0aa95b755dccbfef344d82f99ee7872077aea48e 100644 (file)
@@ -1705,15 +1705,42 @@ uint32_t Writer<x86_64>::addObjectRelocs(ObjectFile::Atom* atom, ObjectFile::Ref
                        return 1;
 
                case x86_64::kPCRel32:
                        return 1;
 
                case x86_64::kPCRel32:
+                       reloc1.set_r_address(address);
+                       reloc1.set_r_symbolnum(symbolIndex);
+                       reloc1.set_r_pcrel(true);
+                       reloc1.set_r_length(2);
+                       reloc1.set_r_extern(external);
+                       reloc1.set_r_type(X86_64_RELOC_SIGNED);
+                       fSectionRelocs.insert(fSectionRelocs.begin(), reloc1);
+                       return 1;
+
                case x86_64::kPCRel32_1:
                case x86_64::kPCRel32_1:
+                       reloc1.set_r_address(address);
+                       reloc1.set_r_symbolnum(symbolIndex);
+                       reloc1.set_r_pcrel(true);
+                       reloc1.set_r_length(2);
+                       reloc1.set_r_extern(external);
+                       reloc1.set_r_type(X86_64_RELOC_SIGNED_1);
+                       fSectionRelocs.insert(fSectionRelocs.begin(), reloc1);
+                       return 1;
+
                case x86_64::kPCRel32_2:
                case x86_64::kPCRel32_2:
+                       reloc1.set_r_address(address);
+                       reloc1.set_r_symbolnum(symbolIndex);
+                       reloc1.set_r_pcrel(true);
+                       reloc1.set_r_length(2);
+                       reloc1.set_r_extern(external);
+                       reloc1.set_r_type(X86_64_RELOC_SIGNED_2);
+                       fSectionRelocs.insert(fSectionRelocs.begin(), reloc1);
+                       return 1;
+
                case x86_64::kPCRel32_4:
                        reloc1.set_r_address(address);
                        reloc1.set_r_symbolnum(symbolIndex);
                        reloc1.set_r_pcrel(true);
                        reloc1.set_r_length(2);
                        reloc1.set_r_extern(external);
                case x86_64::kPCRel32_4:
                        reloc1.set_r_address(address);
                        reloc1.set_r_symbolnum(symbolIndex);
                        reloc1.set_r_pcrel(true);
                        reloc1.set_r_length(2);
                        reloc1.set_r_extern(external);
-                       reloc1.set_r_type(X86_64_RELOC_SIGNED);
+                       reloc1.set_r_type(X86_64_RELOC_SIGNED_4);
                        fSectionRelocs.insert(fSectionRelocs.begin(), reloc1);
                        return 1;
 
                        fSectionRelocs.insert(fSectionRelocs.begin(), reloc1);
                        return 1;
 
@@ -1742,6 +1769,7 @@ uint32_t Writer<x86_64>::addObjectRelocs(ObjectFile::Atom* atom, ObjectFile::Ref
        return 0;
 }
 
        return 0;
 }
 
+
 template <>
 uint32_t Writer<x86>::addObjectRelocs(ObjectFile::Atom* atom, ObjectFile::Reference* ref)
 {
 template <>
 uint32_t Writer<x86>::addObjectRelocs(ObjectFile::Atom* atom, ObjectFile::Reference* ref)
 {
@@ -3200,6 +3228,7 @@ bool Writer<x86_64>::weakImportReferenceKind(uint8_t kind)
 }
 
 
 }
 
 
+
 template <>
 bool Writer<ppc>::GOTReferenceKind(uint8_t kind)
 {
 template <>
 bool Writer<ppc>::GOTReferenceKind(uint8_t kind)
 {
@@ -3231,6 +3260,7 @@ bool Writer<x86_64>::GOTReferenceKind(uint8_t kind)
        return false;
 }
 
        return false;
 }
 
+
 template <typename A>
 void Writer<A>::scanForAbsoluteReferences()
 {
 template <typename A>
 void Writer<A>::scanForAbsoluteReferences()
 {
@@ -3599,6 +3629,7 @@ bool Writer<x86_64>::addBranchIslands()
        return false;
 }
 
        return false;
 }
 
+
 template <>
 inline uint8_t Writer<ppc>::branch24Reference()
 {
 template <>
 inline uint8_t Writer<ppc>::branch24Reference()
 {
@@ -4185,6 +4216,7 @@ void MachHeaderAtom<x86_64>::setHeaderInfo(macho_header<x86_64::P>& header) cons
        header.set_cpusubtype(CPU_SUBTYPE_X86_64_ALL);
 }
 
        header.set_cpusubtype(CPU_SUBTYPE_X86_64_ALL);
 }
 
+
 template <typename A>
 CustomStackAtom<A>::CustomStackAtom(Writer<A>& writer)
  : WriterAtom<A>(writer, Segment::fgStackSegment)
 template <typename A>
 CustomStackAtom<A>::CustomStackAtom(Writer<A>& writer)
  : WriterAtom<A>(writer, Segment::fgStackSegment)
@@ -4220,6 +4252,7 @@ bool CustomStackAtom<x86_64>::stackGrowsDown()
        return true;
 }
 
        return true;
 }
 
+
 template <typename A>
 void SegmentLoadCommandsAtom<A>::computeSize()
 {
 template <typename A>
 void SegmentLoadCommandsAtom<A>::computeSize()
 {
@@ -4267,7 +4300,6 @@ uint64_t LoadCommandAtom<x86_64>::alignedSize(uint64_t size)
        return ((size+7) & (-8));       // 8-byte align all load commands for 64-bit mach-o
 }
 
        return ((size+7) & (-8));       // 8-byte align all load commands for 64-bit mach-o
 }
 
-
 template <typename A>
 void SegmentLoadCommandsAtom<A>::copyRawContent(uint8_t buffer[]) const
 {
 template <typename A>
 void SegmentLoadCommandsAtom<A>::copyRawContent(uint8_t buffer[]) const
 {
index e52b0ccc7e4053da79062ed50bbe85827ff652b5..8b56436c115dbeb53f5253d8786d7cb968099bec 100644 (file)
@@ -29,7 +29,6 @@
 #include <fcntl.h>
 #include <vector>
 
 #include <fcntl.h>
 #include <vector>
 
-
 #include "Options.h"
 
 void throwf(const char* format, ...)
 #include "Options.h"
 
 void throwf(const char* format, ...)