From: Apple
Date: Wed, 8 Aug 2012 19:57:56 +0000 (+0000)
Subject: ld64-134.9.tar.gz
X-Git-Tag: developer-tools-45^0
X-Git-Url: https://git.saurik.com/apple/ld64.git/commitdiff_plain/b1f7435d66a93f03b77932b3a9ad8a83ce5e1ebc
ld64-134.9.tar.gz
---
diff --git a/ld64-134.9/APPLE_LICENSE b/ld64-134.9/APPLE_LICENSE
new file mode 100644
index 0000000..fe81a60
--- /dev/null
+++ b/ld64-134.9/APPLE_LICENSE
@@ -0,0 +1,367 @@
+APPLE PUBLIC SOURCE LICENSE
+Version 2.0 - August 6, 2003
+
+Please read this License carefully before downloading this software.
+By downloading or using this software, you are agreeing to be bound by
+the terms of this License. If you do not or cannot agree to the terms
+of this License, please do not download or use the software.
+
+1. General; Definitions. This License applies to any program or other
+work which Apple Computer, Inc. ("Apple") makes publicly available and
+which contains a notice placed by Apple identifying such program or
+work as "Original Code" and stating that it is subject to the terms of
+this Apple Public Source License version 2.0 ("License"). As used in
+this License:
+
+1.1 "Applicable Patent Rights" mean: (a) in the case where Apple is
+the grantor of rights, (i) claims of patents that are now or hereafter
+acquired, owned by or assigned to Apple and (ii) that cover subject
+matter contained in the Original Code, but only to the extent
+necessary to use, reproduce and/or distribute the Original Code
+without infringement; and (b) in the case where You are the grantor of
+rights, (i) claims of patents that are now or hereafter acquired,
+owned by or assigned to You and (ii) that cover subject matter in Your
+Modifications, taken alone or in combination with Original Code.
+
+1.2 "Contributor" means any person or entity that creates or
+contributes to the creation of Modifications.
+
+1.3 "Covered Code" means the Original Code, Modifications, the
+combination of Original Code and any Modifications, and/or any
+respective portions thereof.
+
+1.4 "Externally Deploy" means: (a) to sublicense, distribute or
+otherwise make Covered Code available, directly or indirectly, to
+anyone other than You; and/or (b) to use Covered Code, alone or as
+part of a Larger Work, in any way to provide a service, including but
+not limited to delivery of content, through electronic communication
+with a client other than You.
+
+1.5 "Larger Work" means a work which combines Covered Code or portions
+thereof with code not governed by the terms of this License.
+
+1.6 "Modifications" mean any addition to, deletion from, and/or change
+to, the substance and/or structure of the Original Code, any previous
+Modifications, the combination of Original Code and any previous
+Modifications, and/or any respective portions thereof. When code is
+released as a series of files, a Modification is: (a) any addition to
+or deletion from the contents of a file containing Covered Code;
+and/or (b) any new file or other representation of computer program
+statements that contains any part of Covered Code.
+
+1.7 "Original Code" means (a) the Source Code of a program or other
+work as originally made available by Apple under this License,
+including the Source Code of any updates or upgrades to such programs
+or works made available by Apple under this License, and that has been
+expressly identified by Apple as such in the header file(s) of such
+work; and (b) the object code compiled from such Source Code and
+originally made available by Apple under this License.
+
+1.8 "Source Code" means the human readable form of a program or other
+work that is suitable for making modifications to it, including all
+modules it contains, plus any associated interface definition files,
+scripts used to control compilation and installation of an executable
+(object code).
+
+1.9 "You" or "Your" means an individual or a legal entity exercising
+rights under this License. For legal entities, "You" or "Your"
+includes any entity which controls, is controlled by, or is under
+common control with, You, where "control" means (a) the power, direct
+or indirect, to cause the direction or management of such entity,
+whether by contract or otherwise, or (b) ownership of fifty percent
+(50%) or more of the outstanding shares or beneficial ownership of
+such entity.
+
+2. Permitted Uses; Conditions & Restrictions. Subject to the terms
+and conditions of this License, Apple hereby grants You, effective on
+the date You accept this License and download the Original Code, a
+world-wide, royalty-free, non-exclusive license, to the extent of
+Apple's Applicable Patent Rights and copyrights covering the Original
+Code, to do the following:
+
+2.1 Unmodified Code. You may use, reproduce, display, perform,
+internally distribute within Your organization, and Externally Deploy
+verbatim, unmodified copies of the Original Code, for commercial or
+non-commercial purposes, provided that in each instance:
+
+(a) You must retain and reproduce in all copies of Original Code the
+copyright and other proprietary notices and disclaimers of Apple as
+they appear in the Original Code, and keep intact all notices in the
+Original Code that refer to this License; and
+
+(b) You must include a copy of this License with every copy of Source
+Code of Covered Code and documentation You distribute or Externally
+Deploy, and You may not offer or impose any terms on such Source Code
+that alter or restrict this License or the recipients' rights
+hereunder, except as permitted under Section 6.
+
+2.2 Modified Code. You may modify Covered Code and use, reproduce,
+display, perform, internally distribute within Your organization, and
+Externally Deploy Your Modifications and Covered Code, for commercial
+or non-commercial purposes, provided that in each instance You also
+meet all of these conditions:
+
+(a) You must satisfy all the conditions of Section 2.1 with respect to
+the Source Code of the Covered Code;
+
+(b) You must duplicate, to the extent it does not already exist, the
+notice in Exhibit A in each file of the Source Code of all Your
+Modifications, and cause the modified files to carry prominent notices
+stating that You changed the files and the date of any change; and
+
+(c) If You Externally Deploy Your Modifications, You must make
+Source Code of all Your Externally Deployed Modifications either
+available to those to whom You have Externally Deployed Your
+Modifications, or publicly available. Source Code of Your Externally
+Deployed Modifications must be released under the terms set forth in
+this License, including the license grants set forth in Section 3
+below, for as long as you Externally Deploy the Covered Code or twelve
+(12) months from the date of initial External Deployment, whichever is
+longer. You should preferably distribute the Source Code of Your
+Externally Deployed Modifications electronically (e.g. download from a
+web site).
+
+2.3 Distribution of Executable Versions. In addition, if You
+Externally Deploy Covered Code (Original Code and/or Modifications) in
+object code, executable form only, You must include a prominent
+notice, in the code itself as well as in related documentation,
+stating that Source Code of the Covered Code is available under the
+terms of this License with information on how and where to obtain such
+Source Code.
+
+2.4 Third Party Rights. You expressly acknowledge and agree that
+although Apple and each Contributor grants the licenses to their
+respective portions of the Covered Code set forth herein, no
+assurances are provided by Apple or any Contributor that the Covered
+Code does not infringe the patent or other intellectual property
+rights of any other entity. Apple and each Contributor disclaim any
+liability to You for claims brought by any other entity based on
+infringement of intellectual property rights or otherwise. As a
+condition to exercising the rights and licenses granted hereunder, You
+hereby assume sole responsibility to secure any other intellectual
+property rights needed, if any. For example, if a third party patent
+license is required to allow You to distribute the Covered Code, it is
+Your responsibility to acquire that license before distributing the
+Covered Code.
+
+3. Your Grants. In consideration of, and as a condition to, the
+licenses granted to You under this License, You hereby grant to any
+person or entity receiving or distributing Covered Code under this
+License a non-exclusive, royalty-free, perpetual, irrevocable license,
+under Your Applicable Patent Rights and other intellectual property
+rights (other than patent) owned or controlled by You, to use,
+reproduce, display, perform, modify, sublicense, distribute and
+Externally Deploy Your Modifications of the same scope and extent as
+Apple's licenses under Sections 2.1 and 2.2 above.
+
+4. Larger Works. You may create a Larger Work by combining Covered
+Code with other code not governed by the terms of this License and
+distribute the Larger Work as a single product. In each such instance,
+You must make sure the requirements of this License are fulfilled for
+the Covered Code or any portion thereof.
+
+5. Limitations on Patent License. Except as expressly stated in
+Section 2, no other patent rights, express or implied, are granted by
+Apple herein. Modifications and/or Larger Works may require additional
+patent licenses from Apple which Apple may grant in its sole
+discretion.
+
+6. Additional Terms. You may choose to offer, and to charge a fee for,
+warranty, support, indemnity or liability obligations and/or other
+rights consistent with the scope of the license granted herein
+("Additional Terms") to one or more recipients of Covered Code.
+However, You may do so only on Your own behalf and as Your sole
+responsibility, and not on behalf of Apple or any Contributor. You
+must obtain the recipient's agreement that any such Additional Terms
+are offered by You alone, and You hereby agree to indemnify, defend
+and hold Apple and every Contributor harmless for any liability
+incurred by or claims asserted against Apple or such Contributor by
+reason of any such Additional Terms.
+
+7. Versions of the License. Apple may publish revised and/or new
+versions of this License from time to time. Each version will be given
+a distinguishing version number. Once Original Code has been published
+under a particular version of this License, You may continue to use it
+under the terms of that version. You may also choose to use such
+Original Code under the terms of any subsequent version of this
+License published by Apple. No one other than Apple has the right to
+modify the terms applicable to Covered Code created under this
+License.
+
+8. NO WARRANTY OR SUPPORT. The Covered Code may contain in whole or in
+part pre-release, untested, or not fully tested works. The Covered
+Code may contain errors that could cause failures or loss of data, and
+may be incomplete or contain inaccuracies. You expressly acknowledge
+and agree that use of the Covered Code, or any portion thereof, is at
+Your sole and entire risk. THE COVERED CODE IS PROVIDED "AS IS" AND
+WITHOUT WARRANTY, UPGRADES OR SUPPORT OF ANY KIND AND APPLE AND
+APPLE'S LICENSOR(S) (COLLECTIVELY REFERRED TO AS "APPLE" FOR THE
+PURPOSES OF SECTIONS 8 AND 9) AND ALL CONTRIBUTORS EXPRESSLY DISCLAIM
+ALL WARRANTIES AND/OR CONDITIONS, EXPRESS OR IMPLIED, INCLUDING, BUT
+NOT LIMITED TO, THE IMPLIED WARRANTIES AND/OR CONDITIONS OF
+MERCHANTABILITY, OF SATISFACTORY QUALITY, OF FITNESS FOR A PARTICULAR
+PURPOSE, OF ACCURACY, OF QUIET ENJOYMENT, AND NONINFRINGEMENT OF THIRD
+PARTY RIGHTS. APPLE AND EACH CONTRIBUTOR DOES NOT WARRANT AGAINST
+INTERFERENCE WITH YOUR ENJOYMENT OF THE COVERED CODE, THAT THE
+FUNCTIONS CONTAINED IN THE COVERED CODE WILL MEET YOUR REQUIREMENTS,
+THAT THE OPERATION OF THE COVERED CODE WILL BE UNINTERRUPTED OR
+ERROR-FREE, OR THAT DEFECTS IN THE COVERED CODE WILL BE CORRECTED. NO
+ORAL OR WRITTEN INFORMATION OR ADVICE GIVEN BY APPLE, AN APPLE
+AUTHORIZED REPRESENTATIVE OR ANY CONTRIBUTOR SHALL CREATE A WARRANTY.
+You acknowledge that the Covered Code is not intended for use in the
+operation of nuclear facilities, aircraft navigation, communication
+systems, or air traffic control machines in which case the failure of
+the Covered Code could lead to death, personal injury, or severe
+physical or environmental damage.
+
+9. LIMITATION OF LIABILITY. TO THE EXTENT NOT PROHIBITED BY LAW, IN NO
+EVENT SHALL APPLE OR ANY CONTRIBUTOR BE LIABLE FOR ANY INCIDENTAL,
+SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES ARISING OUT OF OR RELATING
+TO THIS LICENSE OR YOUR USE OR INABILITY TO USE THE COVERED CODE, OR
+ANY PORTION THEREOF, WHETHER UNDER A THEORY OF CONTRACT, WARRANTY,
+TORT (INCLUDING NEGLIGENCE), PRODUCTS LIABILITY OR OTHERWISE, EVEN IF
+APPLE OR SUCH CONTRIBUTOR HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
+DAMAGES AND NOTWITHSTANDING THE FAILURE OF ESSENTIAL PURPOSE OF ANY
+REMEDY. SOME JURISDICTIONS DO NOT ALLOW THE LIMITATION OF LIABILITY OF
+INCIDENTAL OR CONSEQUENTIAL DAMAGES, SO THIS LIMITATION MAY NOT APPLY
+TO YOU. In no event shall Apple's total liability to You for all
+damages (other than as may be required by applicable law) under this
+License exceed the amount of fifty dollars ($50.00).
+
+10. Trademarks. This License does not grant any rights to use the
+trademarks or trade names "Apple", "Apple Computer", "Mac", "Mac OS",
+"QuickTime", "QuickTime Streaming Server" or any other trademarks,
+service marks, logos or trade names belonging to Apple (collectively
+"Apple Marks") or to any trademark, service mark, logo or trade name
+belonging to any Contributor. You agree not to use any Apple Marks in
+or as part of the name of products derived from the Original Code or
+to endorse or promote products derived from the Original Code other
+than as expressly permitted by and in strict compliance at all times
+with Apple's third party trademark usage guidelines which are posted
+at http://www.apple.com/legal/guidelinesfor3rdparties.html.
+
+11. Ownership. Subject to the licenses granted under this License,
+each Contributor retains all rights, title and interest in and to any
+Modifications made by such Contributor. Apple retains all rights,
+title and interest in and to the Original Code and any Modifications
+made by or on behalf of Apple ("Apple Modifications"), and such Apple
+Modifications will not be automatically subject to this License. Apple
+may, at its sole discretion, choose to license such Apple
+Modifications under this License, or on different terms from those
+contained in this License or may choose not to license them at all.
+
+12. Termination.
+
+12.1 Termination. This License and the rights granted hereunder will
+terminate:
+
+(a) automatically without notice from Apple if You fail to comply with
+any term(s) of this License and fail to cure such breach within 30
+days of becoming aware of such breach;
+
+(b) immediately in the event of the circumstances described in Section
+13.5(b); or
+
+(c) automatically without notice from Apple if You, at any time during
+the term of this License, commence an action for patent infringement
+against Apple; provided that Apple did not first commence
+an action for patent infringement against You in that instance.
+
+12.2 Effect of Termination. Upon termination, You agree to immediately
+stop any further use, reproduction, modification, sublicensing and
+distribution of the Covered Code. All sublicenses to the Covered Code
+which have been properly granted prior to termination shall survive
+any termination of this License. Provisions which, by their nature,
+should remain in effect beyond the termination of this License shall
+survive, including but not limited to Sections 3, 5, 8, 9, 10, 11,
+12.2 and 13. No party will be liable to any other for compensation,
+indemnity or damages of any sort solely as a result of terminating
+this License in accordance with its terms, and termination of this
+License will be without prejudice to any other right or remedy of
+any party.
+
+13. Miscellaneous.
+
+13.1 Government End Users. The Covered Code is a "commercial item" as
+defined in FAR 2.101. Government software and technical data rights in
+the Covered Code include only those rights customarily provided to the
+public as defined in this License. This customary commercial license
+in technical data and software is provided in accordance with FAR
+12.211 (Technical Data) and 12.212 (Computer Software) and, for
+Department of Defense purchases, DFAR 252.227-7015 (Technical Data --
+Commercial Items) and 227.7202-3 (Rights in Commercial Computer
+Software or Computer Software Documentation). Accordingly, all U.S.
+Government End Users acquire Covered Code with only those rights set
+forth herein.
+
+13.2 Relationship of Parties. This License will not be construed as
+creating an agency, partnership, joint venture or any other form of
+legal association between or among You, Apple or any Contributor, and
+You will not represent to the contrary, whether expressly, by
+implication, appearance or otherwise.
+
+13.3 Independent Development. Nothing in this License will impair
+Apple's right to acquire, license, develop, have others develop for
+it, market and/or distribute technology or products that perform the
+same or similar functions as, or otherwise compete with,
+Modifications, Larger Works, technology or products that You may
+develop, produce, market or distribute.
+
+13.4 Waiver; Construction. Failure by Apple or any Contributor to
+enforce any provision of this License will not be deemed a waiver of
+future enforcement of that or any other provision. Any law or
+regulation which provides that the language of a contract shall be
+construed against the drafter will not apply to this License.
+
+13.5 Severability. (a) If for any reason a court of competent
+jurisdiction finds any provision of this License, or portion thereof,
+to be unenforceable, that provision of the License will be enforced to
+the maximum extent permissible so as to effect the economic benefits
+and intent of the parties, and the remainder of this License will
+continue in full force and effect. (b) Notwithstanding the foregoing,
+if applicable law prohibits or restricts You from fully and/or
+specifically complying with Sections 2 and/or 3 or prevents the
+enforceability of either of those Sections, this License will
+immediately terminate and You must immediately discontinue any use of
+the Covered Code and destroy all copies of it that are in your
+possession or control.
+
+13.6 Dispute Resolution. Any litigation or other dispute resolution
+between You and Apple relating to this License shall take place in the
+Northern District of California, and You and Apple hereby consent to
+the personal jurisdiction of, and venue in, the state and federal
+courts within that District with respect to this License. The
+application of the United Nations Convention on Contracts for the
+International Sale of Goods is expressly excluded.
+
+13.7 Entire Agreement; Governing Law. This License constitutes the
+entire agreement between the parties with respect to the subject
+matter hereof. This License shall be governed by the laws of the
+United States and the State of California, except that body of
+California law concerning conflicts of law.
+
+Where You are located in the province of Quebec, Canada, the following
+clause applies: The parties hereby confirm that they have requested
+that this License and all related documents be drafted in English. Les
+parties ont exige que le present contrat et tous les documents
+connexes soient rediges en anglais.
+
+EXHIBIT A.
+
+"Portions Copyright (c) 1999-2003 Apple Computer, Inc. All Rights
+Reserved.
+
+This file contains Original Code and/or Modifications of Original Code
+as defined in and that are subject to the Apple Public Source License
+Version 2.0 (the 'License'). You may not use this file except in
+compliance with the License. Please obtain a copy of the License at
+http://www.opensource.apple.com/apsl/ and read it before using this
+file.
+
+The Original Code and all software distributed under the License are
+distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
+EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
+INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
+Please see the License for the specific language governing rights and
+limitations under the License."
diff --git a/ld64-134.9/compile_stubs b/ld64-134.9/compile_stubs
new file mode 100755
index 0000000..e142e4d
--- /dev/null
+++ b/ld64-134.9/compile_stubs
@@ -0,0 +1,51 @@
+#!/bin/csh
+
+# Attempt to find the architecture.
+# First look through the command line args.
+set arch=unknown
+set link_cmd=(`cat link_command`)
+while ( $#link_cmd > 0 )
+ if ( "$link_cmd[1]" == "-arch" ) then
+ set arch=$link_cmd[2]
+ endif
+ shift link_cmd
+end
+
+# look for an explicit arch file
+if ( "$arch" == "unknown" ) then
+ if ( -e arch ) then
+ set arch=`cat arch`
+ endif
+endif
+
+if ( "$arch" == "unknown" ) then
+echo "***** Unable to determine architecture."
+exit 1
+endif
+
+# Create .dylibs for each file in the dylib_stubs directory.
+if ( -e dylib_stubs ) then
+ set files=`cd dylib_stubs ; echo *`
+ mkdir -p dylibs
+ foreach file ($files)
+ if ( ! -e dylibs/$file ) then
+ clang -arch $arch -c -fno-builtin -o tmp_object.o -x c dylib_stubs/$file
+ ld -arch $arch -dylib -macosx_version_min 10.1 -no_version_load_command -o dylibs/$file tmp_object.o
+ endif
+ end
+endif
+
+# Create .frameworks for each file in the framework_stubs directory.
+if ( -e framework_stubs ) then
+ set files=`cd framework_stubs ; echo *`
+ foreach file ($files)
+ if ( ! -e frameworks/$file.framework ) then
+ clang -arch $arch -c -fno-builtin -o tmp_object.o -x c framework_stubs/$file
+ mkdir -p frameworks/$file.framework
+ ld -arch $arch -dylib -macosx_version_min 10.1 -no_version_load_command -o frameworks/$file.framework/$file tmp_object.o
+ endif
+ end
+endif
+
+# Clean up.
+rm -f tmp_object.o
diff --git a/ld64-134.9/doc/design/bindings.png b/ld64-134.9/doc/design/bindings.png
new file mode 100644
index 0000000..7a56388
Binary files /dev/null and b/ld64-134.9/doc/design/bindings.png differ
diff --git a/ld64-134.9/doc/design/hello.png b/ld64-134.9/doc/design/hello.png
new file mode 100644
index 0000000..9140e16
Binary files /dev/null and b/ld64-134.9/doc/design/hello.png differ
diff --git a/ld64-134.9/doc/design/linker.html b/ld64-134.9/doc/design/linker.html
new file mode 100644
index 0000000..0e39f2f
--- /dev/null
+++ b/ld64-134.9/doc/design/linker.html
@@ -0,0 +1,423 @@
+
+
+ Linker
+
+
+
+
+
+ Inside the Linker
+
+
+
+
+
+
+The Darwin linker is a new generation of linker. It is not "section" based
+like traditional linkers which mostly just interlace sections from multiple
+object files into the output file. The Darwin linker is based on "Atoms".
+Traditional section based linking work well for simple linking, but their model
+makes advanced linking features difficult to implement. Features like dead code
+stripping, reordering functions for locality, and C++ coalescing require the
+linker to work at a finer grain.
+
+
+An atom is an indivisible chunk of code or data. An atom has a set of
+attributes, such as: name, scope, content-type, alignment, etc. An atom also
+has a list of Fixups. A Fixup contains: a kind, an optional offset, an optional
+addend, and an optional target atom.
+
+The Atom model allows the linker to use standard graph theory models for
+linking data structures. Each atom is a node, and each Fixup is an edge.
+The feature of dead code stripping is implemented by following edges to mark
+all live atoms, and then delete the non-live atoms.
+
+
+
+An atom is an indivisible chuck of code or data. Typically each user
+written function or global variable is an atom. In addition, the compiler may
+emit other atoms, such as for literal c-strings or floating point constants, or
+for runtime data structures like dwarf unwind info or pointers to initializers.
+
+
+A simple "hello world" object file would be modeled like this:
+
+There are two atoms: main and an anonymous atom containing the c-string
+literal "hello world". The Atom "main" has two fixups. One is the call site
+for the call to printf, and the other is a fixup for the instruction that loads
+the address of the c-string literal.
+
+
+
+
+The linker views the input files as basically containers of Atoms and Fixups,
+ and just a few attributes of their own. The linker works with three kinds
+of files: object files, static libraries, and dynamic libraries. Each kind
+of file has reader object which presents the file in the model expected by
+the linker.
+
+An object file is just a container of atoms. When linking with
+an object file, all atoms are added to the initial graph of atoms.
+
+
+This is the traditional unix static archive which is just a collection of
+object files with a "table of contents". When linking with a static library,
+by default nothing is added to the initial graph of atoms. Instead, if there
+are unresolved references (dangling edges) in the master graph of all atoms,
+and the table of contents for a static library says that one of the object files
+in the library defines one of the missing symbols (dangling edge),
+the set of atoms from the specified object file in the static library is added
+to the master graph of atoms.
+
+
+Dynamic libraries are unique in that the don't directly add add any atoms.
+Their purpose is to check at build time that all references are resolved and
+provide a list of dynamic libraries (SO_NEEDED) that will be needed at runtime.
+The way this is modeled in the linker is that a dynamic library contributes
+no atoms to the initial graph of atoms. Instead, (like static libraries) if
+there are unresolved references (dangling edges) in the master graph of all atoms,
+if a dynamic library exports a required symbol, then a "proxy" atom is
+instantiated by the linker. The proxy atom allows the master atom graph to have
+all edges resolved and also records from which dynamic library a symbol came.
+
+
+
+Through the use of abstract Atoms, the core of linking is architecture
+independent and file format independent. All command line parsing is factored
+out into a separate "options" abstraction which enables the linker to be driven
+with different command line sets.
+The overall steps in linking are:
+
+ - Command line processing
+ - Parsing input files
+ - Resolving
+ - Passes/Optimizations
+ - Generate output file
+
+
+The Resolving and Passes steps are done purely on the master graph of atoms,
+so they have no notion of file formats such as mach-o or ELF.
+
+
+The resolving step takes all the atoms graphs from each object file and
+combines them into one master object graph. Unfortunately, it is not as simple
+as appending the atom list from each file into one big list. There are many
+cases where atoms need to be coalesced. That is, two or more atoms need to
+be coalesced into one atom. This is necessary to support: C language
+ "tentative definitions", C++ weak symbols for templates and inlines defined
+in headers, and for merging copies of constants like c-strings and floating
+point constants.
+
+The linker support coalescing by-name and by-content. By-name is used for
+tentative definitions and weak symbols. By-content is used for constant data
+that can be merged.
+
+When one atom has a reference (FixUp) to another atom, there is also a binding
+type: by-name, direct, or indirect. A Fixup contains a tagged union that if
+the binding type is by-name, the union field is a pointer to a c-string. If
+the binding type is direct, the union is a pointer to an Atom. If the binding
+type is indirect, the union is a index into a table of pointers to Atoms. Below
+is a graphical representation of the binding types:
+
+
+Input file Atoms contain only direct and by-name references. Direct
+references are used for atoms defined in the same object file for which the
+target atom is either unnamed or cannot change. For instance, calling
+a static function in a translation unit will result in a direct reference
+to the static functions's atom. Also the FDE (dwarf unwind info) for a function
+has a direct reference to its function. On the other hand references to
+global symbols (e.g. call to printf) use by-name binding in object files.
+
+
+The resolving process maintains some global linking "state", including:
+a "symbol table" which is a map from c-string to Atom*, an indirect symbol
+table which is a growable array of Atom*, and for each kind of coalesable
+constants there is a content to Atom* map. With these data structures,
+the linker walks all atoms in all input files. For each
+atom, it checks if the atom should be in one symbol table or one of the
+coalescing tables. If so, it attempts to add the atom. If there already is
+a matching atom in that table, that means the current atom needs to be
+coalesced with the found atom.
+
+
+To support coalescing, all references to coalesable atoms are changed to
+indirect binding and an entry is added to the indirect table which points
+to the current chosen atom. When all input atoms have been processed by
+the resolver, there should be only direct and indirect bindings left. If
+there are any NULL entries in the indirect table, that means there are
+undefined references. The linker then looks to the supplied libraries (both
+static and dynamic) to resolve those references.
+
+
+Dead code stripping (if requested) is done at the end of resolving. The
+linker does a simple mark-and-sweep. It starts with "root" atoms (like "main"
+in a main executable) and follows each references and marks each Atom that
+it visits as "live". When done, all atoms not marked "live" are removed.
+
+
+
+The Passes step
+is an open ended set of routines that each get a change to modify or enhance
+the master graph of atoms. Passes are only run if the master graph of
+atoms is completely resolved (no dangling edges).
+The current set of Passes in the Darwin linker are:
+
+ - Objective-C optimizations (Apple)
+ - stub (PLT) generation
+ - GOT instantiation
+ - TLV instantiation (Apple)
+ - order_file optimization
+ - branch island generation
+ - branch shim generation
+ - dtrace probe processing (Apple)
+ - compact unwind encoding (Apple)
+
+Some of these passes are specific to Apple's runtime environments. But many
+of the passes are applicable to any OS (such as generating branch island for
+out of range branch instructions).
+
+The general structure of a pass is to walk the master graph inspecting each
+atom and doing something. For instance, the stub pass, walks the graph looking
+for atoms with call sites to proxy atoms (e.g. call to printf). It then
+instantiates a "stub" atom (PLT entry) and a "lazy pointer" atom for each
+proxy atom needed, and these new atoms are added to the master graph. Next
+all the noted call sites to proxy atoms are replaced with calls to the
+corresponding stub atom.
+
+
+Once the passes are done, the output file generator is given a sorted list
+of atoms. Its job is to create the executable content file wrapper and place
+the content of the atoms into it.
+
+
+
+
+
+
+The current use of sections in mach-o .o files over-constrains the linker.
+By default, the linker should preserve the section an atom is in. But since
+all sections must be contiguous in the output, that limits the ability of
+the linker to order atoms for locality. It would be helpful to enrich the
+object file with with reason something is in the section it is. For instance,
+is the section found at runtime? Or was the use of a section just a quick
+way to group some content together?
+
+The ELF model for sections is a little better than mach-o because ELF
+sections have write and execute bits, whereas mach-o sections must be in some
+segment and the segment has the write and execute bits.
+
+
+
+
+The messiest part of the linker is the mach-o parser. This is because mach-o
+is a traditional section and symbols based file format. The parser must infer
+atom boundaries using two approaches. The first is that some section types have
+well defined content which the linker can parse into atoms (e.g. __cstring,
+__eh_frame). The other approach is a naming convention (which the compiler follows)
+by which the linker breaks sections into atoms at any non-local (not starting
+with 'L') symbol. The processing the linker has to do parse mach-o .o files is a
+significant part of the link time.
+
+
+Given that the assembler writes object files once, whereas the linker reads
+them many times (during development), it would make sense to optimize the object
+file format to be something the linker can read/parse efficiently.
+
+
+LLVM has a nice model for its IR. There are three representations:
+the binary bit code file, the in-memory object model, and a textual
+representation. LLVM contains utility possible code for converting between these
+representations. The same model makes sense for atoms too. There should be
+three representations for atoms: binary file, in-memory, and textual. The Darwin
+linker already has an in-memory C++ object model for Atoms. All we need is a
+textual representation and binary file format.
+
+Note: in the darwin linker the binary format for input object files is
+independent of the output executable format. That is, we could have one
+universal object file format which the linker could use as input to produce
+mach-o, ELF, or PE executables.
+
+The object file binary format should be designed to instantiate into atoms
+as fast as possible. The obvious way to do that is that the
+file format would be an array of atoms. The linker just mmaps in the file and
+looks at the header to see how many atoms there and instantiate that many atoms
+with the atom attribute information coming from that array. The trick is
+designing this in a way that can be extended as the Atom mode evolves and new
+attributes are added.
+
+
+In designing a textual format we want something easy for humans to read and
+easy for the linker to parse. Since an atom has lots of attributes most of
+which are usually just the default, we should define default values for
+every attribute so that those can be omitted from the text representation.
+One possile format is YAML. Here is the atoms for a simple hello world
+program expressed in YAML.
+
+
+---
+target-triple: x86_64-apple-darwin11
+source:
+
+atoms:
+ - name: _main
+ scope: linkage-unit
+ type: code
+ alignment:
+ power: 4
+ content: [ 55, 48, 89, e5, 48, 8d, 3d, 00, 00, 00, 00, 30, c0, e8, 00, 00,
+ 00, 00, 31, c0, 5d, c3 ]
+ fixups:
+ - offset: 07
+ kind: pcrel32
+ target: 2
+ - offset: 0E
+ kind: call32
+ target: _fprintf
+
+ - type: c-string
+ merge: by-content
+ content: [ 73, 5A, 00 ]
+
+...
+
+
+One big use for the textual format will be writing test cases. The Darwin
+linker test suite test cases are written mostly in C/C++ and a few assembly
+files. The use of C means the same test case can be compiled for different
+architectures. But writing test cases in C is problematic because the compiler
+may vary its output over time for its own optimization reasons which my
+inadvertently disable or break the linker feature trying to be tested. By
+writing test cases in the linkers own textual format, we can exactly specify
+every attribute of every atom and thus target specific linker logic.
+
+
+
+Around 2005 when Apple switched from using STABS to using DWARF for debug
+information, we made a design decision to have the linker ignore DWARF in
+.o files. This improves linking performance because the linker is not
+copying tons of debug info. Instead, the linker adds "debug notes" into
+output binary that contain the paths of the original .o files. During development
+the Darwin debugger will notice the debug notes and the load the dwarf
+debug information from the original object files. For release builds,
+a tool named dsymutil is run on the program. It finds the debug notes and
+then the original object files, then reads, merges and optimizes all the dwarf
+debug information into one .dSYM file which can be loaded by the debugger
+if needed.
+
+The current way DWARF is generated is that all debug information for all
+functions in a translation unit are merged and optimized into sections based
+on debug info kind. For instance the mapping of instructions to source line
+numbers for all functions is compressed and put in one section. This does not
+play well in an Atom based file format. One idea is to have the compiler
+emit some intermediate representation debug information (one which is
+partitioned per atom) into the Atom based file format. The linker could
+then have code to convert that intermediate debug into to final dwarf.
+This is still an open question.
+
+
+The current set of attributes defined for Atoms in the darwin linker
+were chosen to meet the requirements of developing code to run on iOS and
+Mac OS X. Below is a list of the attributes and their possible values.
+It may just require adding more values to support ELF and XCOFF. Or there
+may need to be new attributes added to capture new functionality.
+
+
+ - Name
+ - Size
+ - Section (I'd like to get rid of this)
+ - ContentType (currently some of this comes from section)
+
+ - code
+ - stub
+ - data
+ - zeroFill
+ - initializerPointer
+ - objc1Class
+ - objc2Class
+ - objcClassPointer
+ - objc2CategoryList
+ - non-lazy-pointer
+ - lazy-pointer
+ - constant
+ - literal4
+ - literal8
+ - literal16
+ - cstring
+ - cstringPointer
+ - utf16string
+ - CFString
+ - CFI
+ - LSDA
+
+
+ - Scope
+
+ - translationUnit (static functions)
+ - linkageUnit (visibility hidden)
+ - global
+
+
+ - DefinitionKind
+
+ - regular
+ - tentative (ANSI C feature)
+ - absolute (assembly code feature)
+ - proxy (stand-in for dynamic library symbol)
+
+
+ - Combine
+
+ - never
+ - byName (weak symbols)
+ - byContent (simple constants)
+ - byContentAndReferences (complex constants)
+
+
+ - SymbolTableStatus
+
+ - In
+ - notIn (anonymous)
+ - inAsAbsolute (assembly code feature)
+ - inAndNeverStrip (tell strip tool to leave)
+ - inWithRandomName (mach-o .o feature)
+
+ - Alignment
+
+
- NeverDeadStrip (boolean)
+ - IsThumb (ARM specific)
+
+Where does dllexport fit in here? Where does visibility protected and
+internal fit? Protected seems like scope=global plus the rule to not
+indirect references to it. Internal is like hidden plus enables some
+compiler optimizations. I'm not sure the linker needs to know about internal.
+
+
+
+
+
diff --git a/ld64-134.9/doc/man/man1/dyldinfo.1 b/ld64-134.9/doc/man/man1/dyldinfo.1
new file mode 100644
index 0000000..92deb13
--- /dev/null
+++ b/ld64-134.9/doc/man/man1/dyldinfo.1
@@ -0,0 +1,53 @@
+.Dd November 10, 2010
+.Dt dyldinfo 1
+.Os Darwin
+.Sh NAME
+.Nm dyldinfo
+.Nd "Displays information used by dyld in an executable"
+.Sh SYNOPSIS
+.Nm
+.Op Fl arch Ar arch-name
+.Op Fl dylibs
+.Op Fl rebase
+.Op Fl bind
+.Op Fl weak_bind
+.Op Fl lazy_bind
+.Op Fl export
+.Op Fl opcodes
+.Op Fl function_starts
+.Ar file(s)
+.Sh DESCRIPTION
+Executables built for Mac OS X 10.6 and later have a new format for the
+information in the __LINKEDIT segment. The dyldinfo tool will display
+that information.
+.Pp
+The options are as follows:
+.Bl -tag -width indent
+.It Fl arch Ar arch
+Only display the specified architecture. Other architectures in a universal image are ignored.
+.It Fl dylibs
+Display the table of dylibs on which this image depends.
+.It Fl rebase
+Display the table of rebasing information. Rebasing is what dyld does when an image is
+not loaded at its preferred address. Typically, this involves updating pointers in the __DATA
+segment which point within the image.
+.It Fl bind
+Display the table of binding information. These are the symbolic fix ups that dyld must
+do when an image is loaded.
+.It Fl weak_bind
+Display the table of weak binding information. Typically, only C++ progams will have any
+weak binding. These are symbols which dyld must unique accross all images.
+.It Fl lazy_bind
+Display the table of lazy binding information. These are symbols which dyld delays binding
+until they are first used. Lazy binding is automatically used for all function calls to
+functions in some external dylib.
+.It Fl export
+Display the table symbols which this image exports.
+.It Fl opcodes
+Display the low level opcodes used to encode all rebase and binding information.
+.It Fl function_starts
+Decodes the list of function start addresses.
+.El
+.Sh SEE ALSO
+.Xr otool 1
+.Xr nm 1
diff --git a/ld64-134.9/doc/man/man1/ld.1 b/ld64-134.9/doc/man/man1/ld.1
new file mode 100644
index 0000000..a0850f6
--- /dev/null
+++ b/ld64-134.9/doc/man/man1/ld.1
@@ -0,0 +1,787 @@
+.Dd March 7, 2011
+.Dt ld 1
+.Os Darwin
+.Sh NAME
+.Nm ld
+.Nd "linker"
+.Sh SYNOPSIS
+.Nm
+files...
+.Op options
+.Op Fl o Ar outputfile
+.Sh DESCRIPTION
+The
+.Nm ld
+command combines several object files and libraries, resolves references, and
+produces an ouput file.
+.Nm ld
+can produce a final linked image (executable, dylib, or bundle), or with the -r
+option, produce another object file. If the -o option is not used, the output
+file produced is named "a.out".
+.Ss Universal
+The linker accepts universal (multiple-architecture) input files, but
+always creates a "thin" (single-architecture), standard Mach-O output file.
+The architecture for the output file is specified using the -arch option.
+If this option is not used,
+.Nm ld
+attempts to determine the output architecture by examining the object
+files in command line order. The first "thin"
+architecture determines that of the output file. If no input
+object file is a "thin" file, the native 32-bit architecture for the host is used.
+.Pp
+Usually,
+.Nm ld
+is not used directly. Instead the
+.Xr gcc(1)
+compiler driver invokes
+.Nm ld.
+The compiler driver can be passed multiple -arch options and it will create a
+universal final linked image by invoking
+.Nm ld
+multiple times and then running
+.Xr lipo(1)
+merge the outputs into a universal file.
+.Ss Layout
+The object files are loaded in the order in which they are specified on the
+command line. The segments and the sections in those segments will appear in
+the output file in the order they are encountered in the object files being linked.
+All zero fill sections will appear after all non-zero fill sections in their segments.
+Sections created from files with the -sectcreate option will be laid out at after
+sections from .o files. The use of the -order_file option will alter the layout
+rules above, and move the symbols specified to start of their section.
+.Ss Libraries
+A static library (aka static archive) is a collection of .o files with a table of contents
+that lists the global symbols in the .o files.
+.Nm ld
+will only pull .o files out of a static library if needed to resolve some symbol reference.
+Unlike traditional linkers,
+.Nm ld
+will continually search a static library while linking. There is no need to specify a static
+library multiple times on the command line.
+.Pp
+A dynamic library (aka dylib or framework) is a final linked image. Putting a dynamic
+library on the command line causes two things: 1) The generated final linked image
+will have encoded that it depends on that dynamic library. 2) Exported symbols from the
+dynamic library are used to resolve references.
+.Pp
+Both dynamic and static libraries are searched as they appear on the command line.
+.Ss Search paths
+.Nm ld
+maintains a list of directories to search for a library or framework to use. The default
+library search path is /usr/lib then /usr/local/lib. The -L option will add a new library search
+path. The default framework search path is /Library/Frameworks then /System/Library/Frameworks.
+(Note: previously, /Network/Library/Frameworks was at the end of the default path. If you need
+that functionality, you need to explicitly add -F/Network/Library/Frameworks).
+The -F option will a new framework search path. The -Z option will remove
+the standard search paths. The -syslibroot option will prepend a prefix to all search
+paths.
+.Ss Two-level namespace
+By default all references resolved to a dynamic library record the library to which
+they were resolved. At runtime, dyld uses that information to directly resolve
+symbols. The alternative is to use the -flat_namespace option. With flat namespace,
+the library is not recorded. At runtime, dyld will search each dynamic library in load
+order when resolving symbols. This is slower, but more like how other operating systems
+resolve symbols.
+.Ss Indirect dynamic libraries
+If the command line specifies to link against dylib A, and when dylib A was built it linked
+against dylib B, then B is considered an indirect dylib.
+When linking for two-level namespace, ld does not look at indirect dylibs, except when
+re-exported by a direct dylibs. On the other hand when linking for flat namespace,
+ld does load all indirect dylibs and uses them to resolve references.
+Even though indirect dylibs are specified via a full path,
+.Nm ld
+first uses the specified search paths to locate each indirect dylib. If one cannot
+be found using the search paths, the full path is used.
+.Ss Dynamic libraries undefines
+When linking for two-level namespace,
+.Nm ld
+does not verify that undefines in dylibs actually
+exist. But when linking for flat namespace,
+.Nm ld
+does check that all undefines from all loaded dylibs have a matching definition.
+This is sometimes used to force selected functions to be loaded from a static library.
+.Sh OPTIONS
+.Ss Options that control the kind of output
+.Bl -tag
+.It Fl execute
+The default. Produce a mach-o main executable that has file type MH_EXECUTE.
+.It Fl dylib
+Produce a mach-o shared library that has file type MH_DYLIB.
+.It Fl bundle
+Produce a mach-o bundle that has file type MH_BUNDLE.
+.It Fl r
+Merges object files to produce another mach-o object file with file type MH_OBJECT.
+.It Fl dylinker
+Produce a mach-o dylinker that has file type MH_DYLINKER. Only used when building dyld.
+.It Fl dynamic
+The default. Implied by -dylib, -bundle, or -execute
+.It Fl static
+Produces a mach-o file that does not use the dyld. Only used building the kernel.
+.It Fl arch Ar arch_name
+Specifies which architecture (e.g. ppc, ppc64, i386, x86_64) the output file should be.
+.It Fl o Ar path
+Specifies the name and location of the output file. If not specified, `a.out' is used.
+.El
+.Ss Options that control libraries
+.Bl -tag
+.It Fl l Ns x
+This option tells the linker to search for libx.dylib or libx.a in the library search path.
+If string x is of the form y.o, then that file is searched for in the same places, but without
+prepending `lib' or appending `.a' or `.dylib' to the filename.
+.It Fl weak-l Ns Ar x
+This is the same as the -lx but forces the library and all references to it to be marked as weak imports.
+That is, the library is allowed to be missing at runtime.
+.It Fl weak_library Ar path_to_library
+This is the same as listing a file name path to a library on the link line except that it forces the
+library and all references to it to be marked as weak imports.
+.It Fl reexport-l Ns Ar x
+This is the same as the -lx but specifies that the all symbols in library x should be available to
+clients linking to the library being created. This was previously done with a separate -sub_library option.
+.It Fl reexport_library Ar path_to_library
+This is the same as listing a file name path to a library on the link line and it specifies that the
+all symbols in library path should be available to clients linking to the library being created.
+This was previously done with a separate -sub_library option.
+.It Fl lazy-l Ns Ar x
+This is the same as the -lx but it is only for shared libraries and the linker
+will construct glue code so that the shared library is not loaded until
+the first function in it is called.
+.It Fl lazy_library Ar path_to_library
+This is the same as listing a file name path to a shared library on the link line
+except that the linker will construct glue code so that the shared library is not
+loaded until the first function in it is called.
+.It Fl upward-l Ns Ar x
+This is the same as the -lx but specifies that the dylib is an upward dependency.
+.It Fl upward_library Ar path_to_library
+This is the same as listing a file name path to a library on the link line but also marks
+the dylib as an upward dependency.
+.It Fl L Ns dir
+Add
+.Ar dir
+to the list of directories in which to search for libraries.
+Directories specified with -L are searched in the order they appear on the command line
+and before the default search path. In Xcode4 and later, there can be a space between
+the -L and directory.
+.It Fl Z
+Do not search the standard directories when searching for libraries and frameworks.
+.It Fl syslibroot Ar rootdir
+Prepend
+.Ar rootdir
+to all search paths when searching for libraries or frameworks.
+.It Fl search_paths_first
+This is now the default (in Xcode4 tools). When processing -lx the linker now searches each directory
+in its library search paths for `libx.dylib' then `libx.a' before the moving on to the next path
+in the library search path.
+.It Fl search_dylibs_first
+Changes the searching behavior for libraries. The default is that when processing -lx the linker
+searches each directory in its library search paths for `libx.dylib' then `libx.a'.
+This option changes the behavior to first search for a file of the form `libx.dylib' in each directory
+in the library search path, then a file of the form `libx.a' is searched for in the library search paths.
+This option restores the search behavior of the linker prior to Xcode4.
+.It Fl framework Ar name[,suffix]
+This option tells the linker to search for `name.framework/name' the framework search path.
+If the optional suffix is specified the framework is first searched for the name with the suffix and then without
+(e.g. look for `name.framework/name_suffix' first, if not there try `name.framework/name').
+.It Fl weak_framework Ar name[,suffix]
+This is the same as the -framework name[,suffix] but forces the framework and all
+references to it to be marked as weak imports.
+.It Fl reexport_framework Ar name[,suffix]
+This is the same as the -framework name[,suffix] but also specifies that the
+all symbols in that framework should be available to clients linking to the library being created.
+This was previously done with a separate -sub_umbrella option.
+.It Fl lazy_framework Ar name[,suffix]
+This is the same as the -framework name[,suffix] except that the linker will
+construct glue code so that the framework is not
+loaded until the first function in it is called. You cannot directly access
+data or Objective-C classes in a framework linked this way.
+.It Fl upward_framework Ar name[,suffix]
+This is the same as the -framework name[,suffix] but also specifies that the
+framework is an upward dependency.
+.It Fl F Ns dir
+Add
+.Ar dir
+to the list of directories in which to search for frameworks.
+Directories specified with -F are searched in the order they appear on the command line
+and before the default search path. In Xcode4 and later, there can be a space between
+the -F and directory.
+.It Fl all_load
+Loads all members of static archive libraries.
+.It Fl ObjC
+Loads all members of static archive libraries that implement an Objective-C class or category.
+.It Fl force_load Ar path_to_archive
+Loads all members of the specified static archive library. Note: -all_load forces all members of all
+archives to be loaded. This option allows you to target a specific archive.
+.El
+.Ss Options that control additional content
+.Bl -tag
+.It Fl sectcreate Ar segname sectname file
+The section
+.Ar sectname
+in the segment
+.Ar segname
+is created from the contents of file
+.Ar file.
+The combination of segname and sectname must be unique Ð there cannot already be a section (segname,sectname)
+from any other input.
+.It Fl filelist Ar file[,dirname]
+Specifies that the linker should link the files listed in
+.Ar file .
+This is an alternative to listing the files on the command line.
+The file names are listed one per line separated only by newlines. (Spaces and tabs are assumed to be part of the file name.)
+If the optional directory name,
+.Ar dirname
+is specified, it is prepended to each name in the list file.
+.It Fl dtrace Ar file
+Enables dtrace static probes when producing a final linked image. The file
+.Ar file
+must be a DTrace script which declares the static probes.
+.El
+.Ss Options that control optimizations
+.Bl -tag
+.It Fl dead_strip
+Remove functions and data that are unreachable by the entry point or exported symbols.
+.It Fl order_file Ar file
+Alters the order in which functions and data are laid out. For each section in the output file,
+any symbol in that section that are specified in the order file
+.Ar file
+is moved to the start of its section and laid out in the same order as in the order file
+.Ar file .
+Order files are text files with one symbol name per line. Lines starting with a # are comments.
+A symbol name may be optionally preceded with its object file leaf name and a colon (e.g. foo.o:_foo).
+This is useful for static functions/data that occur in multiple files.
+A symbol name may also be optionally preceded with the architecture (e.g. ppc:_foo or ppc:foo.o:_foo).
+This enables you to have one order file that works for multiple architectures.
+Literal c-strings may be ordered by by quoting the string (e.g. "Hello, world\\n") in the order file.
+.It Fl no_order_inits
+When the -order_file option is not used, the linker lays out functions in object file order and
+it moves all initializer routines to the start of the __text section and terminator routines
+to the end. Use this option to disable the automatic rearrangement of initializers and terminators.
+.It Fl no_order_data
+By default the linker reorders global data in the __DATA segment so that all global variables that
+dyld will need to adjust at launch time will early in the __DATA segment. This reduces the number
+of dirty pages at launch time. This option disables that optimization.
+.It Fl macosx_version_min Ar version
+This is set to indicate the oldest Mac OS X version that that the output is to be used on. Specifying
+a later version enables the linker to assumes features of that OS in the output file. The format of
+.Ar version
+is a Mac OS X version number such as 10.4 or 10.5
+.It Fl ios_version_min Ar version
+This is set to indicate the oldest iOS version that that the output is to be used on. Specifying
+a later version enables the linker to assumes features of that OS in the output file. The format of
+.Ar version
+is an iOS version number such as 3.1 or 4.0
+.It Fl image_base Ar address
+Specifies the perferred load address for a dylib or bundle. The argument
+.Ar address
+is a hexadecimal number with an optional leading 0x. By choosing non-overlapping address for all
+dylibs and bundles that a program loads, launch time can be improved because dyld will not need to
+"rebase" the image (that is, adjust pointers within the image to work at the loaded address).
+It is often easier to not use this option, but instead use the rebase(1) tool, and give it a list of dylibs.
+It will then choose non-overlapping addresses for the list and rebase them all.
+This option is also called -seg1addr for compatibility.
+.It Fl no_implicit_dylibs
+When creating a two-level namespace final linked image, normally the linker will hoist up public dylibs
+that are implicitly linked to make the two-level namespace
+encoding more efficient for dyld. For example, Cocoa re-exports AppKit and AppKit re-exports Foundation.
+If you link with -framework Cocoa and use a symbol from Foundation, the linker will implicitly add a load
+command to load Foundation and encode the symbol as coming from Foundation. If you use this option,
+the linker will not add a load command for Foundation and encode the symbol as coming from Cocoa. Then
+at runtime dyld will have to search Cocoa and AppKit before finding the symbol in Foundation.
+.It Fl exported_symbols_order Ar file
+When targeting Mac OS X 10.6 or later, the format of the exported symbol information can be optimized to
+make lookups of popular symbols faster. This option is used to pass a file containing a list of
+the symbols most frequently used by clients of the dynamic library being built. Not all exported symbols
+need to be listed.
+.It Fl no_zero_fill_sections
+By default the linker moves all zero fill sections to the end of the __DATA segment and configures
+them to use no space on disk. This option suppresses that optimization, so zero-filled data occupies
+space on disk in a final linked image.
+.It Fl merge_zero_fill_sections
+Causes all zero-fill sections in the __DATA segment to be merged into one __zerofill section.
+.El
+.Ss Options when creating a dynamic library (dylib)
+.Bl -tag
+.It Fl install_name Ar name
+Sets an internal "install path" (LC_ID_DYLIB) in a dynamic library. Any clients linked against the library
+will record that path as the way dyld should locate this library. If this option is not specified, then
+the -o path will be used. This option is also called -dylib_install_name for compatibility.
+.It Fl mark_dead_strippable_dylib
+Specifies that the dylib being built can be dead strip by any client. That is, the dylib has
+no initialization side effects. So if a client links against the dylib, but never uses
+any symbol from it, the linker can optimize away the use of the dylib.
+.It Fl compatibility_version Ar number
+Specifies the compatibility version number of the library. When a library is loaded by dyld, the
+compatibility version is checked and if the program's version is greater that the library's version, it is an error.
+The format of
+.Ar number
+is X[.Y[.Z]] where X must be a positive non-zero number less than or equal to 65535,
+and .Y and .Z are optional and if present must be non-negative numbers less than or equal to 255.
+If the compatibility version number is not specified, it has a value of 0 and no checking is done when the library is used.
+This option is also called -dylib_compatibility_version for compatibility.
+.It Fl current_version Ar number
+Specifies the current version number of the library. The current version of the library can be obtained
+programmatically by the user of the library so it can determine exactly which version of the library it is using.
+The format of
+.Ar number
+is X[.Y[.Z]] where X must be a positive non-zero number less than or equal to 65535,
+and .Y and .Z are optional and if present must be non-negative numbers less than or equal to 255.
+If the version number is not specified, it has a value of 0.
+This option is also called -dylib_current_version for compatibility.
+.El
+.Ss Options when creating a main executable
+.Bl -tag
+.It Fl pie
+This makes a special kind of main executable that is position independent (PIE). On Mac OS X 10.5 and later, the OS
+the OS will load a PIE at a random address each time it is executed. You cannot create a PIE from .o files compiled
+with -mdynamic-no-pic. That means the codegen is less optimal, but the address randomization adds some
+security. When targeting Mac OS X 10.7 or later PIE is the default for main executables.
+.It Fl no_pie
+Do not make a position independent executable (PIE). This is the default, when targeting 10.6 and earlier.
+.It Fl pagezero_size Ar size
+By default the linker creates an unreadable segment starting at address zero named __PAGEZERO. Its existence
+will cause a bus error if a NULL pointer is dereferenced. The argument
+.Ar size
+is a hexadecimal number with an optional leading 0x. If
+.Ar size
+is zero, the linker will not generate a page zero segment. By default on 32-bit architectures the page zero size
+is 4KB. On 64-bit architectures, the default size is 4GB. The ppc64 architecture has some special cases. Since Mac
+OS X 10.4 did not support 4GB page zero programs, the default page zero size for ppc64 will be 4KB unless
+-macosx_version_min is 10.5 or later. Also, the -mdynamic-no-pic codegen model for ppc64 will only work if the
+code is placed in the lower 2GB of the address space, so the if the linker detects any such code, the page zero
+size is set to 4KB and then a new unreadable trailing segment is created after the code, filling up the lower 4GB.
+.It Fl stack_size Ar size
+Specifies the maximum stack size for the main thread in a program. Without this option a program has a 8MB stack.
+The argument
+.Ar size
+is a hexadecimal number with an optional leading 0x. The
+.Ar size
+should be an even multiple of 4KB, that is the last three hexadecimal digits should be zero.
+.It Fl allow_stack_execute
+Marks executable so that all stacks in the task will be given stack execution privilege. This includes pthread stacks.
+.El
+.Ss Options when creating a bundle
+.Bl -tag
+.It Fl bundle_loader Ar executable
+This specifies the
+.Ar executable
+that will be loading the bundle output file being linked.
+Undefined symbols from the bundle are checked against the specified
+.Ar executable
+like it was one of the
+dynamic libraries the bundle was linked with.
+.El
+.Ss Options when creating an object file
+.Bl -tag
+.It Fl keep_private_externs
+Don't turn private external (aka visibility=hidden) symbols into static symbols,
+but rather leave them as private external in the resulting object file.
+.It Fl d
+Force definition of common symbols. That is, transform tentative definitions into real definitions.
+.El
+.Ss Options that control symbol resolution
+.Bl -tag
+.It Fl exported_symbols_list Ar filename
+The specified
+.Ar filename
+contains a list of global symbol names that will remain as global symbols in the output file.
+All other global symbols will be treated as if they were marked as __private_extern__ (aka visibility=hidden)
+and will not be global in the output file. The symbol names listed in filename must be one per line.
+Leading and trailing white space are not part of the symbol name.
+Lines starting with # are ignored, as are lines with only white space.
+Some wildcards (similar to shell file matching) are supported. The * matches zero or more characters.
+The ? matches one character. [abc] matches one character which must be an 'a', 'b', or 'c'. [a-z] matches
+any single lower case letter from 'a' to 'z'.
+.It Fl exported_symbol Ar symbol
+The specified
+.Ar symbol
+is added to the list of global symbols names that will remain as global symbols in the output file. This
+option can be used multiple times. For short lists, this can be more convenient than creating a file and using
+-exported_symbols_list.
+.It Fl unexported_symbols_list Ar file
+The specified
+.Ar filename
+contains a list of global symbol names that will not remain as global symbols in the output file.
+The symbols will be treated as if they were marked as __private_extern__ (aka visibility=hidden) and will not be global
+in the output file. The symbol names listed in filename must be one per line.
+Leading and trailing white space are not part of the symbol name.
+Lines starting with # are ignored, as are lines with only white space.
+Some wildcards (similar to shell file matching) are supported. The * matches zero or more characters.
+The ? matches one character. [abc] matches one character which must be an 'a', 'b', or 'c'. [a-z] matches
+any single lower case letter from 'a' to 'z'.
+.It Fl unexported_symbol Ar symbol
+The specified
+.Ar symbol
+is added to the list of global symbols names that will not remain as global symbols in the output file. This
+option can be used multiple times. For short lists, this can be more convenient than creating a file and using
+-unexported_symbols_list.
+.It Fl reexported_symbols_list Ar file
+The specified
+.Ar filename
+contains a list of symbol names that are implemented in a dependent dylib and should be re-exported
+through the dylib being created.
+.It Fl alias Ar symbol_name Ar alternate_symbol_name
+Create an alias named
+.Ar alternate_symbol_name
+for the symbol
+.Ar symbol_name .
+By default the alias symbol has global visibility. This option was previous the -idef:indir option.
+.It Fl alias_list Ar filename
+The specified
+.Ar filename
+contains a list of aliases. The symbol name and its alias are on one line, separated by whitespace.
+Lines starting with # are ignored.
+.It Fl flat_namespace
+Alters how symbols are resolved at build time and runtime. With -two_levelnamespace (the default), the linker
+only searches dylibs on the command line for symbols, and records in which dylib they were found. With -flat_namespace,
+the linker searches all dylibs on the command line and all dylibs those original dylibs depend on. The linker
+does not record which dylib an external symbol came from, so at runtime dyld again searches all images and uses
+the first definition it finds. In addition, any undefines in loaded flat_namespace dylibs must be resolvable
+at build time.
+.It Fl u Ar symbol_name
+Specified that symbol
+.Ar symbol_name
+must be defined for the link to succeed. This is useful to force selected functions to be loaded
+from a static library.
+.It Fl U Ar symbol_name
+Specified that it is ok for
+.Ar symbol_name
+to have no definition. With -two_levelnamespace, the resulting symbol will be marked dynamic_lookup which
+means dyld will search all loaded images.
+.It Fl undefined Ar treatment
+Specifies how undefined symbols are to be treated. Options are: error, warning, suppress, or dynamic_lookup. The
+default is error.
+.It Fl rpath Ar path
+Add
+.Ar path
+to the runpath search path list for image being created. At runtime, dyld uses the runpath when searching
+for dylibs whose load path begins with @rpath/.
+.It Fl commons Ar treatment
+Specifies how commons (aka tentative definitions) are resolved with respect to dylibs. Options are:
+ignore_dylibs, use_dylibs, error. The default is ignore_dylibs which means the linker will turn a tentative
+definition in an object file into a real definition and not even check dylibs for conflicts. The dylibs
+option means the linker should check linked dylibs for definitions and use them to replace tentative definitions
+from object files. The error option means the linker should issue an error whenever a tentative definition in an
+object file conflicts with an external symbol in a linked dylib. See also -warn_commons.
+.El
+.Ss Options for introspecting the linker
+.Bl -tag
+.It Fl why_load
+Log why each object file in a static library is loaded. That is, what symbol was needed. Also called -whyload
+for compatibility.
+.It Fl why_live Ar symbol_name
+Logs a chain of references to
+.Ar symbol_name .
+Only applicable with -dead_strip .
+It can help debug why something that you think should be dead strip removed is not removed.
+.It Fl print_statistics
+Logs information about the amount of memory and time the linker used.
+.It Fl t
+Logs each file (object, archive, or dylib) the linker loads. Useful for debugging problems with search paths where the wrong library is loaded.
+.It Fl whatsloaded
+Logs just object files the linker loads.
+.It Fl order_file_statistics
+Logs information about the processing of a -order_file.
+.It Fl map Ar map_file_path
+Writes a map file to the specified path which details all symbols and their addresses in the output image.
+.El
+.Ss Options for controling symbol table optimizations
+.Bl -tag
+.It Fl S
+Do not put debug information (STABS or DWARF) in the output file.
+.It Fl x
+Do not put non-global symbols in the output file's symbol table. Non-global symbols are useful when debugging and
+getting symbol names in back traces, but are not used at runtime. If -x is used with -r
+non-global symbol names are not removed, but instead replaced with a unique, dummy name
+that will be automatically removed when linked into a final linked image. This
+allows dead code stripping, which uses symbols to break up code and data, to
+work properly and provides the security of having source symbol names removed.
+.It Fl non_global_symbols_strip_list Ar filename
+The specified
+.Ar filename
+contains a list of non-global symbol names that should be removed from the output file's symbol table. All other
+non-global symbol names will remain in the output files symbol table. See -exported_symbols_list for syntax and use
+of wildcards.
+.It Fl non_global_symbols_no_strip_list Ar filename
+The specified
+.Ar filename
+contains a list of non-global symbol names that should be remain in the output file's symbol table. All other
+symbol names will be removed from the output file's symbol table. See -exported_symbols_list for syntax and use
+of wildcards.
+.El
+.Ss Rarely used Options
+.Bl -tag
+.It Fl v
+Prints the version of the linker.
+.It Fl allow_heap_execute
+Normally i386 main executables will be marked so that the Mac OS X 10.7 and later kernel
+will only allow pages with the x-bit to execute instructions. This option overrides that
+behavior and allows instructions on any page to be executed.
+.It Fl fatal_warnings
+Causes the linker to exit with a non-zero value if any warnings were emitted.
+.It Fl no_eh_labels
+Normally in -r mode, the linker produces .eh labels on all FDEs in the __eh_frame section.
+This option suppresses those labels. Those labels are not needed by the Mac OS X 10.6
+linker but are needed by earlier linker tools.
+.It Fl warn_compact_unwind
+When producing a final linked image, the linker processes the __eh_frame section and
+produces an __unwind_info section. Most FDE entries in the __eh_frame can be represented
+by a 32-bit value in the __unwind_info section. The option issues a warning for
+any function whose FDE cannot be expressed in the compact unwind format.
+.It Fl warn_weak_exports
+Issue a warning if the resulting final linked image contains weak external symbols. Such
+symbols require dyld to do extra work at launch time to coalesce those symbols.
+.It Fl objc_gc_compaction
+Marks the Objective-C image info in the final linked image with the bit that says that the
+code was built to work the compacting garbage collection.
+.It Fl objc_gc
+Verifies all code was compiled with -fobjc-gc or -fobjc-gc-only.
+.It Fl objc_gc_only
+Verifies all code was compiled with -fobjc-gc-only.
+.It Fl dead_strip_dylibs
+Remove dylibs that are unreachable by the entry point or exported symbols. That is,
+suppresses the generation of load command commands for dylibs which supplied no
+symbols during the link. This option should not be used when linking against a dylib which
+is required at runtime for some indirect reason such as the dylib has an important initializer.
+.It Fl allow_sub_type_mismatches
+Normally the linker considers different cpu-subtype for ARM (e.g. armv4t and armv6) to be different
+different architectures that cannot be mixed at build time. This option relaxes that requirement,
+allowing you to mix object files compiled for different ARM subtypes.
+.It Fl no_uuid
+Do not generate an LC_UUID load command in the output file.
+.It Fl root_safe
+Sets the MH_ROOT_SAFE bit in the mach header of the output file.
+.It Fl setuid_safe
+Sets the MH_SETUID_SAFE bit in the mach header of the output file.
+.It Fl interposable
+Indirects access to all to exported symbols when creating a dynamic library.
+.It Fl init Ar symbol_name
+The specified symbol_name will be run as the first initializer. Only used when creating a dynamic library.
+.It Fl sub_library Ar library_name
+The specified dylib will be re-exported. For example the library_name for /usr/lib/libobjc_profile.A.dylib would be libobjc.
+Only used when creating a dynamic library.
+.It Fl sub_umbrella Ar framework_name
+The specified framework will be re-exported. Only used when creating a dynamic library.
+.It Fl allowable_client Ar name
+Restricts what can link against the dynamic library being created. By default any code
+can link against any dylib. But if a dylib is supposed to be private to a small
+set of clients, you can formalize that by adding a -allowable_client for each client.
+If a client is libfoo.1.dylib its -allowable_client name would be "foo". If a
+client is Foo.framework its -allowable_client name would be "Foo". For the degenerate
+case where you want no one to ever link against a dylib, you can set the
+-allowable_client to "!".
+.It Fl client_name Ar name
+Enables a bundle to link against a dylib that was built with -allowable_client.
+The name specified must match one of the -allowable_client names specified when the dylib was created.
+.It Fl umbrella Ar framework_name
+Specifies that the dylib being linked is re-exported through an umbrella framework of the specified name.
+.It Fl headerpad Ar size
+Specifies the minimum space for future expansion of the load commands. Only useful if intend to run
+install_name_tool to alter the load commands later. Size is a hexadecimal number.
+.It Fl headerpad_max_install_names
+Automatically adds space for future expansion of load commands such that all paths could expand to MAXPATHLEN.
+Only useful if intend to run install_name_tool to alter the load commands later.
+.It Fl bind_at_load
+Sets a bit in the mach header of the resulting binary which tells dyld to bind all symbols when the binary is loaded, rather than lazily.
+.It Fl force_flat_namespace
+Sets a bit in the mach header of the resulting binary which tells dyld to not only use flat namespace for the binary,
+but force flat namespace binding on all dylibs and bundles loaded in the process. Can only be used when linking main executables.
+.It Fl sectalign Ar segname Ar sectname Ar value
+The section named sectname in the segment segname will have its alignment set to value, where value is a hexadecimal
+number that must be an integral power of 2.
+.It Fl stack_addr Ar address
+Specifies the initial address of the stack pointer value, where value is a hexadecimal number rounded to a page boundary.
+.It Fl segprot Ar segname Ar max_prot Ar init_prot
+Specifies the maximum and initial virtual memory protection of the named segment, name, to be max and init ,respectively.
+The values for max and init are any combination of the characters `r' (for read), `w' (for write), `x' (for execute) and `-' (no access).
+.It Fl seg_addr_table Ar filename
+Specifies a file containing base addresses for dynamic libraries. Each line of the file is a hexadecimal base address
+followed by whitespace then the install name of the corresponding dylib. The # character denotes a comment.
+.It Fl segs_read_write_addr Ar address
+Allows a dynamic library to be built where the read-only and read-write segments are not contiguous. The address
+specified is a hexadecimal number that indicates the base address for the read-write segments.
+.It Fl segs_read_only_addr Ar address
+Allows a dynamic library to be built where the read-only and read-write segments are not contiguous. The address
+specified is a hexadecimal number that indicates the base address for the read-only segments.
+.It Fl segaddr Ar name Ar address
+Specifies the starting address of the segment named name to be address. The address must be a hexadecimal number
+that is a multiple of 4K page size.
+.It Fl seg_page_size Ar name Ar size
+Specifies the page size used by the specified segment. By default the page size is 4096 for all segments.
+The linker will lay out segments such that size of a segment is always an even multiple of its page size.
+.It Fl dylib_file Ar install_name:file_name
+Specifies that a dynamic shared library is in a different location than its standard location. Use this option
+when you link with a library that is dependent on a dynamic library, and the dynamic library is in a location other
+than its default location. install_name specifies the path where the library normally resides. file_name specifies
+the path of the library you want to use instead. For example, if you link to a library that depends upon the dynamic
+library libsys and you have libsys installed in a nondefault location, you would use this option:
+-dylib_file /lib/libsys_s.A.dylib:/me/lib/libsys_s.A.dylib.
+.It Fl prebind
+The created output file will be in the prebound format. This was used in Mac OS X 10.3 and earlier to improve launch performance.
+.It Fl weak_reference_mismatches Ar treatment
+Specifies what to do if a symbol is weak-imported in one object file but not weak-imported in another. The valid
+treatments are: error, weak, or non-weak. The default is non-weak.
+.It Fl read_only_relocs Ar treatment
+Enables the use of relocations which will cause dyld to modify (copy-on-write) read-only pages. The compiler will
+normally never generate such code.
+.It Fl force_cpusubtype_ALL
+The is only applicable with -arch ppc. It tells the linker to ignore the PowerPC cpu requirements (e.g. G3, G4 or G5) encoded
+in the object files and mark the resulting binary as runnable on any PowerPC cpu.
+.It Fl dylinker_install_name Ar path
+Only used when building dyld.
+.It Fl no_arch_warnings
+Suppresses warning messages about files that have the wrong architecture for the -arch flag
+.It Fl arch_errors_fatal
+Turns into errors, warnings about files that have the wrong architecture for the -arch flag.
+.It Fl e Ar symbol_name
+Specifies the entry point of a main executable. By default the entry name is "start" which is found in crt1.o which contains
+the glue code need to set up and call main().
+.It Fl w
+Suppress all warning messages
+.It Fl final_output Ar name
+Specifies the install name of a dylib if -install_name is not used. This option is used by gcc driver when it is invoked
+with multiple -arch arguments.
+.It Fl arch_multiple
+Specifes that the linker should augment error and warning messages with the architecture name. This option is used by gcc
+driver when it is invoked with multiple -arch arguments.
+.It Fl twolevel_namespace_hints
+Specifies that hints should be added to the resulting binary that can help speed up runtime binding by dyld as long as the
+libraries being linked against have not changed.
+.It Fl dot Ar path
+Create a file at the specified path containing a graph of symbol dependencies. The .dot file can be viewed in GraphViz.
+.It Fl keep_relocs
+Add section based relocation records to a final linked image. These relocations are ignored at runtime by dyld.
+.It Fl warn_stabs
+Print a warning when the linker cannot do a BINCL/EINCL optimization because the compiler put a bad stab symbol inside
+a BINCL/EINCL range.
+.It Fl warn_commons
+Print a warning whenever the a tentative definition in an object file is found and a external symbol by the same name
+is also found in a linked dylib. This often means that the extern keyword is missing from a variable declaration
+in a header file.
+.It Fl read_only_stubs
+[i386 only] Makes the __IMPORT segment of a final linked images read-only. This option makes a program slightly more
+secure in that the JMP instructions in the i386 fast stubs cannot be easily overwritten by malicious code. The downside
+is the dyld must use mprotect() to temporarily make the segment writable while it is binding the stubs.
+.It Fl slow_stubs
+[i386 only] Instead of using single JMP instruction stubs, the linker creates code in the __TEXT segment which
+calls through a lazy pointer in the __DATA segment.
+.It Fl interposable_list Ar filename
+The specified
+.Ar filename
+contains a list of global symbol names that should always be accessed indirectly. For instance, if libSystem.dylib
+is linked such that _malloc is interposable, then calls to malloc() from within libSystem will go through a dyld
+stub and could potentially indirected to an alternate malloc. If libSystem.dylib were built without making _malloc
+interposable then if _malloc was interposed at runtime, calls to malloc from with libSystem would be missed
+(not interposed) because they would be direct calls.
+.It Fl no_function_starts
+By default the linker creates a compress table of function start addresses in the LINKEDIT of
+final linked image. This option disables that behavior.
+.It Fl no_version_load_command
+By default the linker creates a load command in final linked images that contains the -macosx_version_min.
+This option disables that behavior.
+.It Fl no_objc_category_merging
+By default when producing final linked image, the linker will optimize Objective-C classes by merging
+any categories on a class into the class. Both the class and its categories must be defined in the image
+being linked for the optimization to occur. Using this option disables that behavior.
+.It Fl object_path_lto Ar filename
+When performing Link Time Optimization (LTO) and a temporary mach-o object file is needed, if this
+option is used, the temporary file will be stored at the specified path and remain after the link
+is complete. Without the option, the linker picks a path and deletes the object file before the linker
+tool completes, thus tools such as the debugger or dsymutil will not be able to access the DWARF debug
+info in the temporary object file.
+.It Fl page_align_data_atoms
+During development, this option can be used to space out all global variables so each is on a separate page.
+This is useful when analyzing dirty and resident pages. The information can then be used to create an
+order file to cluster commonly used/dirty globals onto the same page(s).
+.El
+.Ss Obsolete Options
+.Bl -tag
+.It Fl segalign Ar value
+All segments must be page aligned. This option is obsolete.
+.It Fl seglinkedit
+Object files (MH_OBJECT) with a LINKEDIT segment are no longer supported. This option is obsolete.
+.It Fl noseglinkedit
+This is the default. This option is obsolete.
+.It Fl fvmlib
+Fixed VM shared libraries (MH_FVMLIB) are no longer supported. This option is obsolete.
+.It Fl preload
+Preload executables (MH_PRELOAD) are no longer supported. This option is obsolete.
+.It Fl sectobjectsymbols Ar segname Ar sectname
+Adding a local label at a section start is no longer supported. This option is obsolete.
+.It Fl nofixprebinding
+The MH_NOFIXPREBINDING bit of mach_headers has been ignored since Mac OS X 10.3.9. This option is obsolete.
+.It Fl noprebind_all_twolevel_modules
+Multi-modules in dynamic libraries have been ignored at runtime since Mac OS X 10.4.0. This option is obsolete.
+.It Fl prebind_all_twolevel_modules
+Multi-modules in dynamic libraries have been ignored at runtime since Mac OS X 10.4.0. This option is obsolete.
+.It Fl prebind_allow_overlap
+When using -prebind, the linker allows overlapping by default, so this option is obsolete.
+.It Fl noprebind
+LD_PREBIND is no longer supported as a way to force on prebinding, so there no longer needs to
+be a command line way to override LD_PREBIND. This option is obsolete.
+.It Fl sect_diff_relocs Ar treatment
+This option was an attempt to warn about linking .o files compiled without -mdynamic-no-pic into
+a main executable, but the false positive rate generated too much noise to make the option useful.
+This option is obsolete.
+.It Fl run_init_lazily
+This option was removed in Mac OS X 10.2.
+.It Fl single_module
+This is now the default so does not need to be specified.
+.It Fl multi_module
+Multi-modules in dynamic libraries have been ignored at runtime since Mac OS X 10.4.0. This option is obsolete.
+.It Fl no_dead_strip_inits_and_terms
+The linker never dead strips initialization and termination routines. They are considered "roots" of the dead strip graph.
+.It Fl A Ar basefile
+Obsolete incremental load format. This option is obsolete.
+.It Fl b
+Used with -A option to strip base file's symbols. This option is obsolete.
+..It Fl M
+Obsolete option to produce a load map. Use -map option instead.
+.It Fl Sn
+Don't strip any symbols. This is the default. This option is obsolete.
+.It Fl Si
+Optimize stabs debug symbols to remove duplicates. This is the default. This option is obsolete.
+.It Fl Sp
+Write minimal stabs which causes the debugger to open and read the original .o file for full stabs.
+This style of debugging is obsolete in Mac OS X 10.5. This option is obsolete.
+.It Fl X
+Strip local symbols that begin with 'L'. This is the default. This option is obsolete.
+.It Fl s
+Completely strip the output, including removing the symbol table. This file format variant is no longer supported.
+This option is obsolete.
+.It Fl m
+Don't treat multiple definitions as an error. This is no longer supported. This option is obsolete.
+.It Fl y Ns symbol
+Display each file in which
+.Ar symbol
+is used. This was previously used to debug where an undefined symbol was used, but the linker now
+automatically prints out all usages. The -why_live option can also be used to display what kept
+a symbol from being dead striped. This option is obsolete.
+.It Fl Y Ar number
+Used to control how many occurrences of each symbol specified with -y would be shown. This option is obsolete.
+.It Fl nomultidefs
+Only used when linking an umbrella framework. Sets the MH_NOMULTIDEFS bit in the mach_header. The MH_NOMULTIDEFS
+bit has been obsolete since Mac OS X 10.4. This option is obsolete.
+.It Fl multiply_defined_unused Ar treatment
+Previously provided a way to warn or error if any of the symbol definitions in the output file matched any
+definitions in dynamic library being linked. This option is obsolete.
+.It Fl multiply_defined Ar treatment
+Previously provided a way to warn or error if any of the symbols used from a dynamic library were also
+available in another linked dynamic library. This option is obsolete.
+.It Fl private_bundle
+Previously prevented errors when -flat_namespace, -bundle, and -bundle_loader were used and the bundle
+contained a definition that conflicted with a symbol in the main executable. The linker no longer
+errors on such conflicts. This option is obsolete.
+.It Fl noall_load
+This is the default. This option is obsolete.
+.It Fl seg_addr_table_filename Ar path
+Use
+.Ar path
+instead of the install name of the library for matching an entry in the seg_addr_table. This option is obsolete.
+.It Fl sectorder Ar segname sectname orderfile
+Replaced by more general -order_file option.
+.It Fl sectorder_detail
+Produced extra logging about which entries from a sectorder entries were used. Replaced by -order_file_statistics.
+This option is obsolete.
+.El
+.Sh SEE ALSO
+as(1), ar(1), cc(1), nm(1), otool(1) lipo(1),
+arch(3), dyld(3), Mach-O(5), strip(1), rebase(1)
diff --git a/ld64-134.9/doc/man/man1/ld64.1 b/ld64-134.9/doc/man/man1/ld64.1
new file mode 100644
index 0000000..615b0e5
--- /dev/null
+++ b/ld64-134.9/doc/man/man1/ld64.1
@@ -0,0 +1 @@
+.so man1/ld.1
diff --git a/ld64-134.9/doc/man/man1/rebase.1 b/ld64-134.9/doc/man/man1/rebase.1
new file mode 100644
index 0000000..6743a96
--- /dev/null
+++ b/ld64-134.9/doc/man/man1/rebase.1
@@ -0,0 +1,39 @@
+.Dd June 6, 2006
+.Dt rebase 1
+.Os Darwin
+.Sh NAME
+.Nm rebase
+.Nd "Changes base address of dylibs and bundles"
+.Sh SYNOPSIS
+.Nm
+.Op Fl low_address Ar addr
+.Op Fl high_address Ar addr
+.Op Fl arch Ar arch
+.Op Fl v
+.Ar file(s)
+.Sh DESCRIPTION
+The base address of an image (dylib or bundle) is the preferred address for it to be loaded. By
+default all images are built with a base address of zero. At runtime, if the
+preferred memory range is already occupied, dyld will "slide" the image to a new address range.
+There is a small cost to the slide, as dyld must do some fix ups.
+The rebase tool takes a list of images and adjust their base address to be non-overlapping. If no
+low or high address is specified, the a suitable address range is choosen for the architecture.
+.Pp
+The options are as follows:
+.Bl -tag -width indent
+.It Fl low_address Ar addr
+Force the base address for the first image to be
+.Ar addr
+(specified in hex). Each subsequent file gets the next available base address.
+.It Fl high_address Ar addr
+Force the base address for the last image to be such that when that image is loaded it occupies
+memory up to
+.Ar addr
+(specified in hex). Each preceeding file gets the previous available base address.
+.It Fl arch Ar arch
+Only rebase the specified architecture. Other architectures in a universal image are left as is.
+.It Fl v
+Verbose. Print information about rebasing done.
+.El
+.Sh SEE ALSO
+.Xr ld 1
diff --git a/ld64-134.9/doc/man/man1/unwinddump.1 b/ld64-134.9/doc/man/man1/unwinddump.1
new file mode 100644
index 0000000..3aefe93
--- /dev/null
+++ b/ld64-134.9/doc/man/man1/unwinddump.1
@@ -0,0 +1,22 @@
+.Dd November 7, 2008
+.Dt unwinddump 1
+.Os Darwin
+.Sh NAME
+.Nm unwinddump
+.Nd "Displays compact unwind information in an executable"
+.Sh SYNOPSIS
+.Nm
+.Op Fl arch Ar arch-name
+.Ar file(s)
+.Sh DESCRIPTION
+When a C++ (or x86_64 Objective-C) exception is thrown, the runtime must unwind
+the stack looking for some function to catch the exception. Traditionally,
+the unwind information is stored in the __TEXT/__eh_frame section of each executable
+as Dwarf CFI (call frame information). Beginning in Mac OS X 10.6, the unwind
+information is also encoded in the __TEXT/__unwind_info section using a two-level
+lookup table of compact unwind encodings.
+.Pp
+The unwinddump tool displays the content of the __TEXT/__unwind_info section.
+.Sh SEE ALSO
+.Xr ld 1
+.Xr dwarfdump 1
diff --git a/ld64-134.9/ld64.xcodeproj/project.pbxproj b/ld64-134.9/ld64.xcodeproj/project.pbxproj
new file mode 100644
index 0000000..08145e5
--- /dev/null
+++ b/ld64-134.9/ld64.xcodeproj/project.pbxproj
@@ -0,0 +1,1737 @@
+// !$*UTF8*$!
+{
+ archiveVersion = 1;
+ classes = {
+ };
+ objectVersion = 42;
+ objects = {
+
+/* Begin PBXAggregateTarget section */
+ F96D5368094A2754008E9EE8 /* unit-tests */ = {
+ isa = PBXAggregateTarget;
+ buildConfigurationList = F96D536D094A2773008E9EE8 /* Build configuration list for PBXAggregateTarget "unit-tests" */;
+ buildPhases = (
+ F96D5367094A2754008E9EE8 /* ShellScript */,
+ );
+ dependencies = (
+ F96D536A094A275D008E9EE8 /* PBXTargetDependency */,
+ F96D536C094A275F008E9EE8 /* PBXTargetDependency */,
+ F96904890A4333AC00B77D2A /* PBXTargetDependency */,
+ F9EA73970974999B008B4F1D /* PBXTargetDependency */,
+ F9B693890EC4D28C00076912 /* PBXTargetDependency */,
+ F9F9AD68116D58AF0028EFAB /* PBXTargetDependency */,
+ );
+ name = "unit-tests";
+ productName = "unit-tests";
+ };
+ F9B1A2670A3A567B00DA8FAB /* all */ = {
+ isa = PBXAggregateTarget;
+ buildConfigurationList = F9B1A26C0A3A568700DA8FAB /* Build configuration list for PBXAggregateTarget "all" */;
+ buildPhases = (
+ F9871A3413340B4600DB3F24 /* Platform install */,
+ );
+ dependencies = (
+ F9B1A2690A3A568200DA8FAB /* PBXTargetDependency */,
+ F9B1A26B0A3A568400DA8FAB /* PBXTargetDependency */,
+ F9C12EEA0ED65765005BC69D /* PBXTargetDependency */,
+ F9B8135D0EC2620E00F94C13 /* PBXTargetDependency */,
+ F9A3DE160ED76D9A00C590B9 /* PBXTargetDependency */,
+ );
+ name = all;
+ productName = all;
+ };
+/* End PBXAggregateTarget section */
+
+/* Begin PBXBuildFile section */
+ B3B672421406D42800A376BB /* Snapshot.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B3B672411406D42800A376BB /* Snapshot.cpp */; };
+ F9023C4E06D5A272001BBF46 /* ld.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F9023C3F06D5A254001BBF46 /* ld.cpp */; };
+ F933E3D9092E855B0083EAC8 /* ObjectDump.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F971EED706D5AD240041D381 /* ObjectDump.cpp */; };
+ F93CB248116E69EB003233B8 /* tlvp.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F93CB246116E69EB003233B8 /* tlvp.cpp */; };
+ F97F5029070D0BB200B9FCD7 /* ld.1 in copy man page */ = {isa = PBXBuildFile; fileRef = F97F5028070D0BB200B9FCD7 /* ld.1 */; };
+ F98498A310AE2159009E9878 /* compact_unwind.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F9BA963310A2545C0097A440 /* compact_unwind.cpp */; };
+ F98498A410AE2159009E9878 /* got.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F9AB1063107D380700E54C9E /* got.cpp */; };
+ F9849E3610B38EF5009E9878 /* order.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F9849E3410B38EF5009E9878 /* order.cpp */; };
+ F984A38210BB4B0D009E9878 /* branch_island.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F984A38010BB4B0D009E9878 /* branch_island.cpp */; };
+ F989D30D106826020014B60C /* OutputFile.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F989D30B106826020014B60C /* OutputFile.cpp */; };
+ F9A3DDD30ED762E400C590B9 /* PruneTrie.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F9A3DDD20ED762E400C590B9 /* PruneTrie.cpp */; };
+ F9A3DE1E0ED7738300C590B9 /* prune_trie.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = F9A3DE0F0ED76D1900C590B9 /* prune_trie.h */; };
+ F9A4DB9110F816FF00BD8423 /* objc.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F9A4DB8F10F816FF00BD8423 /* objc.cpp */; };
+ F9AA44DC1294885F00CB8390 /* branch_shim.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F9AA44DA1294885F00CB8390 /* branch_shim.cpp */; };
+ F9AA65111051BD2B003E3539 /* stubs.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F9AA65101051BD2B003E3539 /* stubs.cpp */; };
+ F9AA65891051E750003E3539 /* macho_relocatable_file.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F9AA65871051E750003E3539 /* macho_relocatable_file.cpp */; };
+ F9AA65DD1051EC4A003E3539 /* archive_file.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F9AA65D71051EC4A003E3539 /* archive_file.cpp */; };
+ F9AA65DE1051EC4A003E3539 /* lto_file.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F9AA65D91051EC4A003E3539 /* lto_file.cpp */; };
+ F9AA65DF1051EC4A003E3539 /* macho_dylib_file.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F9AA65DB1051EC4A003E3539 /* macho_dylib_file.cpp */; };
+ F9AA6786105700C2003E3539 /* opaque_section_file.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F9AA6784105700C2003E3539 /* opaque_section_file.cpp */; };
+ F9AA67B610570C41003E3539 /* dtrace_dof.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F9AA67B510570C41003E3539 /* dtrace_dof.cpp */; };
+ F9AA687C10572E27003E3539 /* InputFiles.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F9AA687A10572E27003E3539 /* InputFiles.cpp */; };
+ F9AA69B610583C0C003E3539 /* SymbolTable.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F9AA69B410583C0C003E3539 /* SymbolTable.cpp */; };
+ F9AA69C110583E19003E3539 /* Resolver.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F9AA69BF10583E19003E3539 /* Resolver.cpp */; };
+ F9AA6FF910618CD2003E3539 /* macho_relocatable_file.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F9AA65871051E750003E3539 /* macho_relocatable_file.cpp */; };
+ F9AE20FF1107D1440007ED5D /* dylibs.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F9AE20FD1107D1440007ED5D /* dylibs.cpp */; };
+ F9AE23291109015E0007ED5D /* lto_file.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F9AA65D91051EC4A003E3539 /* lto_file.cpp */; };
+ F9B1A2640A3A563E00DA8FAB /* rebase.1 in install man page */ = {isa = PBXBuildFile; fileRef = F9B1A2580A3A448800DA8FAB /* rebase.1 */; };
+ F9B670120DDA17E800E6D0DA /* UnwindDump.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F9B670110DDA17E800E6D0DA /* UnwindDump.cpp */; };
+ F9B813850EC2657800F94C13 /* unwinddump.1 in install man page */ = {isa = PBXBuildFile; fileRef = F9B813810EC2653000F94C13 /* unwinddump.1 */; };
+ F9BA51650ECE58C800D1D62E /* dyldinfo.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F9BA515B0ECE58AA00D1D62E /* dyldinfo.cpp */; };
+ F9BA955E10A233000097A440 /* huge.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F9BA955C10A233000097A440 /* huge.cpp */; };
+ F9C0D4BD06DD28D2001C7193 /* Options.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F9C0D48A06DD1E1B001C7193 /* Options.cpp */; };
+ F9C12EA30ED63DE7005BC69D /* dyldinfo.1 in install man page */ = {isa = PBXBuildFile; fileRef = F9C12E9F0ED63DB1005BC69D /* dyldinfo.1 */; };
+ F9CC24191461FB4300A92174 /* blob.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F9CC24141461FB4300A92174 /* blob.cpp */; };
+ F9EA72D5097454FF008B4F1D /* machochecker.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F9EA72D4097454FF008B4F1D /* machochecker.cpp */; };
+ F9EA7584097882F3008B4F1D /* debugline.c in Sources */ = {isa = PBXBuildFile; fileRef = F9EA7582097882F3008B4F1D /* debugline.c */; };
+ F9EA75BC09788857008B4F1D /* debugline.c in Sources */ = {isa = PBXBuildFile; fileRef = F9EA7582097882F3008B4F1D /* debugline.c */; };
+ F9EC78060A2F8674002A3E39 /* rebase.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F9EC78050A2F8674002A3E39 /* rebase.cpp */; };
+/* End PBXBuildFile section */
+
+/* Begin PBXBuildRule section */
+ F9E8D4BD07FCAF2000FD5801 /* PBXBuildRule */ = {
+ isa = PBXBuildRule;
+ compilerSpec = com.apple.compilers.llvm.clang.1_0;
+ fileType = sourcecode.c;
+ isEditable = 1;
+ outputFiles = (
+ );
+ };
+ F9E8D4BE07FCAF2A00FD5801 /* PBXBuildRule */ = {
+ isa = PBXBuildRule;
+ compilerSpec = com.apple.compilers.llvm.clang.1_0;
+ fileType = sourcecode.cpp;
+ isEditable = 1;
+ outputFiles = (
+ );
+ };
+/* End PBXBuildRule section */
+
+/* Begin PBXContainerItemProxy section */
+ F96904880A4333AC00B77D2A /* PBXContainerItemProxy */ = {
+ isa = PBXContainerItemProxy;
+ containerPortal = F9023C3006D5A227001BBF46 /* Project object */;
+ proxyType = 1;
+ remoteGlobalIDString = F9EC77ED0A2F85F6002A3E39;
+ remoteInfo = rebase;
+ };
+ F96D5369094A275D008E9EE8 /* PBXContainerItemProxy */ = {
+ isa = PBXContainerItemProxy;
+ containerPortal = F9023C3006D5A227001BBF46 /* Project object */;
+ proxyType = 1;
+ remoteGlobalIDString = F9023C3806D5A23E001BBF46;
+ remoteInfo = ld;
+ };
+ F96D536B094A275F008E9EE8 /* PBXContainerItemProxy */ = {
+ isa = PBXContainerItemProxy;
+ containerPortal = F9023C3006D5A227001BBF46 /* Project object */;
+ proxyType = 1;
+ remoteGlobalIDString = F971EED206D5ACF60041D381;
+ remoteInfo = ObjectDump;
+ };
+ F9A3DE150ED76D9A00C590B9 /* PBXContainerItemProxy */ = {
+ isa = PBXContainerItemProxy;
+ containerPortal = F9023C3006D5A227001BBF46 /* Project object */;
+ proxyType = 1;
+ remoteGlobalIDString = F9A3DDC90ED762B700C590B9;
+ remoteInfo = libprunetrie;
+ };
+ F9B1A2680A3A568200DA8FAB /* PBXContainerItemProxy */ = {
+ isa = PBXContainerItemProxy;
+ containerPortal = F9023C3006D5A227001BBF46 /* Project object */;
+ proxyType = 1;
+ remoteGlobalIDString = F9023C3806D5A23E001BBF46;
+ remoteInfo = ld;
+ };
+ F9B1A26A0A3A568400DA8FAB /* PBXContainerItemProxy */ = {
+ isa = PBXContainerItemProxy;
+ containerPortal = F9023C3006D5A227001BBF46 /* Project object */;
+ proxyType = 1;
+ remoteGlobalIDString = F9EC77ED0A2F85F6002A3E39;
+ remoteInfo = rebase;
+ };
+ F9B693880EC4D28C00076912 /* PBXContainerItemProxy */ = {
+ isa = PBXContainerItemProxy;
+ containerPortal = F9023C3006D5A227001BBF46 /* Project object */;
+ proxyType = 1;
+ remoteGlobalIDString = F9B670010DDA176100E6D0DA;
+ remoteInfo = unwinddump;
+ };
+ F9B8135C0EC2620E00F94C13 /* PBXContainerItemProxy */ = {
+ isa = PBXContainerItemProxy;
+ containerPortal = F9023C3006D5A227001BBF46 /* Project object */;
+ proxyType = 1;
+ remoteGlobalIDString = F9B670010DDA176100E6D0DA;
+ remoteInfo = unwinddump;
+ };
+ F9C12EE90ED65765005BC69D /* PBXContainerItemProxy */ = {
+ isa = PBXContainerItemProxy;
+ containerPortal = F9023C3006D5A227001BBF46 /* Project object */;
+ proxyType = 1;
+ remoteGlobalIDString = F9BA51600ECE58BE00D1D62E;
+ remoteInfo = dyldinfo;
+ };
+ F9EA73960974999B008B4F1D /* PBXContainerItemProxy */ = {
+ isa = PBXContainerItemProxy;
+ containerPortal = F9023C3006D5A227001BBF46 /* Project object */;
+ proxyType = 1;
+ remoteGlobalIDString = F9EA72CA097454A6008B4F1D;
+ remoteInfo = machocheck;
+ };
+ F9F9AD67116D58AF0028EFAB /* PBXContainerItemProxy */ = {
+ isa = PBXContainerItemProxy;
+ containerPortal = F9023C3006D5A227001BBF46 /* Project object */;
+ proxyType = 1;
+ remoteGlobalIDString = F9BA51600ECE58BE00D1D62E;
+ remoteInfo = dyldinfo;
+ };
+/* End PBXContainerItemProxy section */
+
+/* Begin PBXCopyFilesBuildPhase section */
+ F97F5025070D0B6300B9FCD7 /* copy man page */ = {
+ isa = PBXCopyFilesBuildPhase;
+ buildActionMask = 8;
+ dstPath = /usr/share/man/man1;
+ dstSubfolderSpec = 0;
+ files = (
+ F97F5029070D0BB200B9FCD7 /* ld.1 in copy man page */,
+ );
+ name = "copy man page";
+ runOnlyForDeploymentPostprocessing = 1;
+ };
+ F9A3DE140ED76D7700C590B9 /* CopyFiles */ = {
+ isa = PBXCopyFilesBuildPhase;
+ buildActionMask = 8;
+ dstPath = "/usr/local/include/mach-o";
+ dstSubfolderSpec = 0;
+ files = (
+ F9A3DE1E0ED7738300C590B9 /* prune_trie.h in CopyFiles */,
+ );
+ runOnlyForDeploymentPostprocessing = 1;
+ };
+ F9B1A25E0A3A44CB00DA8FAB /* install man page */ = {
+ isa = PBXCopyFilesBuildPhase;
+ buildActionMask = 8;
+ dstPath = /usr/share/man/man1;
+ dstSubfolderSpec = 0;
+ files = (
+ F9B1A2640A3A563E00DA8FAB /* rebase.1 in install man page */,
+ );
+ name = "install man page";
+ runOnlyForDeploymentPostprocessing = 1;
+ };
+ F9B813870EC2659600F94C13 /* install man page */ = {
+ isa = PBXCopyFilesBuildPhase;
+ buildActionMask = 8;
+ dstPath = usr/share/man/man1;
+ dstSubfolderSpec = 0;
+ files = (
+ F9B813850EC2657800F94C13 /* unwinddump.1 in install man page */,
+ );
+ name = "install man page";
+ runOnlyForDeploymentPostprocessing = 1;
+ };
+ F9C12EA50ED63E05005BC69D /* install man page */ = {
+ isa = PBXCopyFilesBuildPhase;
+ buildActionMask = 8;
+ dstPath = usr/share/man/man1;
+ dstSubfolderSpec = 0;
+ files = (
+ F9C12EA30ED63DE7005BC69D /* dyldinfo.1 in install man page */,
+ );
+ name = "install man page";
+ runOnlyForDeploymentPostprocessing = 1;
+ };
+/* End PBXCopyFilesBuildPhase section */
+
+/* Begin PBXFileReference section */
+ B3B672411406D42800A376BB /* Snapshot.cpp */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Snapshot.cpp; path = src/ld/Snapshot.cpp; sourceTree = ""; tabWidth = 4; usesTabs = 1; };
+ B3B672441406D44300A376BB /* Snapshot.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.h; name = Snapshot.h; path = src/ld/Snapshot.h; sourceTree = ""; tabWidth = 4; usesTabs = 1; };
+ B3C7A09914295B9C005FC714 /* compile_stubs */ = {isa = PBXFileReference; lastKnownFileType = text.script.csh; path = compile_stubs; sourceTree = ""; tabWidth = 4; usesTabs = 1; };
+ F9023C3906D5A23E001BBF46 /* ld */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = ld; sourceTree = BUILT_PRODUCTS_DIR; };
+ F9023C3F06D5A254001BBF46 /* ld.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; name = ld.cpp; path = src/ld/ld.cpp; sourceTree = ""; tabWidth = 4; usesTabs = 1; };
+ F92D9C2710657AAB00FF369B /* stub_x86_64_classic.hpp */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.cpp.h; path = stub_x86_64_classic.hpp; sourceTree = ""; tabWidth = 4; usesTabs = 1; };
+ F933D9460929277C0083EAC8 /* FileAbstraction.hpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.h; name = FileAbstraction.hpp; path = src/abstraction/FileAbstraction.hpp; sourceTree = ""; tabWidth = 4; usesTabs = 1; };
+ F933D9470929277C0083EAC8 /* MachOFileAbstraction.hpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.h; name = MachOFileAbstraction.hpp; path = src/abstraction/MachOFileAbstraction.hpp; sourceTree = ""; tabWidth = 4; usesTabs = 1; };
+ F933DC37092A82480083EAC8 /* Architectures.hpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.h; name = Architectures.hpp; path = src/ld/Architectures.hpp; sourceTree = ""; tabWidth = 4; usesTabs = 1; };
+ F93CB246116E69EB003233B8 /* tlvp.cpp */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.cpp.cpp; path = tlvp.cpp; sourceTree = ""; tabWidth = 4; usesTabs = 1; };
+ F93CB247116E69EB003233B8 /* tlvp.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = tlvp.h; sourceTree = ""; tabWidth = 4; usesTabs = 1; };
+ F971EED306D5ACF60041D381 /* ObjectDump */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = ObjectDump; sourceTree = BUILT_PRODUCTS_DIR; };
+ F971EED706D5AD240041D381 /* ObjectDump.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; name = ObjectDump.cpp; path = src/other/ObjectDump.cpp; sourceTree = ""; tabWidth = 4; usesTabs = 1; };
+ F97F5028070D0BB200B9FCD7 /* ld.1 */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text.man; name = ld.1; path = doc/man/man1/ld.1; sourceTree = ""; tabWidth = 4; usesTabs = 1; };
+ F9849E3410B38EF5009E9878 /* order.cpp */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.cpp.cpp; path = order.cpp; sourceTree = ""; tabWidth = 4; usesTabs = 1; };
+ F9849E3510B38EF5009E9878 /* order.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = order.h; sourceTree = ""; tabWidth = 4; usesTabs = 1; };
+ F984A13B10B614CF009E9878 /* stub_arm_classic.hpp */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.cpp.h; path = stub_arm_classic.hpp; sourceTree = ""; tabWidth = 4; usesTabs = 1; };
+ F984A38010BB4B0D009E9878 /* branch_island.cpp */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.cpp.cpp; path = branch_island.cpp; sourceTree = ""; tabWidth = 4; usesTabs = 1; };
+ F984A38110BB4B0D009E9878 /* branch_island.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = branch_island.h; sourceTree = ""; tabWidth = 4; usesTabs = 1; };
+ F989D0391062E6350014B60C /* stub_x86_64.hpp */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.cpp.h; path = stub_x86_64.hpp; sourceTree = ""; tabWidth = 4; usesTabs = 1; };
+ F989D30B106826020014B60C /* OutputFile.cpp */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.cpp.cpp; name = OutputFile.cpp; path = src/ld/OutputFile.cpp; sourceTree = ""; tabWidth = 4; usesTabs = 1; };
+ F989D30C106826020014B60C /* OutputFile.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.h; name = OutputFile.h; path = src/ld/OutputFile.h; sourceTree = ""; tabWidth = 4; usesTabs = 1; };
+ F989D3AA10684F5B0014B60C /* LinkEdit.hpp */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.cpp.h; name = LinkEdit.hpp; path = src/ld/LinkEdit.hpp; sourceTree = ""; tabWidth = 4; usesTabs = 1; };
+ F989D44B10694F2E0014B60C /* LinkEditClassic.hpp */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.cpp.h; name = LinkEditClassic.hpp; path = src/ld/LinkEditClassic.hpp; sourceTree = ""; tabWidth = 4; usesTabs = 1; };
+ F989D7E91072DEC20014B60C /* HeaderAndLoadCommands.hpp */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.cpp.h; name = HeaderAndLoadCommands.hpp; path = src/ld/HeaderAndLoadCommands.hpp; sourceTree = ""; tabWidth = 4; usesTabs = 1; };
+ F9A3DDCA0ED762B700C590B9 /* libprunetrie.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libprunetrie.a; sourceTree = BUILT_PRODUCTS_DIR; };
+ F9A3DDD20ED762E400C590B9 /* PruneTrie.cpp */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.cpp.cpp; name = PruneTrie.cpp; path = src/other/PruneTrie.cpp; sourceTree = ""; tabWidth = 4; usesTabs = 1; };
+ F9A3DE0F0ED76D1900C590B9 /* prune_trie.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.h; name = prune_trie.h; path = src/other/prune_trie.h; sourceTree = ""; tabWidth = 4; usesTabs = 1; };
+ F9A4DB8F10F816FF00BD8423 /* objc.cpp */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.cpp.cpp; path = objc.cpp; sourceTree = ""; tabWidth = 4; usesTabs = 1; };
+ F9A4DB9010F816FF00BD8423 /* objc.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = objc.h; sourceTree = ""; tabWidth = 4; usesTabs = 1; };
+ F9AA44DA1294885F00CB8390 /* branch_shim.cpp */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.cpp.cpp; path = branch_shim.cpp; sourceTree = ""; tabWidth = 4; usesTabs = 1; };
+ F9AA44DB1294885F00CB8390 /* branch_shim.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = branch_shim.h; sourceTree = ""; tabWidth = 4; usesTabs = 1; };
+ F9AA5FCC103F5CD1003E3539 /* ld.hpp */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.cpp.h; name = ld.hpp; path = src/ld/ld.hpp; sourceTree = ""; tabWidth = 4; usesTabs = 1; };
+ F9AA650D1051BD2B003E3539 /* make_stubs.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = make_stubs.h; sourceTree = ""; tabWidth = 4; usesTabs = 1; };
+ F9AA650F1051BD2B003E3539 /* stub_arm.hpp */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.cpp.h; path = stub_arm.hpp; sourceTree = ""; tabWidth = 4; usesTabs = 1; };
+ F9AA65101051BD2B003E3539 /* stubs.cpp */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.cpp.cpp; path = stubs.cpp; sourceTree = ""; tabWidth = 4; usesTabs = 1; };
+ F9AA65871051E750003E3539 /* macho_relocatable_file.cpp */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.cpp.cpp; path = macho_relocatable_file.cpp; sourceTree = ""; tabWidth = 4; usesTabs = 1; };
+ F9AA65881051E750003E3539 /* macho_relocatable_file.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = macho_relocatable_file.h; sourceTree = ""; tabWidth = 4; usesTabs = 1; };
+ F9AA65D71051EC4A003E3539 /* archive_file.cpp */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.cpp.cpp; path = archive_file.cpp; sourceTree = ""; tabWidth = 4; usesTabs = 1; };
+ F9AA65D81051EC4A003E3539 /* archive_file.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = archive_file.h; sourceTree = ""; tabWidth = 4; usesTabs = 1; };
+ F9AA65D91051EC4A003E3539 /* lto_file.cpp */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.cpp.cpp; path = lto_file.cpp; sourceTree = ""; tabWidth = 4; usesTabs = 1; };
+ F9AA65DA1051EC4A003E3539 /* lto_file.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = lto_file.h; sourceTree = ""; tabWidth = 4; usesTabs = 1; };
+ F9AA65DB1051EC4A003E3539 /* macho_dylib_file.cpp */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.cpp.cpp; path = macho_dylib_file.cpp; sourceTree = ""; tabWidth = 4; usesTabs = 1; };
+ F9AA65DC1051EC4A003E3539 /* macho_dylib_file.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = macho_dylib_file.h; sourceTree = ""; tabWidth = 4; usesTabs = 1; };
+ F9AA6784105700C2003E3539 /* opaque_section_file.cpp */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.cpp.cpp; path = opaque_section_file.cpp; sourceTree = ""; tabWidth = 4; usesTabs = 1; };
+ F9AA6785105700C2003E3539 /* opaque_section_file.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = opaque_section_file.h; sourceTree = ""; tabWidth = 4; usesTabs = 1; };
+ F9AA67B410570C41003E3539 /* dtrace_dof.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = dtrace_dof.h; sourceTree = ""; tabWidth = 4; usesTabs = 1; };
+ F9AA67B510570C41003E3539 /* dtrace_dof.cpp */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.cpp.cpp; path = dtrace_dof.cpp; sourceTree = ""; tabWidth = 4; usesTabs = 1; };
+ F9AA687A10572E27003E3539 /* InputFiles.cpp */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.cpp.cpp; name = InputFiles.cpp; path = src/ld/InputFiles.cpp; sourceTree = ""; tabWidth = 4; usesTabs = 1; };
+ F9AA687B10572E27003E3539 /* InputFiles.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.h; name = InputFiles.h; path = src/ld/InputFiles.h; sourceTree = ""; tabWidth = 4; usesTabs = 1; };
+ F9AA69B410583C0C003E3539 /* SymbolTable.cpp */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.cpp.cpp; name = SymbolTable.cpp; path = src/ld/SymbolTable.cpp; sourceTree = ""; tabWidth = 4; usesTabs = 1; };
+ F9AA69B510583C0C003E3539 /* SymbolTable.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.h; name = SymbolTable.h; path = src/ld/SymbolTable.h; sourceTree = ""; tabWidth = 4; usesTabs = 1; };
+ F9AA69BF10583E19003E3539 /* Resolver.cpp */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Resolver.cpp; path = src/ld/Resolver.cpp; sourceTree = ""; tabWidth = 4; usesTabs = 1; };
+ F9AA69C010583E19003E3539 /* Resolver.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.h; name = Resolver.h; path = src/ld/Resolver.h; sourceTree = ""; tabWidth = 4; usesTabs = 1; };
+ F9AB1063107D380700E54C9E /* got.cpp */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.cpp.cpp; path = got.cpp; sourceTree = ""; tabWidth = 4; usesTabs = 1; };
+ F9AB1064107D380700E54C9E /* got.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = got.h; sourceTree = ""; tabWidth = 4; usesTabs = 1; };
+ F9AE20FD1107D1440007ED5D /* dylibs.cpp */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.cpp.cpp; path = dylibs.cpp; sourceTree = ""; tabWidth = 4; usesTabs = 1; };
+ F9AE20FE1107D1440007ED5D /* dylibs.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = dylibs.h; sourceTree = ""; tabWidth = 4; usesTabs = 1; };
+ F9B1A2580A3A448800DA8FAB /* rebase.1 */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text.man; name = rebase.1; path = doc/man/man1/rebase.1; sourceTree = ""; tabWidth = 4; usesTabs = 1; };
+ F9B670080DDA176100E6D0DA /* unwinddump */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = unwinddump; sourceTree = BUILT_PRODUCTS_DIR; };
+ F9B670110DDA17E800E6D0DA /* UnwindDump.cpp */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.cpp.cpp; name = UnwindDump.cpp; path = src/other/unwinddump.cpp; sourceTree = ""; tabWidth = 4; usesTabs = 1; };
+ F9B813810EC2653000F94C13 /* unwinddump.1 */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = text.man; name = unwinddump.1; path = doc/man/man1/unwinddump.1; sourceTree = ""; tabWidth = 4; usesTabs = 1; };
+ F9B813BF0EC27C6700F94C13 /* MachOTrie.hpp */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.cpp.h; name = MachOTrie.hpp; path = src/abstraction/MachOTrie.hpp; sourceTree = ""; tabWidth = 4; usesTabs = 1; };
+ F9BA515B0ECE58AA00D1D62E /* dyldinfo.cpp */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.cpp.cpp; name = dyldinfo.cpp; path = src/other/dyldinfo.cpp; sourceTree = ""; tabWidth = 4; usesTabs = 1; };
+ F9BA51610ECE58BE00D1D62E /* dyldinfo */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = dyldinfo; sourceTree = BUILT_PRODUCTS_DIR; };
+ F9BA8A7E1096150F0097A440 /* stub_x86_classic.hpp */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.cpp.h; path = stub_x86_classic.hpp; sourceTree = ""; tabWidth = 4; usesTabs = 1; };
+ F9BA8A7F1096150F0097A440 /* stub_x86.hpp */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.cpp.h; path = stub_x86.hpp; sourceTree = ""; tabWidth = 4; usesTabs = 1; };
+ F9BA955C10A233000097A440 /* huge.cpp */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.cpp.cpp; path = huge.cpp; sourceTree = ""; tabWidth = 4; usesTabs = 1; };
+ F9BA955D10A233000097A440 /* huge.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = huge.h; sourceTree = ""; tabWidth = 4; usesTabs = 1; };
+ F9BA963310A2545C0097A440 /* compact_unwind.cpp */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.cpp.cpp; path = compact_unwind.cpp; sourceTree = ""; tabWidth = 4; usesTabs = 1; };
+ F9BA963410A2545C0097A440 /* compact_unwind.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = compact_unwind.h; sourceTree = ""; tabWidth = 4; usesTabs = 1; };
+ F9C0D48A06DD1E1B001C7193 /* Options.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; name = Options.cpp; path = src/ld/Options.cpp; sourceTree = ""; tabWidth = 4; usesTabs = 1; };
+ F9C0D48B06DD1E1B001C7193 /* Options.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = Options.h; path = src/ld/Options.h; sourceTree = ""; tabWidth = 4; usesTabs = 1; };
+ F9C12E9F0ED63DB1005BC69D /* dyldinfo.1 */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = text.man; name = dyldinfo.1; path = doc/man/man1/dyldinfo.1; sourceTree = ""; tabWidth = 4; usesTabs = 1; };
+ F9CC24141461FB4300A92174 /* blob.cpp */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.cpp.cpp; path = blob.cpp; sourceTree = ""; tabWidth = 4; usesTabs = 1; };
+ F9CC24151461FB4300A92174 /* blob.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = blob.h; sourceTree = ""; tabWidth = 4; usesTabs = 1; };
+ F9CC24161461FB4300A92174 /* endian.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = endian.h; sourceTree = ""; tabWidth = 4; usesTabs = 1; };
+ F9CC24171461FB4300A92174 /* memutils.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = memutils.h; sourceTree = ""; tabWidth = 4; usesTabs = 1; };
+ F9CC24181461FB4300A92174 /* superblob.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = superblob.h; sourceTree = ""; tabWidth = 4; usesTabs = 1; };
+ F9CCF761144CE1AD007CB524 /* create_configure */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = text.script.sh; name = create_configure; path = src/create_configure; sourceTree = ""; tabWidth = 4; usesTabs = 1; };
+ F9EA72CB097454A6008B4F1D /* machocheck */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = machocheck; sourceTree = BUILT_PRODUCTS_DIR; };
+ F9EA72D4097454FF008B4F1D /* machochecker.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; name = machochecker.cpp; path = src/other/machochecker.cpp; sourceTree = ""; tabWidth = 4; usesTabs = 1; };
+ F9EA7582097882F3008B4F1D /* debugline.c */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 2; lastKnownFileType = sourcecode.c.c; name = debugline.c; path = src/ld/debugline.c; sourceTree = ""; tabWidth = 8; usesTabs = 1; };
+ F9EA7583097882F3008B4F1D /* debugline.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = debugline.h; path = src/ld/debugline.h; sourceTree = ""; tabWidth = 4; usesTabs = 1; };
+ F9EC77EE0A2F85F6002A3E39 /* rebase */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = rebase; sourceTree = BUILT_PRODUCTS_DIR; };
+ F9EC78050A2F8674002A3E39 /* rebase.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; name = rebase.cpp; path = src/other/rebase.cpp; sourceTree = ""; tabWidth = 4; usesTabs = 1; };
+/* End PBXFileReference section */
+
+/* Begin PBXFrameworksBuildPhase section */
+ F9023C3706D5A23E001BBF46 /* Frameworks */ = {
+ isa = PBXFrameworksBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ F971EED106D5ACF60041D381 /* Frameworks */ = {
+ isa = PBXFrameworksBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ F9B670040DDA176100E6D0DA /* Frameworks */ = {
+ isa = PBXFrameworksBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ F9BA515F0ECE58BE00D1D62E /* Frameworks */ = {
+ isa = PBXFrameworksBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ F9EA72C9097454A6008B4F1D /* Frameworks */ = {
+ isa = PBXFrameworksBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ F9EC77EC0A2F85F6002A3E39 /* Frameworks */ = {
+ isa = PBXFrameworksBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+/* End PBXFrameworksBuildPhase section */
+
+/* Begin PBXGroup section */
+ F9023C2C06D5A227001BBF46 = {
+ isa = PBXGroup;
+ children = (
+ F9B813A80EC27B6300F94C13 /* abstraction */,
+ F9B813AD0EC27B8500F94C13 /* ld */,
+ F9B813B00EC27B9E00F94C13 /* other */,
+ F9B8137E0EC2651200F94C13 /* doc */,
+ F9023C3A06D5A23E001BBF46 /* Products */,
+ );
+ sourceTree = "";
+ };
+ F9023C3A06D5A23E001BBF46 /* Products */ = {
+ isa = PBXGroup;
+ children = (
+ F9023C3906D5A23E001BBF46 /* ld */,
+ F971EED306D5ACF60041D381 /* ObjectDump */,
+ F9EA72CB097454A6008B4F1D /* machocheck */,
+ F9EC77EE0A2F85F6002A3E39 /* rebase */,
+ F9B670080DDA176100E6D0DA /* unwinddump */,
+ F9BA51610ECE58BE00D1D62E /* dyldinfo */,
+ F9A3DDCA0ED762B700C590B9 /* libprunetrie.a */,
+ );
+ name = Products;
+ sourceTree = "";
+ };
+ F9AA650B1051BD2B003E3539 /* passes */ = {
+ isa = PBXGroup;
+ children = (
+ F984A38010BB4B0D009E9878 /* branch_island.cpp */,
+ F984A38110BB4B0D009E9878 /* branch_island.h */,
+ F9AA44DA1294885F00CB8390 /* branch_shim.cpp */,
+ F9AA44DB1294885F00CB8390 /* branch_shim.h */,
+ F9849E3410B38EF5009E9878 /* order.cpp */,
+ F9849E3510B38EF5009E9878 /* order.h */,
+ F9BA963310A2545C0097A440 /* compact_unwind.cpp */,
+ F9BA963410A2545C0097A440 /* compact_unwind.h */,
+ F9AA67B410570C41003E3539 /* dtrace_dof.h */,
+ F9AA67B510570C41003E3539 /* dtrace_dof.cpp */,
+ F9BA955C10A233000097A440 /* huge.cpp */,
+ F9BA955D10A233000097A440 /* huge.h */,
+ F9AB1063107D380700E54C9E /* got.cpp */,
+ F9AB1064107D380700E54C9E /* got.h */,
+ F93CB246116E69EB003233B8 /* tlvp.cpp */,
+ F93CB247116E69EB003233B8 /* tlvp.h */,
+ F9AE20FD1107D1440007ED5D /* dylibs.cpp */,
+ F9AE20FE1107D1440007ED5D /* dylibs.h */,
+ F9A4DB8F10F816FF00BD8423 /* objc.cpp */,
+ F9A4DB9010F816FF00BD8423 /* objc.h */,
+ F9AA650C1051BD2B003E3539 /* stubs */,
+ );
+ name = passes;
+ path = src/ld/passes;
+ sourceTree = "";
+ };
+ F9AA650C1051BD2B003E3539 /* stubs */ = {
+ isa = PBXGroup;
+ children = (
+ F9AA650D1051BD2B003E3539 /* make_stubs.h */,
+ F9AA65101051BD2B003E3539 /* stubs.cpp */,
+ F9AA650F1051BD2B003E3539 /* stub_arm.hpp */,
+ F984A13B10B614CF009E9878 /* stub_arm_classic.hpp */,
+ F9BA8A7F1096150F0097A440 /* stub_x86.hpp */,
+ F9BA8A7E1096150F0097A440 /* stub_x86_classic.hpp */,
+ F989D0391062E6350014B60C /* stub_x86_64.hpp */,
+ F92D9C2710657AAB00FF369B /* stub_x86_64_classic.hpp */,
+ );
+ path = stubs;
+ sourceTree = "";
+ };
+ F9AA65861051E750003E3539 /* parsers */ = {
+ isa = PBXGroup;
+ children = (
+ F9AA6784105700C2003E3539 /* opaque_section_file.cpp */,
+ F9AA6785105700C2003E3539 /* opaque_section_file.h */,
+ F9AA65D71051EC4A003E3539 /* archive_file.cpp */,
+ F9AA65D81051EC4A003E3539 /* archive_file.h */,
+ F9AA65D91051EC4A003E3539 /* lto_file.cpp */,
+ F9AA65DA1051EC4A003E3539 /* lto_file.h */,
+ F9AA65DB1051EC4A003E3539 /* macho_dylib_file.cpp */,
+ F9AA65DC1051EC4A003E3539 /* macho_dylib_file.h */,
+ F9AA65871051E750003E3539 /* macho_relocatable_file.cpp */,
+ F9AA65881051E750003E3539 /* macho_relocatable_file.h */,
+ );
+ name = parsers;
+ path = src/ld/parsers;
+ sourceTree = "";
+ };
+ F9B8137E0EC2651200F94C13 /* doc */ = {
+ isa = PBXGroup;
+ children = (
+ F97F5028070D0BB200B9FCD7 /* ld.1 */,
+ F9B1A2580A3A448800DA8FAB /* rebase.1 */,
+ F9C12E9F0ED63DB1005BC69D /* dyldinfo.1 */,
+ F9B813810EC2653000F94C13 /* unwinddump.1 */,
+ );
+ name = doc;
+ sourceTree = "";
+ };
+ F9B813A80EC27B6300F94C13 /* abstraction */ = {
+ isa = PBXGroup;
+ children = (
+ F933D9470929277C0083EAC8 /* MachOFileAbstraction.hpp */,
+ F933D9460929277C0083EAC8 /* FileAbstraction.hpp */,
+ F9B813BF0EC27C6700F94C13 /* MachOTrie.hpp */,
+ );
+ name = abstraction;
+ sourceTree = "";
+ };
+ F9B813AD0EC27B8500F94C13 /* ld */ = {
+ isa = PBXGroup;
+ children = (
+ F9AA69BF10583E19003E3539 /* Resolver.cpp */,
+ F9AA69C010583E19003E3539 /* Resolver.h */,
+ F9AA69B410583C0C003E3539 /* SymbolTable.cpp */,
+ F9AA69B510583C0C003E3539 /* SymbolTable.h */,
+ F9AA687A10572E27003E3539 /* InputFiles.cpp */,
+ F9AA687B10572E27003E3539 /* InputFiles.h */,
+ F9AA5FCC103F5CD1003E3539 /* ld.hpp */,
+ F9023C3F06D5A254001BBF46 /* ld.cpp */,
+ F9C0D48A06DD1E1B001C7193 /* Options.cpp */,
+ F9C0D48B06DD1E1B001C7193 /* Options.h */,
+ F989D30B106826020014B60C /* OutputFile.cpp */,
+ F989D30C106826020014B60C /* OutputFile.h */,
+ F989D7E91072DEC20014B60C /* HeaderAndLoadCommands.hpp */,
+ F989D3AA10684F5B0014B60C /* LinkEdit.hpp */,
+ F989D44B10694F2E0014B60C /* LinkEditClassic.hpp */,
+ F9CC24131461FB4300A92174 /* code-sign-blobs */,
+ F9AA650B1051BD2B003E3539 /* passes */,
+ F9AA65861051E750003E3539 /* parsers */,
+ F933DC37092A82480083EAC8 /* Architectures.hpp */,
+ F9EA7582097882F3008B4F1D /* debugline.c */,
+ F9EA7583097882F3008B4F1D /* debugline.h */,
+ B3B672411406D42800A376BB /* Snapshot.cpp */,
+ B3B672441406D44300A376BB /* Snapshot.h */,
+ );
+ name = ld;
+ sourceTree = "";
+ };
+ F9B813B00EC27B9E00F94C13 /* other */ = {
+ isa = PBXGroup;
+ children = (
+ B3C7A09914295B9C005FC714 /* compile_stubs */,
+ F9CCF761144CE1AD007CB524 /* create_configure */,
+ F9EA72D4097454FF008B4F1D /* machochecker.cpp */,
+ F971EED706D5AD240041D381 /* ObjectDump.cpp */,
+ F9BA515B0ECE58AA00D1D62E /* dyldinfo.cpp */,
+ F9B670110DDA17E800E6D0DA /* UnwindDump.cpp */,
+ F9EC78050A2F8674002A3E39 /* rebase.cpp */,
+ F9A3DE0F0ED76D1900C590B9 /* prune_trie.h */,
+ F9A3DDD20ED762E400C590B9 /* PruneTrie.cpp */,
+ );
+ name = other;
+ sourceTree = "";
+ };
+ F9CC24131461FB4300A92174 /* code-sign-blobs */ = {
+ isa = PBXGroup;
+ children = (
+ F9CC24141461FB4300A92174 /* blob.cpp */,
+ F9CC24151461FB4300A92174 /* blob.h */,
+ F9CC24161461FB4300A92174 /* endian.h */,
+ F9CC24171461FB4300A92174 /* memutils.h */,
+ F9CC24181461FB4300A92174 /* superblob.h */,
+ );
+ name = "code-sign-blobs";
+ path = "src/ld/code-sign-blobs";
+ sourceTree = "";
+ };
+/* End PBXGroup section */
+
+/* Begin PBXNativeTarget section */
+ F9023C3806D5A23E001BBF46 /* ld */ = {
+ isa = PBXNativeTarget;
+ buildConfigurationList = F933D91B09291AC90083EAC8 /* Build configuration list for PBXNativeTarget "ld" */;
+ buildPhases = (
+ F9E8DB4D11921594007B4D6A /* make configure.h */,
+ B3C7A09714295B60005FC714 /* make compile_stub string */,
+ F9023C3606D5A23E001BBF46 /* Sources */,
+ F9023C3706D5A23E001BBF46 /* Frameworks */,
+ F97F5025070D0B6300B9FCD7 /* copy man page */,
+ );
+ buildRules = (
+ F9E8D4BE07FCAF2A00FD5801 /* PBXBuildRule */,
+ F9E8D4BD07FCAF2000FD5801 /* PBXBuildRule */,
+ );
+ dependencies = (
+ );
+ name = ld;
+ productName = ld64;
+ productReference = F9023C3906D5A23E001BBF46 /* ld */;
+ productType = "com.apple.product-type.tool";
+ };
+ F971EED206D5ACF60041D381 /* ObjectDump */ = {
+ isa = PBXNativeTarget;
+ buildConfigurationList = F933D91F09291AC90083EAC8 /* Build configuration list for PBXNativeTarget "ObjectDump" */;
+ buildPhases = (
+ F9CCF773144CE304007CB524 /* make configure.h */,
+ F971EED006D5ACF60041D381 /* Sources */,
+ F971EED106D5ACF60041D381 /* Frameworks */,
+ );
+ buildRules = (
+ );
+ dependencies = (
+ );
+ name = ObjectDump;
+ productName = ObjectDump;
+ productReference = F971EED306D5ACF60041D381 /* ObjectDump */;
+ productType = "com.apple.product-type.tool";
+ };
+ F9A3DDC90ED762B700C590B9 /* libprunetrie */ = {
+ isa = PBXNativeTarget;
+ buildConfigurationList = F9A3DDCF0ED762C100C590B9 /* Build configuration list for PBXNativeTarget "libprunetrie" */;
+ buildPhases = (
+ F9CCF781144CE3DF007CB524 /* make configure.h */,
+ F9A3DDC70ED762B700C590B9 /* Sources */,
+ F9A3DE140ED76D7700C590B9 /* CopyFiles */,
+ );
+ buildRules = (
+ );
+ dependencies = (
+ );
+ name = libprunetrie;
+ productName = libmachotrie;
+ productReference = F9A3DDCA0ED762B700C590B9 /* libprunetrie.a */;
+ productType = "com.apple.product-type.library.static";
+ };
+ F9B670010DDA176100E6D0DA /* unwinddump */ = {
+ isa = PBXNativeTarget;
+ buildConfigurationList = F9B670050DDA176100E6D0DA /* Build configuration list for PBXNativeTarget "unwinddump" */;
+ buildPhases = (
+ F9CCF77C144CE36B007CB524 /* make configure.h */,
+ F9B670020DDA176100E6D0DA /* Sources */,
+ F9B670040DDA176100E6D0DA /* Frameworks */,
+ F9B813870EC2659600F94C13 /* install man page */,
+ );
+ buildRules = (
+ );
+ dependencies = (
+ );
+ name = unwinddump;
+ productName = machocheck;
+ productReference = F9B670080DDA176100E6D0DA /* unwinddump */;
+ productType = "com.apple.product-type.tool";
+ };
+ F9BA51600ECE58BE00D1D62E /* dyldinfo */ = {
+ isa = PBXNativeTarget;
+ buildConfigurationList = F9BA516D0ECE58DA00D1D62E /* Build configuration list for PBXNativeTarget "dyldinfo" */;
+ buildPhases = (
+ F9CCF76B144CE2AD007CB524 /* make configure.h */,
+ F9BA515E0ECE58BE00D1D62E /* Sources */,
+ F9BA515F0ECE58BE00D1D62E /* Frameworks */,
+ F9C12EA50ED63E05005BC69D /* install man page */,
+ );
+ buildRules = (
+ );
+ dependencies = (
+ );
+ name = dyldinfo;
+ productName = dyldinfo;
+ productReference = F9BA51610ECE58BE00D1D62E /* dyldinfo */;
+ productType = "com.apple.product-type.tool";
+ };
+ F9EA72CA097454A6008B4F1D /* machocheck */ = {
+ isa = PBXNativeTarget;
+ buildConfigurationList = F9EA72CF097454D5008B4F1D /* Build configuration list for PBXNativeTarget "machocheck" */;
+ buildPhases = (
+ F9CCF76F144CE2D6007CB524 /* make configure.h */,
+ F9EA72C8097454A6008B4F1D /* Sources */,
+ F9EA72C9097454A6008B4F1D /* Frameworks */,
+ );
+ buildRules = (
+ );
+ dependencies = (
+ );
+ name = machocheck;
+ productName = machocheck;
+ productReference = F9EA72CB097454A6008B4F1D /* machocheck */;
+ productType = "com.apple.product-type.tool";
+ };
+ F9EC77ED0A2F85F6002A3E39 /* rebase */ = {
+ isa = PBXNativeTarget;
+ buildConfigurationList = F9EC77F00A2F8616002A3E39 /* Build configuration list for PBXNativeTarget "rebase" */;
+ buildPhases = (
+ F9CCF765144CE244007CB524 /* make configure.h */,
+ F9EC77EB0A2F85F6002A3E39 /* Sources */,
+ F9EC77EC0A2F85F6002A3E39 /* Frameworks */,
+ F9B1A25E0A3A44CB00DA8FAB /* install man page */,
+ );
+ buildRules = (
+ );
+ dependencies = (
+ );
+ name = rebase;
+ productName = rebase;
+ productReference = F9EC77EE0A2F85F6002A3E39 /* rebase */;
+ productType = "com.apple.product-type.tool";
+ };
+/* End PBXNativeTarget section */
+
+/* Begin PBXProject section */
+ F9023C3006D5A227001BBF46 /* Project object */ = {
+ isa = PBXProject;
+ attributes = {
+ ORGANIZATIONNAME = "Apple Inc.";
+ };
+ buildConfigurationList = F933D92309291AC90083EAC8 /* Build configuration list for PBXProject "ld64" */;
+ compatibilityVersion = "Xcode 2.4";
+ developmentRegion = English;
+ hasScannedForEncodings = 0;
+ knownRegions = (
+ English,
+ Japanese,
+ French,
+ German,
+ );
+ mainGroup = F9023C2C06D5A227001BBF46;
+ productRefGroup = F9023C3A06D5A23E001BBF46 /* Products */;
+ projectDirPath = "";
+ projectRoot = "";
+ targets = (
+ F9B1A2670A3A567B00DA8FAB /* all */,
+ F9023C3806D5A23E001BBF46 /* ld */,
+ F9EC77ED0A2F85F6002A3E39 /* rebase */,
+ F9B670010DDA176100E6D0DA /* unwinddump */,
+ F971EED206D5ACF60041D381 /* ObjectDump */,
+ F9EA72CA097454A6008B4F1D /* machocheck */,
+ F9BA51600ECE58BE00D1D62E /* dyldinfo */,
+ F9A3DDC90ED762B700C590B9 /* libprunetrie */,
+ F96D5368094A2754008E9EE8 /* unit-tests */,
+ );
+ };
+/* End PBXProject section */
+
+/* Begin PBXShellScriptBuildPhase section */
+ B3C7A09714295B60005FC714 /* make compile_stub string */ = {
+ isa = PBXShellScriptBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ );
+ inputPaths = (
+ "$(SRCROOT)/compile_stubs",
+ );
+ name = "make compile_stub string";
+ outputPaths = (
+ "$(DERIVED_FILE_DIR)/compile_stubs.h",
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ shellPath = /bin/csh;
+ shellScript = "echo \"static const char *compile_stubs = \" > $DERIVED_FILE_DIR/compile_stubs.h\ncat compile_stubs | sed s/\\\"/\\\\\\\\\\\"/g | sed s/^/\\\"/ | sed s/\\$/\\\\\\\\n\\\"/ >> $DERIVED_FILE_DIR/compile_stubs.h\necho \";\" >> $DERIVED_FILE_DIR/compile_stubs.h";
+ showEnvVarsInLog = 0;
+ };
+ F96D5367094A2754008E9EE8 /* ShellScript */ = {
+ isa = PBXShellScriptBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ );
+ inputPaths = (
+ );
+ outputPaths = (
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ shellPath = /bin/csh;
+ shellScript = "# Let tests set MACOSX_DEPLOYMENT_TARGET as they need\nunsetenv MACOSX_DEPLOYMENT_TARGET\n\n# make linker relative libLTO.dylib\nmkdir -p ${BUILD_DIR}/lib\nln -sf /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/libLTO.dylib ${BUILD_DIR}/lib/libLTO.dylib\n\n# always use new linker\nsetenv LD_NO_CLASSIC_LINKER\nsetenv LD_NO_CLASSIC_LINKER_STATIC\n\n# run full test suite\n\"$SRCROOT\"/unit-tests/run-all-unit-tests\n\nexit 0";
+ showEnvVarsInLog = 0;
+ };
+ F9871A3413340B4600DB3F24 /* Platform install */ = {
+ isa = PBXShellScriptBuildPhase;
+ buildActionMask = 8;
+ files = (
+ );
+ inputPaths = (
+ );
+ name = "Platform install";
+ outputPaths = (
+ );
+ runOnlyForDeploymentPostprocessing = 1;
+ shellPath = /bin/sh;
+ shellScript = "\nif [ -n \"${DT_TOOLCHAIN_DIR}\" ]\nthen\n\tmkdir -p \"${DSTROOT}/${DT_TOOLCHAIN_DIR}\"\n\tmv ${DSTROOT}/usr \"${DSTROOT}/${DT_TOOLCHAIN_DIR}\"\nelse\n\tif [ -n \"${RC_PURPLE}\" ]\n\tthen\n\t\tmkdir -p ${DSTROOT}/Developer/Platforms/iPhoneOS.platform/Developer/\n\t\tmv ${DSTROOT}/usr ${DSTROOT}/Developer/Platforms/iPhoneOS.platform/Developer\n\telse\n\t\tmkdir -p ${DSTROOT}/Developer/usr/bin\n\t\tcp ${DSTROOT}/usr/bin/ld ${DSTROOT}/Developer/usr/bin\n\tfi\nfi\n\n";
+ showEnvVarsInLog = 0;
+ };
+ F9CCF765144CE244007CB524 /* make configure.h */ = {
+ isa = PBXShellScriptBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ );
+ inputPaths = (
+ );
+ name = "make configure.h";
+ outputPaths = (
+ "$(DERIVED_FILE_DIR)/configure.h",
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ shellPath = /bin/sh;
+ shellScript = "${SRCROOT}/src/create_configure\n";
+ showEnvVarsInLog = 0;
+ };
+ F9CCF76B144CE2AD007CB524 /* make configure.h */ = {
+ isa = PBXShellScriptBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ );
+ inputPaths = (
+ );
+ name = "make configure.h";
+ outputPaths = (
+ "$(DERIVED_FILE_DIR)/configure.h",
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ shellPath = /bin/sh;
+ shellScript = "${SRCROOT}/src/create_configure\n";
+ showEnvVarsInLog = 0;
+ };
+ F9CCF76F144CE2D6007CB524 /* make configure.h */ = {
+ isa = PBXShellScriptBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ );
+ inputPaths = (
+ );
+ name = "make configure.h";
+ outputPaths = (
+ "$(DERIVED_FILE_DIR)/configure.h",
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ shellPath = /bin/sh;
+ shellScript = "${SRCROOT}/src/create_configure\n";
+ showEnvVarsInLog = 0;
+ };
+ F9CCF773144CE304007CB524 /* make configure.h */ = {
+ isa = PBXShellScriptBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ );
+ inputPaths = (
+ );
+ name = "make configure.h";
+ outputPaths = (
+ "$(DERIVED_FILE_DIR)/configure.h",
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ shellPath = /bin/sh;
+ shellScript = "${SRCROOT}/src/create_configure\n";
+ showEnvVarsInLog = 0;
+ };
+ F9CCF77C144CE36B007CB524 /* make configure.h */ = {
+ isa = PBXShellScriptBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ );
+ inputPaths = (
+ );
+ name = "make configure.h";
+ outputPaths = (
+ "$(DERIVED_FILE_DIR)/configure.h",
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ shellPath = /bin/sh;
+ shellScript = "${SRCROOT}/src/create_configure\n";
+ showEnvVarsInLog = 0;
+ };
+ F9CCF781144CE3DF007CB524 /* make configure.h */ = {
+ isa = PBXShellScriptBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ );
+ inputPaths = (
+ );
+ name = "make configure.h";
+ outputPaths = (
+ "$(DERIVED_FILE_DIR)/configure.h",
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ shellPath = /bin/sh;
+ shellScript = "${SRCROOT}/src/create_configure\n";
+ showEnvVarsInLog = 0;
+ };
+ F9E8DB4D11921594007B4D6A /* make configure.h */ = {
+ isa = PBXShellScriptBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ );
+ inputPaths = (
+ );
+ name = "make configure.h";
+ outputPaths = (
+ "$(DERIVED_FILE_DIR)/configure.h",
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ shellPath = /bin/bash;
+ shellScript = "${SRCROOT}/src/create_configure\n";
+ showEnvVarsInLog = 0;
+ };
+/* End PBXShellScriptBuildPhase section */
+
+/* Begin PBXSourcesBuildPhase section */
+ F9023C3606D5A23E001BBF46 /* Sources */ = {
+ isa = PBXSourcesBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ F9C0D4BD06DD28D2001C7193 /* Options.cpp in Sources */,
+ F9023C4E06D5A272001BBF46 /* ld.cpp in Sources */,
+ F9AA65891051E750003E3539 /* macho_relocatable_file.cpp in Sources */,
+ F9AA65DD1051EC4A003E3539 /* archive_file.cpp in Sources */,
+ F9AA65DE1051EC4A003E3539 /* lto_file.cpp in Sources */,
+ F9AA65DF1051EC4A003E3539 /* macho_dylib_file.cpp in Sources */,
+ F9EA7584097882F3008B4F1D /* debugline.c in Sources */,
+ F9AA687C10572E27003E3539 /* InputFiles.cpp in Sources */,
+ F9AA69B610583C0C003E3539 /* SymbolTable.cpp in Sources */,
+ F9AA69C110583E19003E3539 /* Resolver.cpp in Sources */,
+ F989D30D106826020014B60C /* OutputFile.cpp in Sources */,
+ F9AA65111051BD2B003E3539 /* stubs.cpp in Sources */,
+ F9AA6786105700C2003E3539 /* opaque_section_file.cpp in Sources */,
+ F9AA67B610570C41003E3539 /* dtrace_dof.cpp in Sources */,
+ F98498A310AE2159009E9878 /* compact_unwind.cpp in Sources */,
+ F98498A410AE2159009E9878 /* got.cpp in Sources */,
+ F9BA955E10A233000097A440 /* huge.cpp in Sources */,
+ F9849E3610B38EF5009E9878 /* order.cpp in Sources */,
+ F984A38210BB4B0D009E9878 /* branch_island.cpp in Sources */,
+ F9A4DB9110F816FF00BD8423 /* objc.cpp in Sources */,
+ F9AE20FF1107D1440007ED5D /* dylibs.cpp in Sources */,
+ F93CB248116E69EB003233B8 /* tlvp.cpp in Sources */,
+ F9AA44DC1294885F00CB8390 /* branch_shim.cpp in Sources */,
+ B3B672421406D42800A376BB /* Snapshot.cpp in Sources */,
+ F9CC24191461FB4300A92174 /* blob.cpp in Sources */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ F971EED006D5ACF60041D381 /* Sources */ = {
+ isa = PBXSourcesBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ F9AA6FF910618CD2003E3539 /* macho_relocatable_file.cpp in Sources */,
+ F9AE23291109015E0007ED5D /* lto_file.cpp in Sources */,
+ F933E3D9092E855B0083EAC8 /* ObjectDump.cpp in Sources */,
+ F9EA75BC09788857008B4F1D /* debugline.c in Sources */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ F9A3DDC70ED762B700C590B9 /* Sources */ = {
+ isa = PBXSourcesBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ F9A3DDD30ED762E400C590B9 /* PruneTrie.cpp in Sources */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ F9B670020DDA176100E6D0DA /* Sources */ = {
+ isa = PBXSourcesBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ F9B670120DDA17E800E6D0DA /* UnwindDump.cpp in Sources */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ F9BA515E0ECE58BE00D1D62E /* Sources */ = {
+ isa = PBXSourcesBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ F9BA51650ECE58C800D1D62E /* dyldinfo.cpp in Sources */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ F9EA72C8097454A6008B4F1D /* Sources */ = {
+ isa = PBXSourcesBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ F9EA72D5097454FF008B4F1D /* machochecker.cpp in Sources */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ F9EC77EB0A2F85F6002A3E39 /* Sources */ = {
+ isa = PBXSourcesBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ F9EC78060A2F8674002A3E39 /* rebase.cpp in Sources */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+/* End PBXSourcesBuildPhase section */
+
+/* Begin PBXTargetDependency section */
+ F96904890A4333AC00B77D2A /* PBXTargetDependency */ = {
+ isa = PBXTargetDependency;
+ target = F9EC77ED0A2F85F6002A3E39 /* rebase */;
+ targetProxy = F96904880A4333AC00B77D2A /* PBXContainerItemProxy */;
+ };
+ F96D536A094A275D008E9EE8 /* PBXTargetDependency */ = {
+ isa = PBXTargetDependency;
+ target = F9023C3806D5A23E001BBF46 /* ld */;
+ targetProxy = F96D5369094A275D008E9EE8 /* PBXContainerItemProxy */;
+ };
+ F96D536C094A275F008E9EE8 /* PBXTargetDependency */ = {
+ isa = PBXTargetDependency;
+ target = F971EED206D5ACF60041D381 /* ObjectDump */;
+ targetProxy = F96D536B094A275F008E9EE8 /* PBXContainerItemProxy */;
+ };
+ F9A3DE160ED76D9A00C590B9 /* PBXTargetDependency */ = {
+ isa = PBXTargetDependency;
+ target = F9A3DDC90ED762B700C590B9 /* libprunetrie */;
+ targetProxy = F9A3DE150ED76D9A00C590B9 /* PBXContainerItemProxy */;
+ };
+ F9B1A2690A3A568200DA8FAB /* PBXTargetDependency */ = {
+ isa = PBXTargetDependency;
+ target = F9023C3806D5A23E001BBF46 /* ld */;
+ targetProxy = F9B1A2680A3A568200DA8FAB /* PBXContainerItemProxy */;
+ };
+ F9B1A26B0A3A568400DA8FAB /* PBXTargetDependency */ = {
+ isa = PBXTargetDependency;
+ target = F9EC77ED0A2F85F6002A3E39 /* rebase */;
+ targetProxy = F9B1A26A0A3A568400DA8FAB /* PBXContainerItemProxy */;
+ };
+ F9B693890EC4D28C00076912 /* PBXTargetDependency */ = {
+ isa = PBXTargetDependency;
+ target = F9B670010DDA176100E6D0DA /* unwinddump */;
+ targetProxy = F9B693880EC4D28C00076912 /* PBXContainerItemProxy */;
+ };
+ F9B8135D0EC2620E00F94C13 /* PBXTargetDependency */ = {
+ isa = PBXTargetDependency;
+ target = F9B670010DDA176100E6D0DA /* unwinddump */;
+ targetProxy = F9B8135C0EC2620E00F94C13 /* PBXContainerItemProxy */;
+ };
+ F9C12EEA0ED65765005BC69D /* PBXTargetDependency */ = {
+ isa = PBXTargetDependency;
+ target = F9BA51600ECE58BE00D1D62E /* dyldinfo */;
+ targetProxy = F9C12EE90ED65765005BC69D /* PBXContainerItemProxy */;
+ };
+ F9EA73970974999B008B4F1D /* PBXTargetDependency */ = {
+ isa = PBXTargetDependency;
+ target = F9EA72CA097454A6008B4F1D /* machocheck */;
+ targetProxy = F9EA73960974999B008B4F1D /* PBXContainerItemProxy */;
+ };
+ F9F9AD68116D58AF0028EFAB /* PBXTargetDependency */ = {
+ isa = PBXTargetDependency;
+ target = F9BA51600ECE58BE00D1D62E /* dyldinfo */;
+ targetProxy = F9F9AD67116D58AF0028EFAB /* PBXContainerItemProxy */;
+ };
+/* End PBXTargetDependency section */
+
+/* Begin XCBuildConfiguration section */
+ F933D91C09291AC90083EAC8 /* Debug */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ COPY_PHASE_STRIP = NO;
+ CURRENT_PROJECT_VERSION = "$(RC_ProjectSourceVersion)";
+ DEAD_CODE_STRIPPING = YES;
+ DEBUG_INFORMATION_FORMAT = dwarf;
+ GCC_DYNAMIC_NO_PIC = YES;
+ GCC_GENERATE_DEBUGGING_SYMBOLS = YES;
+ GCC_MODEL_TUNING = G5;
+ GCC_OPTIMIZATION_LEVEL = 0;
+ GCC_PREPROCESSOR_DEFINITIONS = DEBUG;
+ GCC_TREAT_WARNINGS_AS_ERRORS = YES;
+ GCC_WARN_ABOUT_INVALID_OFFSETOF_MACRO = NO;
+ GCC_WARN_ABOUT_MISSING_NEWLINE = YES;
+ GCC_WARN_ABOUT_MISSING_PROTOTYPES = YES;
+ GCC_WARN_ABOUT_POINTER_SIGNEDNESS = NO;
+ GCC_WARN_ABOUT_RETURN_TYPE = YES;
+ GCC_WARN_CHECK_SWITCH_STATEMENTS = YES;
+ GCC_WARN_EFFECTIVE_CPLUSPLUS_VIOLATIONS = NO;
+ GCC_WARN_FOUR_CHARACTER_CONSTANTS = YES;
+ GCC_WARN_HIDDEN_VIRTUAL_FUNCTIONS = YES;
+ GCC_WARN_INITIALIZER_NOT_FULLY_BRACKETED = YES;
+ GCC_WARN_MISSING_PARENTHESES = YES;
+ GCC_WARN_NON_VIRTUAL_DESTRUCTOR = NO;
+ GCC_WARN_PEDANTIC = NO;
+ GCC_WARN_SHADOW = NO;
+ GCC_WARN_SIGN_COMPARE = YES;
+ GCC_WARN_TYPECHECK_CALLS_TO_PRINTF = YES;
+ GCC_WARN_UNINITIALIZED_AUTOS = NO;
+ GCC_WARN_UNKNOWN_PRAGMAS = YES;
+ GCC_WARN_UNUSED_FUNCTION = YES;
+ GCC_WARN_UNUSED_LABEL = YES;
+ GCC_WARN_UNUSED_PARAMETER = NO;
+ GCC_WARN_UNUSED_VALUE = YES;
+ GCC_WARN_UNUSED_VARIABLE = YES;
+ HEADER_SEARCH_PATHS = (
+ "$(DT_TOOLCHAIN_DIR)/usr/local/include",
+ "$(DEVELOPER_DIR)/usr/local/include",
+ "$(DEVELOPER_DIR)/usr/include",
+ );
+ INSTALL_PATH = /usr/bin;
+ LINKER_DISPLAYS_MANGLED_NAMES = NO;
+ MACOSX_DEPLOYMENT_TARGET = "";
+ OTHER_CPLUSPLUSFLAGS = "$(OTHER_CPLUSPLUSFLAGS)";
+ OTHER_LDFLAGS = (
+ "@$(DERIVED_SOURCES_DIR)/LTO_option.txt",
+ "-Wl,-exported_symbol,__mh_execute_header",
+ );
+ PREBINDING = NO;
+ PRODUCT_NAME = ld;
+ SECTORDER_FLAGS = "";
+ VERSIONING_SYSTEM = "apple-generic";
+ WARNING_CFLAGS = "-Wall";
+ };
+ name = Debug;
+ };
+ F933D91D09291AC90083EAC8 /* Release */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ COPY_PHASE_STRIP = NO;
+ CURRENT_PROJECT_VERSION = "$(RC_ProjectSourceVersion)";
+ DEAD_CODE_STRIPPING = YES;
+ DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
+ GCC_DYNAMIC_NO_PIC = YES;
+ GCC_GENERATE_DEBUGGING_SYMBOLS = YES;
+ GCC_OPTIMIZATION_LEVEL = 3;
+ GCC_PREPROCESSOR_DEFINITIONS = (
+ "$(GCC_PREPROCESSOR_DEFINITIONS_QUOTED_FOR_TARGET_1)",
+ NDEBUG,
+ "$(GCC_PREPROCESSOR_DEFINITIONS_$(RC_RELEASE))",
+ );
+ GCC_PREPROCESSOR_DEFINITIONS_QUOTED_FOR_TARGET_1 = "LD_VERS='\"ld64-$(RC_ProjectSourceVersion)\"'";
+ GCC_TREAT_WARNINGS_AS_ERRORS = NO;
+ GCC_WARN_ABOUT_INVALID_OFFSETOF_MACRO = NO;
+ GCC_WARN_ABOUT_MISSING_NEWLINE = YES;
+ GCC_WARN_ABOUT_MISSING_PROTOTYPES = YES;
+ GCC_WARN_ABOUT_POINTER_SIGNEDNESS = NO;
+ GCC_WARN_ABOUT_RETURN_TYPE = YES;
+ GCC_WARN_CHECK_SWITCH_STATEMENTS = YES;
+ GCC_WARN_EFFECTIVE_CPLUSPLUS_VIOLATIONS = NO;
+ GCC_WARN_FOUR_CHARACTER_CONSTANTS = YES;
+ GCC_WARN_HIDDEN_VIRTUAL_FUNCTIONS = YES;
+ GCC_WARN_INITIALIZER_NOT_FULLY_BRACKETED = YES;
+ GCC_WARN_MISSING_PARENTHESES = YES;
+ GCC_WARN_NON_VIRTUAL_DESTRUCTOR = NO;
+ GCC_WARN_PEDANTIC = NO;
+ GCC_WARN_SHADOW = NO;
+ GCC_WARN_SIGN_COMPARE = YES;
+ GCC_WARN_TYPECHECK_CALLS_TO_PRINTF = YES;
+ GCC_WARN_UNINITIALIZED_AUTOS = NO;
+ GCC_WARN_UNKNOWN_PRAGMAS = YES;
+ GCC_WARN_UNUSED_FUNCTION = YES;
+ GCC_WARN_UNUSED_LABEL = YES;
+ GCC_WARN_UNUSED_PARAMETER = NO;
+ GCC_WARN_UNUSED_VALUE = YES;
+ GCC_WARN_UNUSED_VARIABLE = YES;
+ HEADER_SEARCH_PATHS = (
+ "$(DT_TOOLCHAIN_DIR)/usr/local/include",
+ "$(DEVELOPER_DIR)/usr/local/include",
+ "$(DEVELOPER_DIR)/usr/include",
+ );
+ INSTALL_PATH = /usr/bin;
+ OTHER_CPLUSPLUSFLAGS = "$(OTHER_CPLUSPLUSFLAGS)";
+ OTHER_LDFLAGS = (
+ "@$(DERIVED_SOURCES_DIR)/LTO_option.txt",
+ "-Wl,-exported_symbol,__mh_execute_header",
+ );
+ PREBINDING = NO;
+ PRODUCT_NAME = ld;
+ SECTORDER_FLAGS = "";
+ STRIP_INSTALLED_PRODUCT = YES;
+ STRIP_STYLE = debugging;
+ VALID_ARCHS = "x86_64 i386 ppc";
+ VERSIONING_SYSTEM = "apple-generic";
+ WARNING_CFLAGS = "-Wall";
+ };
+ name = Release;
+ };
+ F933D92009291AC90083EAC8 /* Debug */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ COPY_PHASE_STRIP = NO;
+ DEBUG_INFORMATION_FORMAT = dwarf;
+ GCC_GENERATE_DEBUGGING_SYMBOLS = YES;
+ GCC_MODEL_TUNING = G5;
+ GCC_OPTIMIZATION_LEVEL = 0;
+ GCC_WARN_ABOUT_INVALID_OFFSETOF_MACRO = NO;
+ GCC_WARN_ABOUT_MISSING_PROTOTYPES = YES;
+ GCC_WARN_ABOUT_RETURN_TYPE = YES;
+ GCC_WARN_CHECK_SWITCH_STATEMENTS = YES;
+ GCC_WARN_HIDDEN_VIRTUAL_FUNCTIONS = YES;
+ GCC_WARN_SHADOW = YES;
+ GCC_WARN_UNUSED_FUNCTION = YES;
+ GCC_WARN_UNUSED_VALUE = YES;
+ GCC_WARN_UNUSED_VARIABLE = YES;
+ HEADER_SEARCH_PATHS = (
+ "$(SRCROOT)/src/ld",
+ "$(DEVELOPER_DIR)/usr/local/include",
+ );
+ INSTALL_PATH = "$(HOME)/bin";
+ OTHER_LDFLAGS = "@$(DERIVED_SOURCES_DIR)/LTO_option.txt";
+ OTHER_REZFLAGS = "";
+ PREBINDING = NO;
+ PRODUCT_NAME = ObjectDump;
+ SECTORDER_FLAGS = "";
+ WARNING_CFLAGS = (
+ "-Wmost",
+ "-Wno-four-char-constants",
+ "-Wno-unknown-pragmas",
+ );
+ };
+ name = Debug;
+ };
+ F933D92109291AC90083EAC8 /* Release */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ COPY_PHASE_STRIP = YES;
+ DEBUG_INFORMATION_FORMAT = dwarf;
+ GCC_GENERATE_DEBUGGING_SYMBOLS = YES;
+ GCC_MODEL_TUNING = G5;
+ GCC_OPTIMIZATION_LEVEL = s;
+ GCC_PREPROCESSOR_DEFINITIONS = NDEBUG;
+ HEADER_SEARCH_PATHS = (
+ "$(SRCROOT)/src/ld",
+ "$(DEVELOPER_DIR)/usr/local/include",
+ );
+ INSTALL_PATH = "$(HOME)/bin";
+ OTHER_LDFLAGS = "@$(DERIVED_SOURCES_DIR)/LTO_option.txt";
+ OTHER_REZFLAGS = "";
+ PREBINDING = NO;
+ PRODUCT_NAME = ObjectDump;
+ WARNING_CFLAGS = (
+ "-Wmost",
+ "-Wno-four-char-constants",
+ "-Wno-unknown-pragmas",
+ );
+ };
+ name = Release;
+ };
+ F933D92409291AC90083EAC8 /* Debug */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ ARCHS = "$(ARCHS_STANDARD_64_BIT_PRE_XCODE_3_1)";
+ ARCHS_STANDARD_64_BIT_PRE_XCODE_3_1 = x86_64;
+ GCC_DYNAMIC_NO_PIC = NO;
+ GCC_TREAT_WARNINGS_AS_ERRORS = NO;
+ };
+ name = Debug;
+ };
+ F933D92509291AC90083EAC8 /* Release */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ ARCHS = "$(ARCHS_STANDARD_64_BIT_PRE_XCODE_3_1)";
+ ARCHS_STANDARD_64_BIT_PRE_XCODE_3_1 = x86_64;
+ GCC_DYNAMIC_NO_PIC = NO;
+ GCC_TREAT_WARNINGS_AS_ERRORS = NO;
+ };
+ name = Release;
+ };
+ F96D536E094A2773008E9EE8 /* Debug */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ COPY_PHASE_STRIP = NO;
+ GCC_GENERATE_DEBUGGING_SYMBOLS = YES;
+ PRODUCT_NAME = "unit-tests";
+ };
+ name = Debug;
+ };
+ F96D536F094A2773008E9EE8 /* Release */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ COPY_PHASE_STRIP = YES;
+ GCC_GENERATE_DEBUGGING_SYMBOLS = NO;
+ PRODUCT_NAME = "unit-tests";
+ };
+ name = Release;
+ };
+ F9849FF810B5DE8E009E9878 /* Release-assert */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ ARCHS = "$(ARCHS_STANDARD_64_BIT_PRE_XCODE_3_1)";
+ ARCHS_STANDARD_64_BIT_PRE_XCODE_3_1 = x86_64;
+ GCC_DYNAMIC_NO_PIC = NO;
+ GCC_TREAT_WARNINGS_AS_ERRORS = NO;
+ };
+ name = "Release-assert";
+ };
+ F9849FF910B5DE8E009E9878 /* Release-assert */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ COPY_PHASE_STRIP = YES;
+ GCC_ENABLE_FIX_AND_CONTINUE = NO;
+ GCC_GENERATE_DEBUGGING_SYMBOLS = NO;
+ PRODUCT_NAME = all;
+ ZERO_LINK = NO;
+ };
+ name = "Release-assert";
+ };
+ F9849FFA10B5DE8E009E9878 /* Release-assert */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ COPY_PHASE_STRIP = NO;
+ CURRENT_PROJECT_VERSION = "$(RC_ProjectSourceVersion)";
+ DEAD_CODE_STRIPPING = YES;
+ DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
+ GCC_DYNAMIC_NO_PIC = YES;
+ GCC_GENERATE_DEBUGGING_SYMBOLS = YES;
+ GCC_OPTIMIZATION_LEVEL = 3;
+ GCC_PREPROCESSOR_DEFINITIONS = (
+ "$(GCC_PREPROCESSOR_DEFINITIONS_QUOTED_FOR_TARGET_1)",
+ "$(GCC_PREPROCESSOR_DEFINITIONS_$(RC_RELEASE))",
+ );
+ GCC_PREPROCESSOR_DEFINITIONS_QUOTED_FOR_TARGET_1 = "LD_VERS='\"ld64-$(RC_ProjectSourceVersion)\"'";
+ GCC_TREAT_WARNINGS_AS_ERRORS = NO;
+ GCC_WARN_ABOUT_INVALID_OFFSETOF_MACRO = NO;
+ GCC_WARN_ABOUT_MISSING_NEWLINE = YES;
+ GCC_WARN_ABOUT_MISSING_PROTOTYPES = YES;
+ GCC_WARN_ABOUT_POINTER_SIGNEDNESS = NO;
+ GCC_WARN_ABOUT_RETURN_TYPE = YES;
+ GCC_WARN_CHECK_SWITCH_STATEMENTS = YES;
+ GCC_WARN_EFFECTIVE_CPLUSPLUS_VIOLATIONS = NO;
+ GCC_WARN_FOUR_CHARACTER_CONSTANTS = YES;
+ GCC_WARN_HIDDEN_VIRTUAL_FUNCTIONS = YES;
+ GCC_WARN_INITIALIZER_NOT_FULLY_BRACKETED = YES;
+ GCC_WARN_MISSING_PARENTHESES = YES;
+ GCC_WARN_NON_VIRTUAL_DESTRUCTOR = NO;
+ GCC_WARN_PEDANTIC = NO;
+ GCC_WARN_SHADOW = NO;
+ GCC_WARN_SIGN_COMPARE = YES;
+ GCC_WARN_TYPECHECK_CALLS_TO_PRINTF = YES;
+ GCC_WARN_UNINITIALIZED_AUTOS = NO;
+ GCC_WARN_UNKNOWN_PRAGMAS = YES;
+ GCC_WARN_UNUSED_FUNCTION = YES;
+ GCC_WARN_UNUSED_LABEL = YES;
+ GCC_WARN_UNUSED_PARAMETER = NO;
+ GCC_WARN_UNUSED_VALUE = YES;
+ GCC_WARN_UNUSED_VARIABLE = YES;
+ HEADER_SEARCH_PATHS = (
+ "$(DT_TOOLCHAIN_DIR)/usr/local/include",
+ "$(DEVELOPER_DIR)/usr/local/include",
+ "$(DEVELOPER_DIR)/usr/include",
+ );
+ INSTALL_PATH = /usr/bin;
+ OTHER_CPLUSPLUSFLAGS = "$(OTHER_CPLUSPLUSFLAGS)";
+ OTHER_LDFLAGS = (
+ "@$(DERIVED_SOURCES_DIR)/LTO_option.txt",
+ "-Wl,-exported_symbol,__mh_execute_header",
+ );
+ PREBINDING = NO;
+ PRODUCT_NAME = ld;
+ SECTORDER_FLAGS = "";
+ STRIP_INSTALLED_PRODUCT = YES;
+ STRIP_STYLE = debugging;
+ VALID_ARCHS = "x86_64 i386 ppc";
+ VERSIONING_SYSTEM = "apple-generic";
+ WARNING_CFLAGS = "-Wall";
+ };
+ name = "Release-assert";
+ };
+ F9849FFB10B5DE8E009E9878 /* Release-assert */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ COPY_PHASE_STRIP = NO;
+ DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
+ GCC_GENERATE_DEBUGGING_SYMBOLS = YES;
+ GCC_MODEL_TUNING = G5;
+ GCC_PREPROCESSOR_DEFINITIONS = "$(GCC_PREPROCESSOR_DEFINITIONS_$(RC_RELEASE))";
+ HEADER_SEARCH_PATHS = "";
+ INSTALL_PATH = /usr/bin;
+ OTHER_LDFLAGS = "-Wl,-exported_symbol,__mh_execute_header";
+ PREBINDING = NO;
+ PRODUCT_NAME = rebase;
+ STRIP_INSTALLED_PRODUCT = YES;
+ STRIP_STYLE = debugging;
+ VALID_ARCHS = "i386 ppc x86_64";
+ };
+ name = "Release-assert";
+ };
+ F9849FFC10B5DE8E009E9878 /* Release-assert */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ COPY_PHASE_STRIP = NO;
+ DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
+ GCC_GENERATE_DEBUGGING_SYMBOLS = YES;
+ GCC_MODEL_TUNING = G5;
+ GCC_WARN_ABOUT_INVALID_OFFSETOF_MACRO = NO;
+ GCC_WARN_TYPECHECK_CALLS_TO_PRINTF = YES;
+ HEADER_SEARCH_PATHS = "";
+ INSTALL_PATH = /usr/bin;
+ OTHER_LDFLAGS = "-Wl,-exported_symbol,__mh_execute_header";
+ PREBINDING = NO;
+ PRODUCT_NAME = unwinddump;
+ STRIP_INSTALLED_PRODUCT = YES;
+ STRIP_STYLE = debugging;
+ };
+ name = "Release-assert";
+ };
+ F9849FFD10B5DE8E009E9878 /* Release-assert */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ COPY_PHASE_STRIP = YES;
+ DEBUG_INFORMATION_FORMAT = dwarf;
+ GCC_GENERATE_DEBUGGING_SYMBOLS = YES;
+ GCC_MODEL_TUNING = G5;
+ GCC_OPTIMIZATION_LEVEL = s;
+ GCC_PREPROCESSOR_DEFINITIONS = NDEBUG;
+ GCC_WARN_ABOUT_INVALID_OFFSETOF_MACRO = NO;
+ HEADER_SEARCH_PATHS = (
+ "$(SRCROOT)/src/ld",
+ "$(DEVELOPER_DIR)/usr/local/include",
+ );
+ INSTALL_PATH = "$(HOME)/bin";
+ OTHER_LDFLAGS = "@$(DERIVED_SOURCES_DIR)/LTO_option.txt";
+ OTHER_REZFLAGS = "";
+ PREBINDING = NO;
+ PRODUCT_NAME = ObjectDump;
+ WARNING_CFLAGS = (
+ "-Wmost",
+ "-Wno-four-char-constants",
+ "-Wno-unknown-pragmas",
+ );
+ };
+ name = "Release-assert";
+ };
+ F9849FFE10B5DE8E009E9878 /* Release-assert */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ COPY_PHASE_STRIP = YES;
+ DEBUG_INFORMATION_FORMAT = dwarf;
+ GCC_GENERATE_DEBUGGING_SYMBOLS = YES;
+ GCC_MODEL_TUNING = G5;
+ HEADER_SEARCH_PATHS = "";
+ INSTALL_PATH = "$(HOME)/bin";
+ PREBINDING = NO;
+ PRODUCT_NAME = machocheck;
+ };
+ name = "Release-assert";
+ };
+ F9849FFF10B5DE8E009E9878 /* Release-assert */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ ALWAYS_SEARCH_USER_PATHS = NO;
+ COPY_PHASE_STRIP = NO;
+ DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
+ GCC_ENABLE_FIX_AND_CONTINUE = NO;
+ GCC_MODEL_TUNING = G5;
+ INSTALL_PATH = /usr/bin;
+ OTHER_LDFLAGS = "-Wl,-exported_symbol,__mh_execute_header";
+ PREBINDING = NO;
+ PRODUCT_NAME = dyldinfo;
+ STRIP_INSTALLED_PRODUCT = YES;
+ STRIP_STYLE = debugging;
+ ZERO_LINK = NO;
+ };
+ name = "Release-assert";
+ };
+ F984A00010B5DE8E009E9878 /* Release-assert */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ ALWAYS_SEARCH_USER_PATHS = NO;
+ COPY_PHASE_STRIP = NO;
+ DEBUG_INFORMATION_FORMAT = dwarf;
+ GCC_ENABLE_FIX_AND_CONTINUE = NO;
+ GCC_MODEL_TUNING = G5;
+ GCC_SYMBOLS_PRIVATE_EXTERN = YES;
+ INSTALL_PATH = /usr/local/lib;
+ PREBINDING = NO;
+ PRODUCT_NAME = prunetrie;
+ };
+ name = "Release-assert";
+ };
+ F984A00110B5DE8E009E9878 /* Release-assert */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ COPY_PHASE_STRIP = YES;
+ GCC_GENERATE_DEBUGGING_SYMBOLS = NO;
+ PRODUCT_NAME = "unit-tests";
+ };
+ name = "Release-assert";
+ };
+ F9A3DDCB0ED762B800C590B9 /* Debug */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ ALWAYS_SEARCH_USER_PATHS = NO;
+ COPY_PHASE_STRIP = NO;
+ GCC_DYNAMIC_NO_PIC = NO;
+ GCC_MODEL_TUNING = G5;
+ GCC_OPTIMIZATION_LEVEL = 0;
+ GCC_SYMBOLS_PRIVATE_EXTERN = YES;
+ GCC_WARN_ABOUT_MISSING_PROTOTYPES = YES;
+ INSTALL_PATH = /usr/local/lib;
+ PREBINDING = NO;
+ PRODUCT_NAME = prunetrie;
+ };
+ name = Debug;
+ };
+ F9A3DDCC0ED762B800C590B9 /* Release */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ ALWAYS_SEARCH_USER_PATHS = NO;
+ COPY_PHASE_STRIP = NO;
+ DEBUG_INFORMATION_FORMAT = dwarf;
+ GCC_ENABLE_FIX_AND_CONTINUE = NO;
+ GCC_MODEL_TUNING = G5;
+ GCC_SYMBOLS_PRIVATE_EXTERN = YES;
+ INSTALL_PATH = /usr/local/lib;
+ PREBINDING = NO;
+ PRODUCT_NAME = prunetrie;
+ };
+ name = Release;
+ };
+ F9B1A26D0A3A568700DA8FAB /* Debug */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ COPY_PHASE_STRIP = NO;
+ GCC_DYNAMIC_NO_PIC = NO;
+ GCC_GENERATE_DEBUGGING_SYMBOLS = YES;
+ GCC_OPTIMIZATION_LEVEL = 0;
+ PRODUCT_NAME = all;
+ };
+ name = Debug;
+ };
+ F9B1A26E0A3A568700DA8FAB /* Release */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ COPY_PHASE_STRIP = YES;
+ GCC_ENABLE_FIX_AND_CONTINUE = NO;
+ GCC_GENERATE_DEBUGGING_SYMBOLS = NO;
+ PRODUCT_NAME = all;
+ ZERO_LINK = NO;
+ };
+ name = Release;
+ };
+ F9B670060DDA176100E6D0DA /* Debug */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ COPY_PHASE_STRIP = NO;
+ DEBUG_INFORMATION_FORMAT = dwarf;
+ GCC_GENERATE_DEBUGGING_SYMBOLS = YES;
+ GCC_MODEL_TUNING = G5;
+ GCC_OPTIMIZATION_LEVEL = 0;
+ GCC_WARN_ABOUT_INVALID_OFFSETOF_MACRO = NO;
+ GCC_WARN_TYPECHECK_CALLS_TO_PRINTF = YES;
+ INSTALL_PATH = "$(HOME)/bin";
+ PREBINDING = NO;
+ PRODUCT_NAME = unwinddump;
+ };
+ name = Debug;
+ };
+ F9B670070DDA176100E6D0DA /* Release */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ COPY_PHASE_STRIP = NO;
+ DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
+ GCC_GENERATE_DEBUGGING_SYMBOLS = YES;
+ GCC_MODEL_TUNING = G5;
+ GCC_WARN_ABOUT_INVALID_OFFSETOF_MACRO = NO;
+ GCC_WARN_TYPECHECK_CALLS_TO_PRINTF = YES;
+ HEADER_SEARCH_PATHS = "";
+ INSTALL_PATH = /usr/bin;
+ OTHER_LDFLAGS = "-Wl,-exported_symbol,__mh_execute_header";
+ PREBINDING = NO;
+ PRODUCT_NAME = unwinddump;
+ STRIP_INSTALLED_PRODUCT = YES;
+ STRIP_STYLE = debugging;
+ };
+ name = Release;
+ };
+ F9BA51630ECE58BF00D1D62E /* Debug */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ ALWAYS_SEARCH_USER_PATHS = NO;
+ COPY_PHASE_STRIP = NO;
+ GCC_DYNAMIC_NO_PIC = NO;
+ GCC_ENABLE_FIX_AND_CONTINUE = NO;
+ GCC_MODEL_TUNING = G5;
+ GCC_OPTIMIZATION_LEVEL = 0;
+ GCC_WARN_ABOUT_MISSING_PROTOTYPES = YES;
+ GCC_WARN_ABOUT_RETURN_TYPE = YES;
+ GCC_WARN_CHECK_SWITCH_STATEMENTS = YES;
+ GCC_WARN_HIDDEN_VIRTUAL_FUNCTIONS = YES;
+ GCC_WARN_MISSING_PARENTHESES = YES;
+ GCC_WARN_SHADOW = YES;
+ GCC_WARN_TYPECHECK_CALLS_TO_PRINTF = YES;
+ GCC_WARN_UNUSED_LABEL = NO;
+ GCC_WARN_UNUSED_VALUE = YES;
+ GCC_WARN_UNUSED_VARIABLE = YES;
+ INSTALL_PATH = /usr/local/bin;
+ PREBINDING = NO;
+ PRODUCT_NAME = dyldinfo;
+ WARNING_CFLAGS = "-Wall";
+ };
+ name = Debug;
+ };
+ F9BA51640ECE58BF00D1D62E /* Release */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ ALWAYS_SEARCH_USER_PATHS = NO;
+ COPY_PHASE_STRIP = NO;
+ DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
+ GCC_ENABLE_FIX_AND_CONTINUE = NO;
+ GCC_MODEL_TUNING = G5;
+ INSTALL_PATH = /usr/bin;
+ OTHER_LDFLAGS = "-Wl,-exported_symbol,__mh_execute_header";
+ PREBINDING = NO;
+ PRODUCT_NAME = dyldinfo;
+ STRIP_INSTALLED_PRODUCT = YES;
+ STRIP_STYLE = debugging;
+ ZERO_LINK = NO;
+ };
+ name = Release;
+ };
+ F9EA72D0097454D5008B4F1D /* Debug */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ COPY_PHASE_STRIP = NO;
+ DEBUG_INFORMATION_FORMAT = dwarf;
+ GCC_GENERATE_DEBUGGING_SYMBOLS = YES;
+ GCC_MODEL_TUNING = G5;
+ GCC_OPTIMIZATION_LEVEL = 0;
+ INSTALL_PATH = "$(HOME)/bin";
+ PREBINDING = NO;
+ PRODUCT_NAME = machocheck;
+ };
+ name = Debug;
+ };
+ F9EA72D1097454D5008B4F1D /* Release */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ COPY_PHASE_STRIP = YES;
+ DEBUG_INFORMATION_FORMAT = dwarf;
+ GCC_GENERATE_DEBUGGING_SYMBOLS = YES;
+ GCC_MODEL_TUNING = G5;
+ HEADER_SEARCH_PATHS = "";
+ INSTALL_PATH = "$(HOME)/bin";
+ PREBINDING = NO;
+ PRODUCT_NAME = machocheck;
+ };
+ name = Release;
+ };
+ F9EC77F10A2F8616002A3E39 /* Debug */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ COPY_PHASE_STRIP = NO;
+ DEBUG_INFORMATION_FORMAT = dwarf;
+ GCC_DYNAMIC_NO_PIC = NO;
+ GCC_GENERATE_DEBUGGING_SYMBOLS = YES;
+ GCC_MODEL_TUNING = G5;
+ GCC_OPTIMIZATION_LEVEL = 0;
+ INSTALL_PATH = "$(HOME)/bin";
+ PREBINDING = NO;
+ PRODUCT_NAME = rebase;
+ };
+ name = Debug;
+ };
+ F9EC77F20A2F8616002A3E39 /* Release */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ COPY_PHASE_STRIP = NO;
+ DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
+ GCC_GENERATE_DEBUGGING_SYMBOLS = YES;
+ GCC_MODEL_TUNING = G5;
+ GCC_PREPROCESSOR_DEFINITIONS = "$(GCC_PREPROCESSOR_DEFINITIONS_$(RC_RELEASE))";
+ HEADER_SEARCH_PATHS = "";
+ INSTALL_PATH = /usr/bin;
+ OTHER_LDFLAGS = "-Wl,-exported_symbol,__mh_execute_header";
+ PREBINDING = NO;
+ PRODUCT_NAME = rebase;
+ STRIP_INSTALLED_PRODUCT = YES;
+ STRIP_STYLE = debugging;
+ VALID_ARCHS = "i386 ppc x86_64";
+ };
+ name = Release;
+ };
+/* End XCBuildConfiguration section */
+
+/* Begin XCConfigurationList section */
+ F933D91B09291AC90083EAC8 /* Build configuration list for PBXNativeTarget "ld" */ = {
+ isa = XCConfigurationList;
+ buildConfigurations = (
+ F933D91C09291AC90083EAC8 /* Debug */,
+ F933D91D09291AC90083EAC8 /* Release */,
+ F9849FFA10B5DE8E009E9878 /* Release-assert */,
+ );
+ defaultConfigurationIsVisible = 0;
+ defaultConfigurationName = "Release-assert";
+ };
+ F933D91F09291AC90083EAC8 /* Build configuration list for PBXNativeTarget "ObjectDump" */ = {
+ isa = XCConfigurationList;
+ buildConfigurations = (
+ F933D92009291AC90083EAC8 /* Debug */,
+ F933D92109291AC90083EAC8 /* Release */,
+ F9849FFD10B5DE8E009E9878 /* Release-assert */,
+ );
+ defaultConfigurationIsVisible = 0;
+ defaultConfigurationName = "Release-assert";
+ };
+ F933D92309291AC90083EAC8 /* Build configuration list for PBXProject "ld64" */ = {
+ isa = XCConfigurationList;
+ buildConfigurations = (
+ F933D92409291AC90083EAC8 /* Debug */,
+ F933D92509291AC90083EAC8 /* Release */,
+ F9849FF810B5DE8E009E9878 /* Release-assert */,
+ );
+ defaultConfigurationIsVisible = 0;
+ defaultConfigurationName = "Release-assert";
+ };
+ F96D536D094A2773008E9EE8 /* Build configuration list for PBXAggregateTarget "unit-tests" */ = {
+ isa = XCConfigurationList;
+ buildConfigurations = (
+ F96D536E094A2773008E9EE8 /* Debug */,
+ F96D536F094A2773008E9EE8 /* Release */,
+ F984A00110B5DE8E009E9878 /* Release-assert */,
+ );
+ defaultConfigurationIsVisible = 0;
+ defaultConfigurationName = "Release-assert";
+ };
+ F9A3DDCF0ED762C100C590B9 /* Build configuration list for PBXNativeTarget "libprunetrie" */ = {
+ isa = XCConfigurationList;
+ buildConfigurations = (
+ F9A3DDCB0ED762B800C590B9 /* Debug */,
+ F9A3DDCC0ED762B800C590B9 /* Release */,
+ F984A00010B5DE8E009E9878 /* Release-assert */,
+ );
+ defaultConfigurationIsVisible = 0;
+ defaultConfigurationName = "Release-assert";
+ };
+ F9B1A26C0A3A568700DA8FAB /* Build configuration list for PBXAggregateTarget "all" */ = {
+ isa = XCConfigurationList;
+ buildConfigurations = (
+ F9B1A26D0A3A568700DA8FAB /* Debug */,
+ F9B1A26E0A3A568700DA8FAB /* Release */,
+ F9849FF910B5DE8E009E9878 /* Release-assert */,
+ );
+ defaultConfigurationIsVisible = 0;
+ defaultConfigurationName = "Release-assert";
+ };
+ F9B670050DDA176100E6D0DA /* Build configuration list for PBXNativeTarget "unwinddump" */ = {
+ isa = XCConfigurationList;
+ buildConfigurations = (
+ F9B670060DDA176100E6D0DA /* Debug */,
+ F9B670070DDA176100E6D0DA /* Release */,
+ F9849FFC10B5DE8E009E9878 /* Release-assert */,
+ );
+ defaultConfigurationIsVisible = 0;
+ defaultConfigurationName = "Release-assert";
+ };
+ F9BA516D0ECE58DA00D1D62E /* Build configuration list for PBXNativeTarget "dyldinfo" */ = {
+ isa = XCConfigurationList;
+ buildConfigurations = (
+ F9BA51630ECE58BF00D1D62E /* Debug */,
+ F9BA51640ECE58BF00D1D62E /* Release */,
+ F9849FFF10B5DE8E009E9878 /* Release-assert */,
+ );
+ defaultConfigurationIsVisible = 0;
+ defaultConfigurationName = "Release-assert";
+ };
+ F9EA72CF097454D5008B4F1D /* Build configuration list for PBXNativeTarget "machocheck" */ = {
+ isa = XCConfigurationList;
+ buildConfigurations = (
+ F9EA72D0097454D5008B4F1D /* Debug */,
+ F9EA72D1097454D5008B4F1D /* Release */,
+ F9849FFE10B5DE8E009E9878 /* Release-assert */,
+ );
+ defaultConfigurationIsVisible = 0;
+ defaultConfigurationName = "Release-assert";
+ };
+ F9EC77F00A2F8616002A3E39 /* Build configuration list for PBXNativeTarget "rebase" */ = {
+ isa = XCConfigurationList;
+ buildConfigurations = (
+ F9EC77F10A2F8616002A3E39 /* Debug */,
+ F9EC77F20A2F8616002A3E39 /* Release */,
+ F9849FFB10B5DE8E009E9878 /* Release-assert */,
+ );
+ defaultConfigurationIsVisible = 0;
+ defaultConfigurationName = "Release-assert";
+ };
+/* End XCConfigurationList section */
+ };
+ rootObject = F9023C3006D5A227001BBF46 /* Project object */;
+}
diff --git a/ld64-134.9/src/abstraction/FileAbstraction.hpp b/ld64-134.9/src/abstraction/FileAbstraction.hpp
new file mode 100644
index 0000000..8517e87
--- /dev/null
+++ b/ld64-134.9/src/abstraction/FileAbstraction.hpp
@@ -0,0 +1,147 @@
+/* -*- mode: C++; c-basic-offset: 4; tab-width: 4 -*-
+ *
+ * Copyright (c) 2005 Apple Inc. All rights reserved.
+ *
+ * @APPLE_LICENSE_HEADER_START@
+ *
+ * This file contains Original Code and/or Modifications of Original Code
+ * as defined in and that are subject to the Apple Public Source License
+ * Version 2.0 (the 'License'). You may not use this file except in
+ * compliance with the License. Please obtain a copy of the License at
+ * http://www.opensource.apple.com/apsl/ and read it before using this
+ * file.
+ *
+ * The Original Code and all software distributed under the License are
+ * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
+ * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
+ * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
+ * Please see the License for the specific language governing rights and
+ * limitations under the License.
+ *
+ * @APPLE_LICENSE_HEADER_END@
+ */
+#ifndef __FILE_ABSTRACTION__
+#define __FILE_ABSTRACTION__
+
+
+#include
+#include
+#include
+
+#ifdef __OPTIMIZE__
+#define INLINE __attribute__((always_inline))
+#else
+#define INLINE
+#endif
+
+//
+// This abstraction layer is for use with file formats that have 64-bit/32-bit and Big-Endian/Little-Endian variants
+//
+// For example: to make a utility that handles 32-bit little enidan files use: Pointer32
+//
+//
+// get16() read a 16-bit number from an E endian struct
+// set16() write a 16-bit number to an E endian struct
+// get32() read a 32-bit number from an E endian struct
+// set32() write a 32-bit number to an E endian struct
+// get64() read a 64-bit number from an E endian struct
+// set64() write a 64-bit number to an E endian struct
+//
+// getBits() read a bit field from an E endian struct (bitCount=number of bits in field, firstBit=bit index of field)
+// setBits() write a bit field to an E endian struct (bitCount=number of bits in field, firstBit=bit index of field)
+//
+// getBitsRaw() read a bit field from a struct with native endianness
+// setBitsRaw() write a bit field from a struct with native endianness
+//
+
+class BigEndian
+{
+public:
+ static uint16_t get16(const uint16_t& from) INLINE { return OSReadBigInt16(&from, 0); }
+ static void set16(uint16_t& into, uint16_t value) INLINE { OSWriteBigInt16(&into, 0, value); }
+
+ static uint32_t get32(const uint32_t& from) INLINE { return OSReadBigInt32(&from, 0); }
+ static void set32(uint32_t& into, uint32_t value) INLINE { OSWriteBigInt32(&into, 0, value); }
+
+ static uint64_t get64(const uint64_t& from) INLINE { return OSReadBigInt64(&from, 0); }
+ static void set64(uint64_t& into, uint64_t value) INLINE { OSWriteBigInt64(&into, 0, value); }
+
+ static uint32_t getBits(const uint32_t& from,
+ uint8_t firstBit, uint8_t bitCount) INLINE { return getBitsRaw(get32(from), firstBit, bitCount); }
+ static void setBits(uint32_t& into, uint32_t value,
+ uint8_t firstBit, uint8_t bitCount) INLINE { uint32_t temp = get32(into); setBitsRaw(temp, value, firstBit, bitCount); set32(into, temp); }
+
+ static uint32_t getBitsRaw(const uint32_t& from,
+ uint8_t firstBit, uint8_t bitCount) INLINE { return ((from >> (32-firstBit-bitCount)) & ((1<> firstBit) & ((1<
+class Pointer32
+{
+public:
+ typedef uint32_t uint_t;
+ typedef int32_t sint_t;
+ typedef _E E;
+
+ static uint64_t getP(const uint_t& from) INLINE { return _E::get32(from); }
+ static void setP(uint_t& into, uint64_t value) INLINE { _E::set32(into, value); }
+};
+
+
+template
+class Pointer64
+{
+public:
+ typedef uint64_t uint_t;
+ typedef int64_t sint_t;
+ typedef _E E;
+
+ static uint64_t getP(const uint_t& from) INLINE { return _E::get64(from); }
+ static void setP(uint_t& into, uint64_t value) INLINE { _E::set64(into, value); }
+};
+
+
+
+
+
+#endif // __FILE_ABSTRACTION__
+
+
diff --git a/ld64-134.9/src/abstraction/MachOFileAbstraction.hpp b/ld64-134.9/src/abstraction/MachOFileAbstraction.hpp
new file mode 100644
index 0000000..ca76609
--- /dev/null
+++ b/ld64-134.9/src/abstraction/MachOFileAbstraction.hpp
@@ -0,0 +1,1472 @@
+/* -*- mode: C++; c-basic-offset: 4; tab-width: 4 -*-
+ *
+ * Copyright (c) 2005-2010 Apple Inc. All rights reserved.
+ *
+ * @APPLE_LICENSE_HEADER_START@
+ *
+ * This file contains Original Code and/or Modifications of Original Code
+ * as defined in and that are subject to the Apple Public Source License
+ * Version 2.0 (the 'License'). You may not use this file except in
+ * compliance with the License. Please obtain a copy of the License at
+ * http://www.opensource.apple.com/apsl/ and read it before using this
+ * file.
+ *
+ * The Original Code and all software distributed under the License are
+ * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
+ * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
+ * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
+ * Please see the License for the specific language governing rights and
+ * limitations under the License.
+ *
+ * @APPLE_LICENSE_HEADER_END@
+*/
+#ifndef __MACH_O_FILE_ABSTRACTION__
+#define __MACH_O_FILE_ABSTRACTION__
+
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+
+#include "FileAbstraction.hpp"
+
+#include "configure.h"
+
+// stuff that will eventually go away once newer cctools headers are widespread
+#ifndef LC_LOAD_UPWARD_DYLIB
+ #define LC_LOAD_UPWARD_DYLIB (0x23|LC_REQ_DYLD) /* load of dylib whose initializers run later */
+#endif
+
+#ifndef CPU_SUBTYPE_ARM_V5TEJ
+ #define CPU_SUBTYPE_ARM_V5TEJ ((cpu_subtype_t) 7)
+#endif
+#ifndef CPU_SUBTYPE_ARM_XSCALE
+ #define CPU_SUBTYPE_ARM_XSCALE ((cpu_subtype_t) 8)
+#endif
+#ifndef CPU_SUBTYPE_ARM_V7
+ #define CPU_SUBTYPE_ARM_V7 ((cpu_subtype_t) 9)
+#endif
+
+#ifndef N_ARM_THUMB_DEF
+ #define N_ARM_THUMB_DEF 0x0008
+#endif
+#ifndef MH_DEAD_STRIPPABLE_DYLIB
+ #define MH_DEAD_STRIPPABLE_DYLIB 0x400000
+#endif
+#ifndef MH_KEXT_BUNDLE
+ #define MH_KEXT_BUNDLE 11
+#endif
+#ifndef LC_DYLD_INFO
+ #define LC_DYLD_INFO 0x22 /* compressed dyld information */
+ #define LC_DYLD_INFO_ONLY (0x22|LC_REQ_DYLD) /* compressed dyld information only */
+
+ struct dyld_info_command {
+ uint32_t cmd; /* LC_DYLD_INFO or LC_DYLD_INFO_ONLY */
+ uint32_t cmdsize; /* sizeof(struct dyld_info_command) */
+ uint32_t rebase_off; /* file offset to rebase info */
+ uint32_t rebase_size; /* size of rebase info */
+ uint32_t bind_off; /* file offset to binding info */
+ uint32_t bind_size; /* size of binding info */
+ uint32_t weak_bind_off; /* file offset to weak binding info */
+ uint32_t weak_bind_size; /* size of weak binding info */
+ uint32_t lazy_bind_off; /* file offset to lazy binding info */
+ uint32_t lazy_bind_size; /* size of lazy binding infs */
+ uint32_t export_off; /* file offset to lazy binding info */
+ uint32_t export_size; /* size of lazy binding infs */
+ };
+
+ #define REBASE_TYPE_POINTER 1
+ #define REBASE_TYPE_TEXT_ABSOLUTE32 2
+ #define REBASE_TYPE_TEXT_PCREL32 3
+
+ #define REBASE_OPCODE_MASK 0xF0
+ #define REBASE_IMMEDIATE_MASK 0x0F
+ #define REBASE_OPCODE_DONE 0x00
+ #define REBASE_OPCODE_SET_TYPE_IMM 0x10
+ #define REBASE_OPCODE_SET_SEGMENT_AND_OFFSET_ULEB 0x20
+ #define REBASE_OPCODE_ADD_ADDR_ULEB 0x30
+ #define REBASE_OPCODE_ADD_ADDR_IMM_SCALED 0x40
+ #define REBASE_OPCODE_DO_REBASE_IMM_TIMES 0x50
+ #define REBASE_OPCODE_DO_REBASE_ULEB_TIMES 0x60
+ #define REBASE_OPCODE_DO_REBASE_ADD_ADDR_ULEB 0x70
+ #define REBASE_OPCODE_DO_REBASE_ULEB_TIMES_SKIPPING_ULEB 0x80
+
+ #define BIND_TYPE_POINTER 1
+ #define BIND_TYPE_TEXT_ABSOLUTE32 2
+ #define BIND_TYPE_TEXT_PCREL32 3
+
+ #define BIND_SPECIAL_DYLIB_SELF 0
+ #define BIND_SPECIAL_DYLIB_MAIN_EXECUTABLE -1
+ #define BIND_SPECIAL_DYLIB_FLAT_LOOKUP -2
+
+ #define BIND_SYMBOL_FLAGS_WEAK_IMPORT 0x1
+ #define BIND_SYMBOL_FLAGS_NON_WEAK_DEFINITION 0x8
+
+ #define BIND_OPCODE_MASK 0xF0
+ #define BIND_IMMEDIATE_MASK 0x0F
+ #define BIND_OPCODE_DONE 0x00
+ #define BIND_OPCODE_SET_DYLIB_ORDINAL_IMM 0x10
+ #define BIND_OPCODE_SET_DYLIB_ORDINAL_ULEB 0x20
+ #define BIND_OPCODE_SET_DYLIB_SPECIAL_IMM 0x30
+ #define BIND_OPCODE_SET_SYMBOL_TRAILING_FLAGS_IMM 0x40
+ #define BIND_OPCODE_SET_TYPE_IMM 0x50
+ #define BIND_OPCODE_SET_ADDEND_SLEB 0x60
+ #define BIND_OPCODE_SET_SEGMENT_AND_OFFSET_ULEB 0x70
+ #define BIND_OPCODE_ADD_ADDR_ULEB 0x80
+ #define BIND_OPCODE_DO_BIND 0x90
+ #define BIND_OPCODE_DO_BIND_ADD_ADDR_ULEB 0xA0
+ #define BIND_OPCODE_DO_BIND_ADD_ADDR_IMM_SCALED 0xB0
+ #define BIND_OPCODE_DO_BIND_ULEB_TIMES_SKIPPING_ULEB 0xC0
+
+ #define EXPORT_SYMBOL_FLAGS_KIND_MASK 0x03
+ #define EXPORT_SYMBOL_FLAGS_KIND_REGULAR 0x00
+ #define EXPORT_SYMBOL_FLAGS_KIND_THREAD_LOCAL 0x01
+ #define EXPORT_SYMBOL_FLAGS_WEAK_DEFINITION 0x04
+ #define EXPORT_SYMBOL_FLAGS_INDIRECT_DEFINITION 0x08
+ #define EXPORT_SYMBOL_FLAGS_HAS_SPECIALIZATIONS 0x10
+
+#endif
+
+#ifndef S_THREAD_LOCAL_REGULAR
+ #define S_THREAD_LOCAL_REGULAR 0x11
+#endif
+
+#ifndef S_THREAD_LOCAL_ZEROFILL
+ #define S_THREAD_LOCAL_ZEROFILL 0x12
+#endif
+
+#ifndef S_THREAD_LOCAL_VARIABLES
+ #define S_THREAD_LOCAL_VARIABLES 0x13
+#endif
+
+#ifndef S_THREAD_LOCAL_VARIABLE_POINTERS
+ #define S_THREAD_LOCAL_VARIABLE_POINTERS 0x14
+#endif
+
+#ifndef S_THREAD_LOCAL_INIT_FUNCTION_POINTERS
+ #define S_THREAD_LOCAL_INIT_FUNCTION_POINTERS 0x15
+#endif
+
+#ifndef MH_HAS_TLV_DESCRIPTORS
+ #define MH_HAS_TLV_DESCRIPTORS 0x800000
+#endif
+
+#ifndef X86_64_RELOC_TLV
+ #define X86_64_RELOC_TLV 9
+#endif
+
+#define GENERIC_RLEOC_TLV 5
+
+#ifndef EXPORT_SYMBOL_FLAGS_STUB_AND_RESOLVER
+ #define EXPORT_SYMBOL_FLAGS_STUB_AND_RESOLVER 0x10
+#endif
+
+#ifndef EXPORT_SYMBOL_FLAGS_REEXPORT
+ #define EXPORT_SYMBOL_FLAGS_REEXPORT 0x08
+#endif
+
+// type internal to linker
+#define BIND_TYPE_OVERRIDE_OF_WEAKDEF_IN_DYLIB 0
+
+#ifndef LC_VERSION_MIN_MACOSX
+ #define LC_VERSION_MIN_MACOSX 0x24
+ #define LC_VERSION_MIN_IPHONEOS 0x25
+
+ struct version_min_command {
+ uint32_t cmd; /* LC_VERSION_MIN_MACOSX or LC_VERSION_MIN_IPHONEOS */
+ uint32_t cmdsize; /* sizeof(struct min_version_command) */
+ uint32_t version; /* X.Y.Z is encoded in nibbles xxxx.yy.zz */
+ uint32_t reserved; /* zero */
+ };
+#endif
+
+#ifndef N_SYMBOL_RESOLVER
+ #define N_SYMBOL_RESOLVER 0x100
+#endif
+
+#ifndef LC_FUNCTION_STARTS
+ #define LC_FUNCTION_STARTS 0x26
+#endif
+
+#ifndef MH_NO_HEAP_EXECUTION
+ #define MH_NO_HEAP_EXECUTION 0x1000000
+#endif
+
+#ifndef LC_DYLD_ENVIRONMENT
+ #define LC_DYLD_ENVIRONMENT 0x27
+#endif
+
+#ifndef LC_DATA_IN_CODE
+ #define LC_DATA_IN_CODE 0x29 /* table of non-instructions in __text */
+ struct data_in_code_entry {
+ uint32_t offset;
+ uint16_t length;
+ uint16_t kind;
+ };
+#endif
+
+#ifndef LC_DYLIB_CODE_SIGN_DRS
+ #define LC_DYLIB_CODE_SIGN_DRS 0x2B
+#endif
+
+#ifndef CPU_SUBTYPE_ARM_V7F
+ #define CPU_SUBTYPE_ARM_V7F ((cpu_subtype_t) 10)
+#endif
+#ifndef CPU_SUBTYPE_ARM_V7K
+ #define CPU_SUBTYPE_ARM_V7K ((cpu_subtype_t) 12)
+#endif
+#ifndef CPU_SUBTYPE_ARM_V7S
+ #define CPU_SUBTYPE_ARM_V7S ((cpu_subtype_t) 11)
+#endif
+
+
+#ifndef LC_SOURCE_VERSION
+ #define LC_SOURCE_VERSION 0x2A
+ struct source_version_command {
+ uint32_t cmd; /* LC_SOURCE_VERSION */
+ uint32_t cmdsize; /* 16 */
+ uint64_t version; /* A.B.C.D.E packed as a24.b10.c10.d10.e10 */
+ };
+#endif
+
+#ifndef LC_MAIN
+ #define LC_MAIN (0x28|LC_REQ_DYLD) /* replacement for LC_UNIXTHREAD */
+ struct entry_point_command {
+ uint32_t cmd; /* LC_MAIN only used in MH_EXECUTE filetypes */
+ uint32_t cmdsize; /* 24 */
+ uint64_t entryoff; /* file (__TEXT) offset of main() */
+ uint64_t stacksize;/* if not zero, initial stack size */
+ };
+#endif
+
+#ifndef LC_DYLIB_CODE_SIGN_DRS
+ #define LC_DYLIB_CODE_SIGN_DRS 0x2B
+#endif
+
+
+struct ArchInfo {
+ const char* archName;
+ cpu_type_t cpuType;
+ cpu_subtype_t cpuSubType;
+ const char* llvmTriplePrefix;
+ const char* llvmTriplePrefixAlt;
+ bool isSubType;
+ bool supportsThumb2;
+};
+
+static const ArchInfo archInfoArray[] = {
+#if SUPPORT_ARCH_x86_64
+ { "x86_64", CPU_TYPE_X86_64, CPU_SUBTYPE_X86_64_ALL, "x86_64-", "", false, false },
+#endif
+#if SUPPORT_ARCH_i386
+ { "i386", CPU_TYPE_I386, CPU_SUBTYPE_I386_ALL, "i386-", "", false, false },
+#endif
+#if SUPPORT_ARCH_armv4t
+ { "armv4t", CPU_TYPE_ARM, CPU_SUBTYPE_ARM_V4T, "armv4t-", "", true, false },
+ #define SUPPORT_ARCH_arm_any 1
+#endif
+#if SUPPORT_ARCH_armv5
+ { "armv5", CPU_TYPE_ARM, CPU_SUBTYPE_ARM_V5TEJ, "armv5e-", "", true, false },
+ #define SUPPORT_ARCH_arm_any 1
+#endif
+#if SUPPORT_ARCH_armv6
+ { "armv6", CPU_TYPE_ARM, CPU_SUBTYPE_ARM_V6, "armv6-", "", true, false },
+ #define SUPPORT_ARCH_arm_any 1
+#endif
+#if SUPPORT_ARCH_armv7
+ { "armv7", CPU_TYPE_ARM, CPU_SUBTYPE_ARM_V7, "thumbv7-", "armv7-", true, true },
+ #define SUPPORT_ARCH_arm_any 1
+#endif
+#if SUPPORT_ARCH_armv7f
+ { "armv7f", CPU_TYPE_ARM, CPU_SUBTYPE_ARM_V7F, "thumbv7f-", "", true, true },
+ #define SUPPORT_ARCH_arm_any 1
+#endif
+#if SUPPORT_ARCH_armv7k
+ { "armv7k", CPU_TYPE_ARM, CPU_SUBTYPE_ARM_V7K, "thumbv7k-", "", true, true },
+ #define SUPPORT_ARCH_arm_any 1
+#endif
+#if SUPPORT_ARCH_armv7s
+ { "armv7s", CPU_TYPE_ARM, CPU_SUBTYPE_ARM_V7S, "thumbv7s-", "armv7s", true, true },
+ #define SUPPORT_ARCH_arm_any 1
+#endif
+ { NULL, 0, 0, NULL, NULL, false, false }
+};
+
+
+// weird, but this include must wait until after SUPPORT_ARCH_arm_any is set up
+#if SUPPORT_ARCH_arm_any
+#include
+#endif
+
+// hack until newer everywhere
+#define ARM_RELOC_HALF 8
+#define ARM_RELOC_HALF_SECTDIFF 9
+
+
+
+//
+// This abstraction layer makes every mach-o file look like a 64-bit mach-o file with native endianness
+//
+
+
+
+//
+// mach-o file header
+//
+template struct macho_header_content {};
+template <> struct macho_header_content > { mach_header fields; };
+template <> struct macho_header_content > { mach_header_64 fields; };
+template <> struct macho_header_content > { mach_header fields; };
+template <> struct macho_header_content > { mach_header_64 fields; };
+
+template
+class macho_header {
+public:
+ uint32_t magic() const INLINE { return E::get32(header.fields.magic); }
+ void set_magic(uint32_t value) INLINE { E::set32(header.fields.magic, value); }
+
+ uint32_t cputype() const INLINE { return E::get32(header.fields.cputype); }
+ void set_cputype(uint32_t value) INLINE { E::set32((uint32_t&)header.fields.cputype, value); }
+
+ uint32_t cpusubtype() const INLINE { return E::get32(header.fields.cpusubtype); }
+ void set_cpusubtype(uint32_t value) INLINE { E::set32((uint32_t&)header.fields.cpusubtype, value); }
+
+ uint32_t filetype() const INLINE { return E::get32(header.fields.filetype); }
+ void set_filetype(uint32_t value) INLINE { E::set32(header.fields.filetype, value); }
+
+ uint32_t ncmds() const INLINE { return E::get32(header.fields.ncmds); }
+ void set_ncmds(uint32_t value) INLINE { E::set32(header.fields.ncmds, value); }
+
+ uint32_t sizeofcmds() const INLINE { return E::get32(header.fields.sizeofcmds); }
+ void set_sizeofcmds(uint32_t value) INLINE { E::set32(header.fields.sizeofcmds, value); }
+
+ uint32_t flags() const INLINE { return E::get32(header.fields.flags); }
+ void set_flags(uint32_t value) INLINE { E::set32(header.fields.flags, value); }
+
+ uint32_t reserved() const INLINE { return E::get32(header.fields.reserved); }
+ void set_reserved(uint32_t value) INLINE { E::set32(header.fields.reserved, value); }
+
+ typedef typename P::E E;
+private:
+ macho_header_content header;
+};
+
+
+//
+// mach-o load command
+//
+template
+class macho_load_command {
+public:
+ uint32_t cmd() const INLINE { return E::get32(command.cmd); }
+ void set_cmd(uint32_t value) INLINE { E::set32(command.cmd, value); }
+
+ uint32_t cmdsize() const INLINE { return E::get32(command.cmdsize); }
+ void set_cmdsize(uint32_t value) INLINE { E::set32(command.cmdsize, value); }
+
+ typedef typename P::E E;
+private:
+ load_command command;
+};
+
+
+//
+// mach-o segment load command
+//
+template struct macho_segment_content {};
+template <> struct macho_segment_content > { segment_command fields; enum { CMD = LC_SEGMENT }; };
+template <> struct macho_segment_content > { segment_command_64 fields; enum { CMD = LC_SEGMENT_64 }; };
+template <> struct macho_segment_content > { segment_command fields; enum { CMD = LC_SEGMENT }; };
+template <> struct macho_segment_content > { segment_command_64 fields; enum { CMD = LC_SEGMENT_64 }; };
+
+template
+class macho_segment_command {
+public:
+ uint32_t cmd() const INLINE { return E::get32(segment.fields.cmd); }
+ void set_cmd(uint32_t value) INLINE { E::set32(segment.fields.cmd, value); }
+
+ uint32_t cmdsize() const INLINE { return E::get32(segment.fields.cmdsize); }
+ void set_cmdsize(uint32_t value) INLINE { E::set32(segment.fields.cmdsize, value); }
+
+ const char* segname() const INLINE { return segment.fields.segname; }
+ void set_segname(const char* value) INLINE { strncpy(segment.fields.segname, value, 16); }
+
+ uint64_t vmaddr() const INLINE { return P::getP(segment.fields.vmaddr); }
+ void set_vmaddr(uint64_t value) INLINE { P::setP(segment.fields.vmaddr, value); }
+
+ uint64_t vmsize() const INLINE { return P::getP(segment.fields.vmsize); }
+ void set_vmsize(uint64_t value) INLINE { P::setP(segment.fields.vmsize, value); }
+
+ uint64_t fileoff() const INLINE { return P::getP(segment.fields.fileoff); }
+ void set_fileoff(uint64_t value) INLINE { P::setP(segment.fields.fileoff, value); }
+
+ uint64_t filesize() const INLINE { return P::getP(segment.fields.filesize); }
+ void set_filesize(uint64_t value) INLINE { P::setP(segment.fields.filesize, value); }
+
+ uint32_t maxprot() const INLINE { return E::get32(segment.fields.maxprot); }
+ void set_maxprot(uint32_t value) INLINE { E::set32((uint32_t&)segment.fields.maxprot, value); }
+
+ uint32_t initprot() const INLINE { return E::get32(segment.fields.initprot); }
+ void set_initprot(uint32_t value) INLINE { E::set32((uint32_t&)segment.fields.initprot, value); }
+
+ uint32_t nsects() const INLINE { return E::get32(segment.fields.nsects); }
+ void set_nsects(uint32_t value) INLINE { E::set32(segment.fields.nsects, value); }
+
+ uint32_t flags() const INLINE { return E::get32(segment.fields.flags); }
+ void set_flags(uint32_t value) INLINE { E::set32(segment.fields.flags, value); }
+
+ enum {
+ CMD = macho_segment_content::CMD
+ };
+
+ typedef typename P::E E;
+private:
+ macho_segment_content
segment;
+};
+
+
+//
+// mach-o section
+//
+template struct macho_section_content {};
+template <> struct macho_section_content > { section fields; };
+template <> struct macho_section_content > { section_64 fields; };
+template <> struct macho_section_content > { section fields; };
+template <> struct macho_section_content > { section_64 fields; };
+
+template
+class macho_section {
+public:
+ const char* sectname() const INLINE { return section.fields.sectname; }
+ void set_sectname(const char* value) INLINE { strncpy(section.fields.sectname, value, 16); }
+
+ const char* segname() const INLINE { return section.fields.segname; }
+ void set_segname(const char* value) INLINE { strncpy(section.fields.segname, value, 16); }
+
+ uint64_t addr() const INLINE { return P::getP(section.fields.addr); }
+ void set_addr(uint64_t value) INLINE { P::setP(section.fields.addr, value); }
+
+ uint64_t size() const INLINE { return P::getP(section.fields.size); }
+ void set_size(uint64_t value) INLINE { P::setP(section.fields.size, value); }
+
+ uint32_t offset() const INLINE { return E::get32(section.fields.offset); }
+ void set_offset(uint32_t value) INLINE { E::set32(section.fields.offset, value); }
+
+ uint32_t align() const INLINE { return E::get32(section.fields.align); }
+ void set_align(uint32_t value) INLINE { E::set32(section.fields.align, value); }
+
+ uint32_t reloff() const INLINE { return E::get32(section.fields.reloff); }
+ void set_reloff(uint32_t value) INLINE { E::set32(section.fields.reloff, value); }
+
+ uint32_t nreloc() const INLINE { return E::get32(section.fields.nreloc); }
+ void set_nreloc(uint32_t value) INLINE { E::set32(section.fields.nreloc, value); }
+
+ uint32_t flags() const INLINE { return E::get32(section.fields.flags); }
+ void set_flags(uint32_t value) INLINE { E::set32(section.fields.flags, value); }
+
+ uint32_t reserved1() const INLINE { return E::get32(section.fields.reserved1); }
+ void set_reserved1(uint32_t value) INLINE { E::set32(section.fields.reserved1, value); }
+
+ uint32_t reserved2() const INLINE { return E::get32(section.fields.reserved2); }
+ void set_reserved2(uint32_t value) INLINE { E::set32(section.fields.reserved2, value); }
+
+ typedef typename P::E E;
+private:
+ macho_section_content section;
+};
+
+
+//
+// mach-o dylib load command
+//
+template
+class macho_dylib_command {
+public:
+ uint32_t cmd() const INLINE { return E::get32(fields.cmd); }
+ void set_cmd(uint32_t value) INLINE { E::set32(fields.cmd, value); }
+
+ uint32_t cmdsize() const INLINE { return E::get32(fields.cmdsize); }
+ void set_cmdsize(uint32_t value) INLINE { E::set32(fields.cmdsize, value); }
+
+ uint32_t name_offset() const INLINE { return E::get32(fields.dylib.name.offset); }
+ void set_name_offset(uint32_t value) INLINE { E::set32(fields.dylib.name.offset, value); }
+
+ uint32_t timestamp() const INLINE { return E::get32(fields.dylib.timestamp); }
+ void set_timestamp(uint32_t value) INLINE { E::set32(fields.dylib.timestamp, value); }
+
+ uint32_t current_version() const INLINE { return E::get32(fields.dylib.current_version); }
+ void set_current_version(uint32_t value) INLINE { E::set32(fields.dylib.current_version, value); }
+
+ uint32_t compatibility_version() const INLINE { return E::get32(fields.dylib.compatibility_version); }
+ void set_compatibility_version(uint32_t value) INLINE { E::set32(fields.dylib.compatibility_version, value); }
+
+ const char* name() const INLINE { return (const char*)&fields + name_offset(); }
+ void set_name_offset() INLINE { set_name_offset(sizeof(fields)); }
+
+ typedef typename P::E E;
+private:
+ dylib_command fields;
+};
+
+
+//
+// mach-o dylinker load command
+//
+template
+class macho_dylinker_command {
+public:
+ uint32_t cmd() const INLINE { return E::get32(fields.cmd); }
+ void set_cmd(uint32_t value) INLINE { E::set32(fields.cmd, value); }
+
+ uint32_t cmdsize() const INLINE { return E::get32(fields.cmdsize); }
+ void set_cmdsize(uint32_t value) INLINE { E::set32(fields.cmdsize, value); }
+
+ uint32_t name_offset() const INLINE { return E::get32(fields.name.offset); }
+ void set_name_offset(uint32_t value) INLINE { E::set32(fields.name.offset, value); }
+
+ const char* name() const INLINE { return (const char*)&fields + name_offset(); }
+ void set_name_offset() INLINE { set_name_offset(sizeof(fields)); }
+
+ typedef typename P::E E;
+private:
+ dylinker_command fields;
+};
+
+
+//
+// mach-o sub_framework load command
+//
+template
+class macho_sub_framework_command {
+public:
+ uint32_t cmd() const INLINE { return E::get32(fields.cmd); }
+ void set_cmd(uint32_t value) INLINE { E::set32(fields.cmd, value); }
+
+ uint32_t cmdsize() const INLINE { return E::get32(fields.cmdsize); }
+ void set_cmdsize(uint32_t value) INLINE { E::set32(fields.cmdsize, value); }
+
+ uint32_t umbrella_offset() const INLINE { return E::get32(fields.umbrella.offset); }
+ void set_umbrella_offset(uint32_t value) INLINE { E::set32(fields.umbrella.offset, value); }
+
+ const char* umbrella() const INLINE { return (const char*)&fields + umbrella_offset(); }
+ void set_umbrella_offset() INLINE { set_umbrella_offset(sizeof(fields)); }
+
+ typedef typename P::E E;
+private:
+ sub_framework_command fields;
+};
+
+
+//
+// mach-o sub_client load command
+//
+template
+class macho_sub_client_command {
+public:
+ uint32_t cmd() const INLINE { return E::get32(fields.cmd); }
+ void set_cmd(uint32_t value) INLINE { E::set32(fields.cmd, value); }
+
+ uint32_t cmdsize() const INLINE { return E::get32(fields.cmdsize); }
+ void set_cmdsize(uint32_t value) INLINE { E::set32(fields.cmdsize, value); }
+
+ uint32_t client_offset() const INLINE { return E::get32(fields.client.offset); }
+ void set_client_offset(uint32_t value) INLINE { E::set32(fields.client.offset, value); }
+
+ const char* client() const INLINE { return (const char*)&fields + client_offset(); }
+ void set_client_offset() INLINE { set_client_offset(sizeof(fields)); }
+
+ typedef typename P::E E;
+private:
+ sub_client_command fields;
+};
+
+
+//
+// mach-o sub_umbrella load command
+//
+template
+class macho_sub_umbrella_command {
+public:
+ uint32_t cmd() const INLINE { return E::get32(fields.cmd); }
+ void set_cmd(uint32_t value) INLINE { E::set32(fields.cmd, value); }
+
+ uint32_t cmdsize() const INLINE { return E::get32(fields.cmdsize); }
+ void set_cmdsize(uint32_t value) INLINE { E::set32(fields.cmdsize, value); }
+
+ uint32_t sub_umbrella_offset() const INLINE { return E::get32(fields.sub_umbrella.offset); }
+ void set_sub_umbrella_offset(uint32_t value) INLINE { E::set32(fields.sub_umbrella.offset, value); }
+
+ const char* sub_umbrella() const INLINE { return (const char*)&fields + sub_umbrella_offset(); }
+ void set_sub_umbrella_offset() INLINE { set_sub_umbrella_offset(sizeof(fields)); }
+
+ typedef typename P::E E;
+private:
+ sub_umbrella_command fields;
+};
+
+
+//
+// mach-o sub_library load command
+//
+template
+class macho_sub_library_command {
+public:
+ uint32_t cmd() const INLINE { return E::get32(fields.cmd); }
+ void set_cmd(uint32_t value) INLINE { E::set32(fields.cmd, value); }
+
+ uint32_t cmdsize() const INLINE { return E::get32(fields.cmdsize); }
+ void set_cmdsize(uint32_t value) INLINE { E::set32(fields.cmdsize, value); }
+
+ uint32_t sub_library_offset() const INLINE { return E::get32(fields.sub_library.offset); }
+ void set_sub_library_offset(uint32_t value) INLINE { E::set32(fields.sub_library.offset, value); }
+
+ const char* sub_library() const INLINE { return (const char*)&fields + sub_library_offset(); }
+ void set_sub_library_offset() INLINE { set_sub_library_offset(sizeof(fields)); }
+
+ typedef typename P::E E;
+private:
+ sub_library_command fields;
+};
+
+
+//
+// mach-o uuid load command
+//
+template
+class macho_uuid_command {
+public:
+ uint32_t cmd() const INLINE { return E::get32(fields.cmd); }
+ void set_cmd(uint32_t value) INLINE { E::set32(fields.cmd, value); }
+
+ uint32_t cmdsize() const INLINE { return E::get32(fields.cmdsize); }
+ void set_cmdsize(uint32_t value) INLINE { E::set32(fields.cmdsize, value); }
+
+ const uint8_t* uuid() const INLINE { return fields.uuid; }
+ void set_uuid(const uint8_t u[16]) INLINE { memcpy(&fields.uuid, u, 16); }
+
+ typedef typename P::E E;
+private:
+ uuid_command fields;
+};
+
+
+//
+// mach-o routines load command
+//
+template struct macho_routines_content {};
+template <> struct macho_routines_content > { routines_command fields; enum { CMD = LC_ROUTINES }; };
+template <> struct macho_routines_content > { routines_command_64 fields; enum { CMD = LC_ROUTINES_64 }; };
+template <> struct macho_routines_content > { routines_command fields; enum { CMD = LC_ROUTINES }; };
+template <> struct macho_routines_content > { routines_command_64 fields; enum { CMD = LC_ROUTINES_64 }; };
+
+template
+class macho_routines_command {
+public:
+ uint32_t cmd() const INLINE { return E::get32(routines.fields.cmd); }
+ void set_cmd(uint32_t value) INLINE { E::set32(routines.fields.cmd, value); }
+
+ uint32_t cmdsize() const INLINE { return E::get32(routines.fields.cmdsize); }
+ void set_cmdsize(uint32_t value) INLINE { E::set32(routines.fields.cmdsize, value); }
+
+ uint64_t init_address() const INLINE { return P::getP(routines.fields.init_address); }
+ void set_init_address(uint64_t value) INLINE { P::setP(routines.fields.init_address, value); }
+
+ uint64_t init_module() const INLINE { return P::getP(routines.fields.init_module); }
+ void set_init_module(uint64_t value) INLINE { P::setP(routines.fields.init_module, value); }
+
+ uint64_t reserved1() const INLINE { return P::getP(routines.fields.reserved1); }
+ void set_reserved1(uint64_t value) INLINE { P::setP(routines.fields.reserved1, value); }
+
+ uint64_t reserved2() const INLINE { return P::getP(routines.fields.reserved2); }
+ void set_reserved2(uint64_t value) INLINE { P::setP(routines.fields.reserved2, value); }
+
+ uint64_t reserved3() const INLINE { return P::getP(routines.fields.reserved3); }
+ void set_reserved3(uint64_t value) INLINE { P::setP(routines.fields.reserved3, value); }
+
+ uint64_t reserved4() const INLINE { return P::getP(routines.fields.reserved4); }
+ void set_reserved4(uint64_t value) INLINE { P::setP(routines.fields.reserved4, value); }
+
+ uint64_t reserved5() const INLINE { return P::getP(routines.fields.reserved5); }
+ void set_reserved5(uint64_t value) INLINE { P::setP(routines.fields.reserved5, value); }
+
+ uint64_t reserved6() const INLINE { return P::getP(routines.fields.reserved6); }
+ void set_reserved6(uint64_t value) INLINE { P::setP(routines.fields.reserved6, value); }
+
+ typedef typename P::E E;
+ enum {
+ CMD = macho_routines_content::CMD
+ };
+private:
+ macho_routines_content
routines;
+};
+
+
+//
+// mach-o symbol table load command
+//
+template
+class macho_symtab_command {
+public:
+ uint32_t cmd() const INLINE { return E::get32(fields.cmd); }
+ void set_cmd(uint32_t value) INLINE { E::set32(fields.cmd, value); }
+
+ uint32_t cmdsize() const INLINE { return E::get32(fields.cmdsize); }
+ void set_cmdsize(uint32_t value) INLINE { E::set32(fields.cmdsize, value); }
+
+ uint32_t symoff() const INLINE { return E::get32(fields.symoff); }
+ void set_symoff(uint32_t value) INLINE { E::set32(fields.symoff, value); }
+
+ uint32_t nsyms() const INLINE { return E::get32(fields.nsyms); }
+ void set_nsyms(uint32_t value) INLINE { E::set32(fields.nsyms, value); }
+
+ uint32_t stroff() const INLINE { return E::get32(fields.stroff); }
+ void set_stroff(uint32_t value) INLINE { E::set32(fields.stroff, value); }
+
+ uint32_t strsize() const INLINE { return E::get32(fields.strsize); }
+ void set_strsize(uint32_t value) INLINE { E::set32(fields.strsize, value); }
+
+
+ typedef typename P::E E;
+private:
+ symtab_command fields;
+};
+
+
+//
+// mach-o dynamic symbol table load command
+//
+template
+class macho_dysymtab_command {
+public:
+ uint32_t cmd() const INLINE { return E::get32(fields.cmd); }
+ void set_cmd(uint32_t value) INLINE { E::set32(fields.cmd, value); }
+
+ uint32_t cmdsize() const INLINE { return E::get32(fields.cmdsize); }
+ void set_cmdsize(uint32_t value) INLINE { E::set32(fields.cmdsize, value); }
+
+ uint32_t ilocalsym() const INLINE { return E::get32(fields.ilocalsym); }
+ void set_ilocalsym(uint32_t value) INLINE { E::set32(fields.ilocalsym, value); }
+
+ uint32_t nlocalsym() const INLINE { return E::get32(fields.nlocalsym); }
+ void set_nlocalsym(uint32_t value) INLINE { E::set32(fields.nlocalsym, value); }
+
+ uint32_t iextdefsym() const INLINE { return E::get32(fields.iextdefsym); }
+ void set_iextdefsym(uint32_t value) INLINE { E::set32(fields.iextdefsym, value); }
+
+ uint32_t nextdefsym() const INLINE { return E::get32(fields.nextdefsym); }
+ void set_nextdefsym(uint32_t value) INLINE { E::set32(fields.nextdefsym, value); }
+
+ uint32_t iundefsym() const INLINE { return E::get32(fields.iundefsym); }
+ void set_iundefsym(uint32_t value) INLINE { E::set32(fields.iundefsym, value); }
+
+ uint32_t nundefsym() const INLINE { return E::get32(fields.nundefsym); }
+ void set_nundefsym(uint32_t value) INLINE { E::set32(fields.nundefsym, value); }
+
+ uint32_t tocoff() const INLINE { return E::get32(fields.tocoff); }
+ void set_tocoff(uint32_t value) INLINE { E::set32(fields.tocoff, value); }
+
+ uint32_t ntoc() const INLINE { return E::get32(fields.ntoc); }
+ void set_ntoc(uint32_t value) INLINE { E::set32(fields.ntoc, value); }
+
+ uint32_t modtaboff() const INLINE { return E::get32(fields.modtaboff); }
+ void set_modtaboff(uint32_t value) INLINE { E::set32(fields.modtaboff, value); }
+
+ uint32_t nmodtab() const INLINE { return E::get32(fields.nmodtab); }
+ void set_nmodtab(uint32_t value) INLINE { E::set32(fields.nmodtab, value); }
+
+ uint32_t extrefsymoff() const INLINE { return E::get32(fields.extrefsymoff); }
+ void set_extrefsymoff(uint32_t value) INLINE { E::set32(fields.extrefsymoff, value); }
+
+ uint32_t nextrefsyms() const INLINE { return E::get32(fields.nextrefsyms); }
+ void set_nextrefsyms(uint32_t value) INLINE { E::set32(fields.nextrefsyms, value); }
+
+ uint32_t indirectsymoff() const INLINE { return E::get32(fields.indirectsymoff); }
+ void set_indirectsymoff(uint32_t value) INLINE { E::set32(fields.indirectsymoff, value); }
+
+ uint32_t nindirectsyms() const INLINE { return E::get32(fields.nindirectsyms); }
+ void set_nindirectsyms(uint32_t value) INLINE { E::set32(fields.nindirectsyms, value); }
+
+ uint32_t extreloff() const INLINE { return E::get32(fields.extreloff); }
+ void set_extreloff(uint32_t value) INLINE { E::set32(fields.extreloff, value); }
+
+ uint32_t nextrel() const INLINE { return E::get32(fields.nextrel); }
+ void set_nextrel(uint32_t value) INLINE { E::set32(fields.nextrel, value); }
+
+ uint32_t locreloff() const INLINE { return E::get32(fields.locreloff); }
+ void set_locreloff(uint32_t value) INLINE { E::set32(fields.locreloff, value); }
+
+ uint32_t nlocrel() const INLINE { return E::get32(fields.nlocrel); }
+ void set_nlocrel(uint32_t value) INLINE { E::set32(fields.nlocrel, value); }
+
+ typedef typename P::E E;
+private:
+ dysymtab_command fields;
+};
+
+
+
+
+//
+// mach-o module table entry (for compatibility with old ld/dyld)
+//
+template struct macho_dylib_module_content {};
+template <> struct macho_dylib_module_content > { struct dylib_module fields; };
+template <> struct macho_dylib_module_content > { struct dylib_module fields; };
+template <> struct macho_dylib_module_content > { struct dylib_module_64 fields; };
+template <> struct macho_dylib_module_content > { struct dylib_module_64 fields; };
+
+template
+class macho_dylib_module {
+public:
+ uint32_t module_name() const INLINE { return E::get32(module.fields.module_name); }
+ void set_module_name(uint32_t value) INLINE { E::set32(module.fields.module_name, value); }
+
+ uint32_t iextdefsym() const INLINE { return E::get32(module.fields.iextdefsym); }
+ void set_iextdefsym(uint32_t value) INLINE { E::set32(module.fields.iextdefsym, value); }
+
+ uint32_t nextdefsym() const INLINE { return E::get32(module.fields.nextdefsym); }
+ void set_nextdefsym(uint32_t value) INLINE { E::set32(module.fields.nextdefsym, value); }
+
+ uint32_t irefsym() const INLINE { return E::get32(module.fields.irefsym); }
+ void set_irefsym(uint32_t value) INLINE { E::set32(module.fields.irefsym, value); }
+
+ uint32_t nrefsym() const INLINE { return E::get32(module.fields.nrefsym); }
+ void set_nrefsym(uint32_t value) INLINE { E::set32(module.fields.nrefsym, value); }
+
+ uint32_t ilocalsym() const INLINE { return E::get32(module.fields.ilocalsym); }
+ void set_ilocalsym(uint32_t value) INLINE { E::set32(module.fields.ilocalsym, value); }
+
+ uint32_t nlocalsym() const INLINE { return E::get32(module.fields.nlocalsym); }
+ void set_nlocalsym(uint32_t value) INLINE { E::set32(module.fields.nlocalsym, value); }
+
+ uint32_t iextrel() const INLINE { return E::get32(module.fields.iextrel); }
+ void set_iextrel(uint32_t value) INLINE { E::set32(module.fields.iextrel, value); }
+
+ uint32_t nextrel() const INLINE { return E::get32(module.fields.nextrel); }
+ void set_nextrel(uint32_t value) INLINE { E::set32(module.fields.nextrel, value); }
+
+ uint16_t iinit() const INLINE { return E::get32(module.fields.iinit_iterm) & 0xFFFF; }
+ uint16_t iterm() const INLINE { return E::get32(module.fields.iinit_iterm) > 16; }
+ void set_iinit_iterm(uint16_t init, uint16_t term) INLINE { E::set32(module.fields.iinit_iterm, (term<<16) | (init &0xFFFF)); }
+
+ uint16_t ninit() const INLINE { return E::get32(module.fields.ninit_nterm) & 0xFFFF; }
+ uint16_t nterm() const INLINE { return E::get32(module.fields.ninit_nterm) > 16; }
+ void set_ninit_nterm(uint16_t init, uint16_t term) INLINE { E::set32(module.fields.ninit_nterm, (term<<16) | (init &0xFFFF)); }
+
+ uint64_t objc_module_info_addr() const INLINE { return P::getP(module.fields.objc_module_info_addr); }
+ void set_objc_module_info_addr(uint64_t value) INLINE { P::setP(module.fields.objc_module_info_addr, value); }
+
+ uint32_t objc_module_info_size() const INLINE { return E::get32(module.fields.objc_module_info_size); }
+ void set_objc_module_info_size(uint32_t value) INLINE { E::set32(module.fields.objc_module_info_size, value); }
+
+
+ typedef typename P::E E;
+private:
+ macho_dylib_module_content module;
+};
+
+
+//
+// mach-o dylib_reference entry
+//
+template
+class macho_dylib_reference {
+public:
+ uint32_t isym() const INLINE { return E::getBits(fields, 0, 24); }
+ void set_isym(uint32_t value) INLINE { E::setBits(fields, value, 0, 24); }
+
+ uint8_t flags() const INLINE { return E::getBits(fields, 24, 8); }
+ void set_flags(uint8_t value) INLINE { E::setBits(fields, value, 24, 8); }
+
+ typedef typename P::E E;
+private:
+ uint32_t fields;
+};
+
+
+
+//
+// mach-o two-level hints load command
+//
+template
+class macho_dylib_table_of_contents {
+public:
+ uint32_t symbol_index() const INLINE { return E::get32(fields.symbol_index); }
+ void set_symbol_index(uint32_t value) INLINE { E::set32(fields.symbol_index, value); }
+
+ uint32_t module_index() const INLINE { return E::get32(fields.module_index); }
+ void set_module_index(uint32_t value) INLINE { E::set32(fields.module_index, value); }
+
+ typedef typename P::E E;
+private:
+ dylib_table_of_contents fields;
+};
+
+
+
+//
+// mach-o two-level hints load command
+//
+template
+class macho_twolevel_hints_command {
+public:
+ uint32_t cmd() const INLINE { return E::get32(fields.cmd); }
+ void set_cmd(uint32_t value) INLINE { E::set32(fields.cmd, value); }
+
+ uint32_t cmdsize() const INLINE { return E::get32(fields.cmdsize); }
+ void set_cmdsize(uint32_t value) INLINE { E::set32(fields.cmdsize, value); }
+
+ uint32_t offset() const INLINE { return E::get32(fields.offset); }
+ void set_offset(uint32_t value) INLINE { E::set32(fields.offset, value); }
+
+ uint32_t nhints() const INLINE { return E::get32(fields.nhints); }
+ void set_nhints(uint32_t value) INLINE { E::set32(fields.nhints, value); }
+
+ typedef typename P::E E;
+private:
+ twolevel_hints_command fields;
+};
+
+
+//
+// mach-o threads load command
+//
+template
+class macho_thread_command {
+public:
+ uint32_t cmd() const INLINE { return E::get32(fields.cmd); }
+ void set_cmd(uint32_t value) INLINE { E::set32(fields.cmd, value); }
+
+ uint32_t cmdsize() const INLINE { return E::get32(fields.cmdsize); }
+ void set_cmdsize(uint32_t value) INLINE { E::set32(fields.cmdsize, value); }
+
+ uint32_t flavor() const INLINE { return E::get32(fields_flavor); }
+ void set_flavor(uint32_t value) INLINE { E::set32(fields_flavor, value); }
+
+ uint32_t count() const INLINE { return E::get32(fields_count); }
+ void set_count(uint32_t value) INLINE { E::set32(fields_count, value); }
+
+ uint64_t thread_register(uint32_t index) const INLINE { return P::getP(thread_registers[index]); }
+ void set_thread_register(uint32_t index, uint64_t value) INLINE { P::setP(thread_registers[index], value); }
+
+ typedef typename P::E E;
+ typedef typename P::uint_t pint_t;
+private:
+ struct thread_command fields;
+ uint32_t fields_flavor;
+ uint32_t fields_count;
+ pint_t thread_registers[1];
+};
+
+
+//
+// mach-o misc data
+//
+template
+class macho_linkedit_data_command {
+public:
+ uint32_t cmd() const INLINE { return E::get32(fields.cmd); }
+ void set_cmd(uint32_t value) INLINE { E::set32(fields.cmd, value); }
+
+ uint32_t cmdsize() const INLINE { return E::get32(fields.cmdsize); }
+ void set_cmdsize(uint32_t value) INLINE { E::set32(fields.cmdsize, value); }
+
+ uint32_t dataoff() const INLINE { return E::get32(fields.dataoff); }
+ void set_dataoff(uint32_t value) INLINE { E::set32(fields.dataoff, value); }
+
+ uint32_t datasize() const INLINE { return E::get32(fields.datasize); }
+ void set_datasize(uint32_t value)INLINE { E::set32(fields.datasize, value); }
+
+
+ typedef typename P::E E;
+private:
+ struct linkedit_data_command fields;
+};
+
+
+//
+// mach-o rpath
+//
+template
+class macho_rpath_command {
+public:
+ uint32_t cmd() const INLINE { return E::get32(fields.cmd); }
+ void set_cmd(uint32_t value) INLINE { E::set32(fields.cmd, value); }
+
+ uint32_t cmdsize() const INLINE { return E::get32(fields.cmdsize); }
+ void set_cmdsize(uint32_t value) INLINE { E::set32(fields.cmdsize, value); }
+
+ uint32_t path_offset() const INLINE { return E::get32(fields.path.offset); }
+ void set_path_offset(uint32_t value) INLINE { E::set32(fields.path.offset, value); }
+
+ const char* path() const INLINE { return (const char*)&fields + path_offset(); }
+ void set_path_offset() INLINE { set_path_offset(sizeof(fields)); }
+
+
+ typedef typename P::E E;
+private:
+ struct rpath_command fields;
+};
+
+
+
+//
+// mach-o symbol table entry
+//
+template struct macho_nlist_content {};
+template <> struct macho_nlist_content > { struct nlist fields; };
+template <> struct macho_nlist_content > { struct nlist_64 fields; };
+template <> struct macho_nlist_content > { struct nlist fields; };
+template <> struct macho_nlist_content > { struct nlist_64 fields; };
+
+template
+class macho_nlist {
+public:
+ uint32_t n_strx() const INLINE { return E::get32(entry.fields.n_un.n_strx); }
+ void set_n_strx(uint32_t value) INLINE { E::set32((uint32_t&)entry.fields.n_un.n_strx, value); }
+
+ uint8_t n_type() const INLINE { return entry.fields.n_type; }
+ void set_n_type(uint8_t value) INLINE { entry.fields.n_type = value; }
+
+ uint8_t n_sect() const INLINE { return entry.fields.n_sect; }
+ void set_n_sect(uint8_t value) INLINE { entry.fields.n_sect = value; }
+
+ uint16_t n_desc() const INLINE { return E::get16(entry.fields.n_desc); }
+ void set_n_desc(uint16_t value) INLINE { E::set16((uint16_t&)entry.fields.n_desc, value); }
+
+ uint64_t n_value() const INLINE { return P::getP(entry.fields.n_value); }
+ void set_n_value(uint64_t value) INLINE { P::setP(entry.fields.n_value, value); }
+
+ typedef typename P::E E;
+private:
+ macho_nlist_content entry;
+};
+
+
+
+//
+// mach-o relocation info
+//
+template
+class macho_relocation_info {
+public:
+ uint32_t r_address() const INLINE { return E::get32(address); }
+ void set_r_address(uint32_t value) INLINE { E::set32(address, value); }
+
+ uint32_t r_symbolnum() const INLINE { return E::getBits(other, 0, 24); }
+ void set_r_symbolnum(uint32_t value) INLINE { E::setBits(other, value, 0, 24); }
+
+ bool r_pcrel() const INLINE { return E::getBits(other, 24, 1); }
+ void set_r_pcrel(bool value) INLINE { E::setBits(other, value, 24, 1); }
+
+ uint8_t r_length() const INLINE { return E::getBits(other, 25, 2); }
+ void set_r_length(uint8_t value) INLINE { E::setBits(other, value, 25, 2); }
+
+ bool r_extern() const INLINE { return E::getBits(other, 27, 1); }
+ void set_r_extern(bool value) INLINE { E::setBits(other, value, 27, 1); }
+
+ uint8_t r_type() const INLINE { return E::getBits(other, 28, 4); }
+ void set_r_type(uint8_t value) INLINE { E::setBits(other, value, 28, 4); }
+
+ void set_r_length() INLINE { set_r_length((sizeof(typename P::uint_t)==8) ? 3 : 2); }
+
+ typedef typename P::E E;
+private:
+ uint32_t address;
+ uint32_t other;
+};
+
+
+//
+// mach-o scattered relocation info
+// The bit fields are always in big-endian order (see mach-o/reloc.h)
+//
+template
+class macho_scattered_relocation_info {
+public:
+ bool r_scattered() const INLINE { return BigEndian::getBitsRaw(E::get32(other), 0, 1); }
+ void set_r_scattered(bool x) INLINE { uint32_t temp = E::get32(other); BigEndian::setBitsRaw(temp, x, 0, 1); E::set32(other, temp); }
+
+ bool r_pcrel() const INLINE { return BigEndian::getBitsRaw(E::get32(other), 1, 1); }
+ void set_r_pcrel(bool x) INLINE { uint32_t temp = E::get32(other); BigEndian::setBitsRaw(temp, x, 1, 1); E::set32(other, temp); }
+
+ uint8_t r_length() const INLINE { return BigEndian::getBitsRaw(E::get32(other), 2, 2); }
+ void set_r_length(uint8_t x) INLINE { uint32_t temp = E::get32(other); BigEndian::setBitsRaw(temp, x, 2, 2); E::set32(other, temp); }
+
+ uint8_t r_type() const INLINE { return BigEndian::getBitsRaw(E::get32(other), 4, 4); }
+ void set_r_type(uint8_t x) INLINE { uint32_t temp = E::get32(other); BigEndian::setBitsRaw(temp, x, 4, 4); E::set32(other, temp); }
+
+ uint32_t r_address() const INLINE { return BigEndian::getBitsRaw(E::get32(other), 8, 24); }
+ void set_r_address(uint32_t x) { if ( x > 0x00FFFFFF ) throw "scattered reloc r_address too large";
+ uint32_t temp = E::get32(other); BigEndian::setBitsRaw(temp, x, 8, 24); E::set32(other, temp); }
+
+ uint32_t r_value() const INLINE { return E::get32(value); }
+ void set_r_value(uint32_t x) INLINE { E::set32(value, x); }
+
+ uint32_t r_other() const INLINE { return other; }
+
+ void set_r_length() INLINE { set_r_length((sizeof(typename P::uint_t)==8) ? 3 : 2); }
+
+ typedef typename P::E E;
+private:
+ uint32_t other;
+ uint32_t value;
+};
+
+
+
+//
+// mach-o encyrption info load command
+//
+template
+class macho_encryption_info_command {
+public:
+ uint32_t cmd() const INLINE { return E::get32(fields.cmd); }
+ void set_cmd(uint32_t value) INLINE { E::set32(fields.cmd, value); }
+
+ uint32_t cmdsize() const INLINE { return E::get32(fields.cmdsize); }
+ void set_cmdsize(uint32_t value) INLINE { E::set32(fields.cmdsize, value); }
+
+ uint32_t cryptoff() const INLINE { return E::get32(fields.cryptoff); }
+ void set_cryptoff(uint32_t value) INLINE { E::set32(fields.cryptoff, value); }
+
+ uint32_t cryptsize() const INLINE { return E::get32(fields.cryptsize); }
+ void set_cryptsize(uint32_t value) INLINE { E::set32(fields.cryptsize, value); }
+
+ uint32_t cryptid() const INLINE { return E::get32(fields.cryptid); }
+ void set_cryptid(uint32_t value) INLINE { E::set32(fields.cryptid, value); }
+
+ typedef typename P::E E;
+private:
+ encryption_info_command fields;
+};
+
+
+//
+// start of __unwind_info section
+//
+template
+class macho_unwind_info_section_header {
+public:
+ uint32_t version() const INLINE { return E::get32(fields.version); }
+ void set_version(uint32_t value) INLINE { E::set32(fields.version, value); }
+
+ uint32_t commonEncodingsArraySectionOffset() const INLINE { return E::get32(fields.commonEncodingsArraySectionOffset); }
+ void set_commonEncodingsArraySectionOffset(uint32_t value) INLINE { E::set32(fields.commonEncodingsArraySectionOffset, value); }
+
+ uint32_t commonEncodingsArrayCount() const INLINE { return E::get32(fields.commonEncodingsArrayCount); }
+ void set_commonEncodingsArrayCount(uint32_t value) INLINE { E::set32(fields.commonEncodingsArrayCount, value); }
+
+ uint32_t personalityArraySectionOffset() const INLINE { return E::get32(fields.personalityArraySectionOffset); }
+ void set_personalityArraySectionOffset(uint32_t value) INLINE { E::set32(fields.personalityArraySectionOffset, value); }
+
+ uint32_t personalityArrayCount() const INLINE { return E::get32(fields.personalityArrayCount); }
+ void set_personalityArrayCount(uint32_t value) INLINE { E::set32(fields.personalityArrayCount, value); }
+
+ uint32_t indexSectionOffset() const INLINE { return E::get32(fields.indexSectionOffset); }
+ void set_indexSectionOffset(uint32_t value) INLINE { E::set32(fields.indexSectionOffset, value); }
+
+ uint32_t indexCount() const INLINE { return E::get32(fields.indexCount); }
+ void set_indexCount(uint32_t value) INLINE { E::set32(fields.indexCount, value); }
+
+ typedef typename P::E E;
+private:
+ unwind_info_section_header fields;
+};
+
+
+
+//
+// uwind first level index entry
+//
+template
+class macho_unwind_info_section_header_index_entry {
+public:
+ uint32_t functionOffset() const INLINE { return E::get32(fields.functionOffset); }
+ void set_functionOffset(uint32_t value) INLINE { E::set32(fields.functionOffset, value); }
+
+ uint32_t secondLevelPagesSectionOffset() const INLINE { return E::get32(fields.secondLevelPagesSectionOffset); }
+ void set_secondLevelPagesSectionOffset(uint32_t value) INLINE { E::set32(fields.secondLevelPagesSectionOffset, value); }
+
+ uint32_t lsdaIndexArraySectionOffset() const INLINE { return E::get32(fields.lsdaIndexArraySectionOffset); }
+ void set_lsdaIndexArraySectionOffset(uint32_t value) INLINE { E::set32(fields.lsdaIndexArraySectionOffset, value); }
+
+ typedef typename P::E E;
+private:
+ unwind_info_section_header_index_entry fields;
+};
+
+
+//
+// LSDA table entry
+//
+template
+class macho_unwind_info_section_header_lsda_index_entry {
+public:
+ uint32_t functionOffset() const INLINE { return E::get32(fields.functionOffset); }
+ void set_functionOffset(uint32_t value) INLINE { E::set32(fields.functionOffset, value); }
+
+ uint32_t lsdaOffset() const INLINE { return E::get32(fields.lsdaOffset); }
+ void set_lsdaOffset(uint32_t value) INLINE { E::set32(fields.lsdaOffset, value); }
+
+ typedef typename P::E E;
+private:
+ unwind_info_section_header_lsda_index_entry fields;
+};
+
+
+//
+// regular second level entry
+//
+template
+class macho_unwind_info_regular_second_level_entry {
+public:
+ uint32_t functionOffset() const INLINE { return E::get32(fields.functionOffset); }
+ void set_functionOffset(uint32_t value) INLINE { E::set32(fields.functionOffset, value); }
+
+ uint32_t encoding() const INLINE { return E::get32(fields.encoding); }
+ void set_encoding(uint32_t value) INLINE { E::set32(fields.encoding, value); }
+
+ typedef typename P::E E;
+private:
+ unwind_info_regular_second_level_entry fields;
+};
+
+
+//
+// start of second level regular page
+//
+template
+class macho_unwind_info_regular_second_level_page_header {
+public:
+ uint32_t kind() const INLINE { return E::get32(fields.kind); }
+ void set_kind(uint32_t value) INLINE { E::set32(fields.kind, value); }
+
+ uint16_t entryPageOffset() const INLINE { return E::get16(fields.entryPageOffset); }
+ void set_entryPageOffset(uint16_t value) INLINE { E::set16((uint16_t&)fields.entryPageOffset, value); }
+
+ uint16_t entryCount() const INLINE { return E::get16(fields.entryCount); }
+ void set_entryCount(uint16_t value) INLINE { E::set16((uint16_t&)fields.entryCount, value); }
+
+ typedef typename P::E E;
+private:
+ unwind_info_regular_second_level_page_header fields;
+};
+
+
+//
+// start of second level compressed page
+//
+template
+class macho_unwind_info_compressed_second_level_page_header {
+public:
+ uint32_t kind() const INLINE { return E::get32(fields.kind); }
+ void set_kind(uint32_t value) INLINE { E::set32(fields.kind, value); }
+
+ uint16_t entryPageOffset() const INLINE { return E::get16(fields.entryPageOffset); }
+ void set_entryPageOffset(uint16_t value) INLINE { E::set16((uint16_t&)fields.entryPageOffset, value); }
+
+ uint16_t entryCount() const INLINE { return E::get16(fields.entryCount); }
+ void set_entryCount(uint16_t value) INLINE { E::set16((uint16_t&)fields.entryCount, value); }
+
+ uint16_t encodingsPageOffset() const INLINE { return E::get16(fields.encodingsPageOffset); }
+ void set_encodingsPageOffset(uint16_t value) INLINE { E::set16((uint16_t&)fields.encodingsPageOffset, value); }
+
+ uint16_t encodingsCount() const INLINE { return E::get16(fields.encodingsCount); }
+ void set_encodingsCount(uint16_t value) INLINE { E::set16((uint16_t&)fields.encodingsCount, value); }
+
+ typedef typename P::E E;
+private:
+ unwind_info_compressed_second_level_page_header fields;
+};
+
+
+//
+// compressed dyld info load command
+//
+template
+class macho_dyld_info_command {
+public:
+ uint32_t cmd() const INLINE { return E::get32(fields.cmd); }
+ void set_cmd(uint32_t value) INLINE { E::set32(fields.cmd, value); }
+
+ uint32_t cmdsize() const INLINE { return E::get32(fields.cmdsize); }
+ void set_cmdsize(uint32_t value) INLINE { E::set32(fields.cmdsize, value); }
+
+ uint32_t rebase_off() const INLINE { return E::get32(fields.rebase_off); }
+ void set_rebase_off(uint32_t value) INLINE { E::set32(fields.rebase_off, value); }
+
+ uint32_t rebase_size() const INLINE { return E::get32(fields.rebase_size); }
+ void set_rebase_size(uint32_t value) INLINE { E::set32(fields.rebase_size, value); }
+
+ uint32_t bind_off() const INLINE { return E::get32(fields.bind_off); }
+ void set_bind_off(uint32_t value) INLINE { E::set32(fields.bind_off, value); }
+
+ uint32_t bind_size() const INLINE { return E::get32(fields.bind_size); }
+ void set_bind_size(uint32_t value) INLINE { E::set32(fields.bind_size, value); }
+
+ uint32_t weak_bind_off() const INLINE { return E::get32(fields.weak_bind_off); }
+ void set_weak_bind_off(uint32_t value) INLINE { E::set32(fields.weak_bind_off, value); }
+
+ uint32_t weak_bind_size() const INLINE { return E::get32(fields.weak_bind_size); }
+ void set_weak_bind_size(uint32_t value) INLINE { E::set32(fields.weak_bind_size, value); }
+
+ uint32_t lazy_bind_off() const INLINE { return E::get32(fields.lazy_bind_off); }
+ void set_lazy_bind_off(uint32_t value) INLINE { E::set32(fields.lazy_bind_off, value); }
+
+ uint32_t lazy_bind_size() const INLINE { return E::get32(fields.lazy_bind_size); }
+ void set_lazy_bind_size(uint32_t value) INLINE { E::set32(fields.lazy_bind_size, value); }
+
+ uint32_t export_off() const INLINE { return E::get32(fields.export_off); }
+ void set_export_off(uint32_t value) INLINE { E::set32(fields.export_off, value); }
+
+ uint32_t export_size() const INLINE { return E::get32(fields.export_size); }
+ void set_export_size(uint32_t value) INLINE { E::set32(fields.export_size, value); }
+
+
+ typedef typename P::E E;
+private:
+ dyld_info_command fields;
+};
+
+
+//
+// mach-o version load command
+//
+template
+class macho_version_min_command {
+public:
+ uint32_t cmd() const INLINE { return E::get32(fields.cmd); }
+ void set_cmd(uint32_t value) INLINE { E::set32(fields.cmd, value); }
+
+ uint32_t cmdsize() const INLINE { return E::get32(fields.cmdsize); }
+ void set_cmdsize(uint32_t value) INLINE { E::set32(fields.cmdsize, value); }
+
+ uint32_t version() const INLINE { return fields.version; }
+ void set_version(uint32_t value) INLINE { E::set32(fields.version, value); }
+
+#ifdef DICE_KIND_DATA
+ uint32_t sdk() const INLINE { return fields.sdk; }
+ void set_sdk(uint32_t value) INLINE { E::set32(fields.sdk, value); }
+#else
+ uint32_t sdk() const INLINE { return fields.reserved; }
+ void set_sdk(uint32_t value) INLINE { E::set32(fields.reserved, value); }
+#endif
+
+ typedef typename P::E E;
+private:
+ version_min_command fields;
+};
+
+
+//
+// mach-o __LD, __compact_unwind section in object files
+//
+template
+class macho_compact_unwind_entry {
+public:
+ typedef typename P::E E;
+ typedef typename P::uint_t pint_t;
+
+ pint_t codeStart() const INLINE { return P::getP(_codeStart); }
+ void set_codeStart(pint_t value) INLINE { P::setP(_codeStart, value); }
+
+ uint32_t codeLen() const INLINE { return E::get32(_codeLen); }
+ void set_codeLen(uint32_t value) INLINE { E::set32(_codeLen, value); }
+
+ uint32_t compactUnwindInfo() const INLINE { return E::get32(_compactUnwindInfo); }
+ void set_compactUnwindInfo(uint32_t value) INLINE { E::set32(_compactUnwindInfo, value); }
+
+ pint_t personality() const INLINE { return P::getP(_personality); }
+ void set_personality(pint_t value) INLINE { P::setP(_personality, value); }
+
+ pint_t lsda() const INLINE { return P::getP(_lsda); }
+ void set_lsda(pint_t value) INLINE { P::setP(_lsda, value); }
+
+ static uint32_t codeStartFieldOffset() INLINE { return offsetof(macho_compact_unwind_entry,_codeStart); }
+ static uint32_t personalityFieldOffset() INLINE { return offsetof(macho_compact_unwind_entry
,_personality); }
+ static uint32_t lsdaFieldOffset() INLINE { return offsetof(macho_compact_unwind_entry
,_lsda); }
+
+private:
+ pint_t _codeStart;
+ uint32_t _codeLen;
+ uint32_t _compactUnwindInfo;
+ pint_t _personality;
+ pint_t _lsda;
+};
+
+
+//
+// mach-o source version load command
+//
+template
+class macho_source_version_command {
+public:
+ uint32_t cmd() const INLINE { return E::get32(fields.cmd); }
+ void set_cmd(uint32_t value) INLINE { E::set32(fields.cmd, value); }
+
+ uint32_t cmdsize() const INLINE { return E::get32(fields.cmdsize); }
+ void set_cmdsize(uint32_t value) INLINE { E::set32(fields.cmdsize, value); }
+
+ uint64_t version() const INLINE { return fields.version; }
+ void set_version(uint64_t value) INLINE { E::set64(fields.version, value); }
+
+ typedef typename P::E E;
+private:
+ source_version_command fields;
+};
+
+
+//
+// mach-o source version load command
+//
+template
+class macho_entry_point_command {
+public:
+ uint32_t cmd() const INLINE { return E::get32(fields.cmd); }
+ void set_cmd(uint32_t value) INLINE { E::set32(fields.cmd, value); }
+
+ uint32_t cmdsize() const INLINE { return E::get32(fields.cmdsize); }
+ void set_cmdsize(uint32_t value) INLINE { E::set32(fields.cmdsize, value); }
+
+ uint64_t entryoff() const INLINE { return fields.entryoff; }
+ void set_entryoff(uint64_t value) INLINE { E::set64(fields.entryoff, value); }
+
+ uint64_t stacksize() const INLINE { return fields.stacksize; }
+ void set_stacksize(uint64_t value) INLINE { E::set64(fields.stacksize, value); }
+
+ typedef typename P::E E;
+private:
+ entry_point_command fields;
+};
+
+
+
+template
+class macho_data_in_code_entry {
+public:
+ uint32_t offset() const INLINE { return E::get32(fields.offset); }
+ void set_offset(uint32_t value) INLINE { E::set32(fields.offset, value); }
+
+ uint16_t length() const INLINE { return E::get16(fields.length); }
+ void set_length(uint16_t value) INLINE { E::set16((uint16_t&)fields.length, value); }
+
+ uint16_t kind() const INLINE { return E::get16(fields.kind); }
+ void set_kind(uint16_t value) INLINE { E::set16((uint16_t&)fields.kind, value); }
+
+ typedef typename P::E E;
+private:
+ data_in_code_entry fields;
+};
+
+
+#endif // __MACH_O_FILE_ABSTRACTION__
+
+
diff --git a/ld64-134.9/src/abstraction/MachOTrie.hpp b/ld64-134.9/src/abstraction/MachOTrie.hpp
new file mode 100644
index 0000000..1885e48
--- /dev/null
+++ b/ld64-134.9/src/abstraction/MachOTrie.hpp
@@ -0,0 +1,398 @@
+/* -*- mode: C++; c-basic-offset: 4; tab-width: 4 -*-
+ *
+ * Copyright (c) 2008-2010 Apple Inc. All rights reserved.
+ *
+ * @APPLE_LICENSE_HEADER_START@
+ *
+ * This file contains Original Code and/or Modifications of Original Code
+ * as defined in and that are subject to the Apple Public Source License
+ * Version 2.0 (the 'License'). You may not use this file except in
+ * compliance with the License. Please obtain a copy of the License at
+ * http://www.opensource.apple.com/apsl/ and read it before using this
+ * file.
+ *
+ * The Original Code and all software distributed under the License are
+ * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
+ * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
+ * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
+ * Please see the License for the specific language governing rights and
+ * limitations under the License.
+ *
+ * @APPLE_LICENSE_HEADER_END@
+*/
+#ifndef __MACH_O_TRIE__
+#define __MACH_O_TRIE__
+
+#include
+#include
+
+#include "MachOFileAbstraction.hpp"
+
+
+namespace mach_o {
+namespace trie {
+
+struct Edge
+{
+ Edge(const char* s, struct Node* n) : fSubString(s), fChild(n) { }
+ ~Edge() { }
+ const char* fSubString;
+ struct Node* fChild;
+
+};
+
+struct Node
+{
+ Node(const char* s) : fCummulativeString(s), fAddress(0), fFlags(0),
+ fOther(0), fImportedName(NULL), fOrdered(false),
+ fHaveExportInfo(false), fTrieOffset(0) {}
+ ~Node() { }
+ const char* fCummulativeString;
+ std::vector fChildren;
+ uint64_t fAddress;
+ uint64_t fFlags;
+ uint64_t fOther;
+ const char* fImportedName;
+ bool fOrdered;
+ bool fHaveExportInfo;
+ uint32_t fTrieOffset;
+
+ void addSymbol(const char* fullStr, uint64_t address, uint64_t flags, uint64_t other, const char* importName) {
+ const char* partialStr = &fullStr[strlen(fCummulativeString)];
+ for (std::vector::iterator it = fChildren.begin(); it != fChildren.end(); ++it) {
+ Edge& e = *it;
+ int subStringLen = strlen(e.fSubString);
+ if ( strncmp(e.fSubString, partialStr, subStringLen) == 0 ) {
+ // already have matching edge, go down that path
+ e.fChild->addSymbol(fullStr, address, flags, other, importName);
+ return;
+ }
+ else {
+ for (int i=subStringLen-1; i > 0; --i) {
+ if ( strncmp(e.fSubString, partialStr, i) == 0 ) {
+ // found a common substring, splice in new node
+ // was A -> C, now A -> B -> C
+ char* bNodeCummStr = strdup(e.fChild->fCummulativeString);
+ bNodeCummStr[strlen(bNodeCummStr)+i-subStringLen] = '\0';
+ //node* aNode = this;
+ Node* bNode = new Node(bNodeCummStr);
+ Node* cNode = e.fChild;
+ char* abEdgeStr = strdup(e.fSubString);
+ abEdgeStr[i] = '\0';
+ char* bcEdgeStr = strdup(&e.fSubString[i]);
+ Edge& abEdge = e;
+ abEdge.fSubString = abEdgeStr;
+ abEdge.fChild = bNode;
+ Edge bcEdge(bcEdgeStr, cNode);
+ bNode->fChildren.push_back(bcEdge);
+ bNode->addSymbol(fullStr, address, flags, other, importName);
+ return;
+ }
+ }
+ }
+ }
+ if ( flags & EXPORT_SYMBOL_FLAGS_REEXPORT ) {
+ assert(importName != NULL);
+ assert(other != 0);
+ }
+ if ( flags & EXPORT_SYMBOL_FLAGS_STUB_AND_RESOLVER ) {
+ assert(other != 0);
+ }
+ // no commonality with any existing child, make a new edge that is this whole string
+ Node* newNode = new Node(strdup(fullStr));
+ Edge newEdge(strdup(partialStr), newNode);
+ fChildren.push_back(newEdge);
+ newNode->fAddress = address;
+ newNode->fFlags = flags;
+ newNode->fOther = other;
+ if ( (flags & EXPORT_SYMBOL_FLAGS_REEXPORT) && (importName != NULL) && (strcmp(fullStr,importName) != 0) )
+ newNode->fImportedName = importName;
+ else
+ newNode->fImportedName = NULL;
+ newNode->fHaveExportInfo = true;
+ }
+
+ void addOrderedNodes(const char* name, std::vector& orderedNodes) {
+ if ( !fOrdered ) {
+ orderedNodes.push_back(this);
+ //fprintf(stderr, "ordered %p %s\n", this, fCummulativeString);
+ fOrdered = true;
+ }
+ const char* partialStr = &name[strlen(fCummulativeString)];
+ for (std::vector::iterator it = fChildren.begin(); it != fChildren.end(); ++it) {
+ Edge& e = *it;
+ int subStringLen = strlen(e.fSubString);
+ if ( strncmp(e.fSubString, partialStr, subStringLen) == 0 ) {
+ // already have matching edge, go down that path
+ e.fChild->addOrderedNodes(name, orderedNodes);
+ return;
+ }
+ }
+ }
+
+ // byte for terminal node size in bytes, or 0x00 if not terminal node
+ // teminal node (uleb128 flags, uleb128 addr [uleb128 other])
+ // byte for child node count
+ // each child: zero terminated substring, uleb128 node offset
+ bool updateOffset(uint32_t& offset) {
+ uint32_t nodeSize = 1; // length of export info when no export info
+ if ( fHaveExportInfo ) {
+ if ( fFlags & EXPORT_SYMBOL_FLAGS_REEXPORT ) {
+ nodeSize = uleb128_size(fFlags) + uleb128_size(fOther); // ordinal
+ if ( fImportedName != NULL )
+ nodeSize += strlen(fImportedName);
+ ++nodeSize; // trailing zero in imported name
+ }
+ else {
+ nodeSize = uleb128_size(fFlags) + uleb128_size(fAddress);
+ if ( fFlags & EXPORT_SYMBOL_FLAGS_STUB_AND_RESOLVER )
+ nodeSize += uleb128_size(fOther);
+ }
+ // do have export info, overall node size so far is uleb128 of export info + export info
+ nodeSize += uleb128_size(nodeSize);
+ }
+ // add children
+ ++nodeSize; // byte for count of chidren
+ for (std::vector::iterator it = fChildren.begin(); it != fChildren.end(); ++it) {
+ Edge& e = *it;
+ nodeSize += strlen(e.fSubString) + 1 + uleb128_size(e.fChild->fTrieOffset);
+ }
+ bool result = (fTrieOffset != offset);
+ fTrieOffset = offset;
+ //fprintf(stderr, "updateOffset %p %05d %s\n", this, fTrieOffset, fCummulativeString);
+ offset += nodeSize;
+ // return true if fTrieOffset was changed
+ return result;
+ }
+
+ void appendToStream(std::vector& out) {
+ if ( fHaveExportInfo ) {
+ if ( fFlags & EXPORT_SYMBOL_FLAGS_REEXPORT ) {
+ if ( fImportedName != NULL ) {
+ // nodes with re-export info: size, flags, ordinal, string
+ uint32_t nodeSize = uleb128_size(fFlags) + uleb128_size(fOther) + strlen(fImportedName) + 1;
+ out.push_back(nodeSize);
+ append_uleb128(fFlags, out);
+ append_uleb128(fOther, out);
+ append_string(fImportedName, out);
+ }
+ else {
+ // nodes with re-export info: size, flags, ordinal, empty-string
+ uint32_t nodeSize = uleb128_size(fFlags) + uleb128_size(fOther) + 1;
+ out.push_back(nodeSize);
+ append_uleb128(fFlags, out);
+ append_uleb128(fOther, out);
+ out.push_back(0);
+ }
+ }
+ else if ( fFlags & EXPORT_SYMBOL_FLAGS_STUB_AND_RESOLVER ) {
+ // nodes with export info: size, flags, address, other
+ uint32_t nodeSize = uleb128_size(fFlags) + uleb128_size(fAddress) + uleb128_size(fOther);
+ out.push_back(nodeSize);
+ append_uleb128(fFlags, out);
+ append_uleb128(fAddress, out);
+ append_uleb128(fOther, out);
+ }
+ else {
+ // nodes with export info: size, flags, address
+ uint32_t nodeSize = uleb128_size(fFlags) + uleb128_size(fAddress);
+ out.push_back(nodeSize);
+ append_uleb128(fFlags, out);
+ append_uleb128(fAddress, out);
+ }
+ }
+ else {
+ // no export info uleb128 of zero is one byte of zero
+ out.push_back(0);
+ }
+ // write number of children
+ out.push_back(fChildren.size());
+ // write each child
+ for (std::vector::iterator it = fChildren.begin(); it != fChildren.end(); ++it) {
+ Edge& e = *it;
+ append_string(e.fSubString, out);
+ append_uleb128(e.fChild->fTrieOffset, out);
+ }
+ }
+
+private:
+ static void append_uleb128(uint64_t value, std::vector& out) {
+ uint8_t byte;
+ do {
+ byte = value & 0x7F;
+ value &= ~0x7F;
+ if ( value != 0 )
+ byte |= 0x80;
+ out.push_back(byte);
+ value = value >> 7;
+ } while( byte >= 0x80 );
+ }
+
+ static void append_string(const char* str, std::vector& out) {
+ for (const char* s = str; *s != '\0'; ++s)
+ out.push_back(*s);
+ out.push_back('\0');
+ }
+
+ static unsigned int uleb128_size(uint64_t value) {
+ uint32_t result = 0;
+ do {
+ value = value >> 7;
+ ++result;
+ } while ( value != 0 );
+ return result;
+ }
+
+
+};
+
+inline uint64_t read_uleb128(const uint8_t*& p, const uint8_t* end) {
+ uint64_t result = 0;
+ int bit = 0;
+ do {
+ if (p == end)
+ throw "malformed uleb128 extends beyond trie";
+
+ uint64_t slice = *p & 0x7f;
+
+ if (bit >= 64 || slice << bit >> bit != slice)
+ throw "uleb128 too big for 64-bits";
+ else {
+ result |= (slice << bit);
+ bit += 7;
+ }
+ }
+ while (*p++ & 0x80);
+ return result;
+}
+
+
+
+struct Entry
+{
+ const char* name;
+ uint64_t address;
+ uint64_t flags;
+ uint64_t other;
+ const char* importName;
+};
+
+
+
+inline void makeTrie(const std::vector& entries, std::vector& output)
+{
+ Node start(strdup(""));
+
+ // make nodes for all exported symbols
+ for (std::vector::const_iterator it = entries.begin(); it != entries.end(); ++it) {
+ start.addSymbol(it->name, it->address, it->flags, it->other, it->importName);
+ }
+
+ // create vector of nodes
+ std::vector orderedNodes;
+ orderedNodes.reserve(entries.size()*2);
+ for (std::vector::const_iterator it = entries.begin(); it != entries.end(); ++it) {
+ start.addOrderedNodes(it->name, orderedNodes);
+ }
+
+ // assign each node in the vector an offset in the trie stream, iterating until all uleb128 sizes have stabilized
+ bool more;
+ do {
+ uint32_t offset = 0;
+ more = false;
+ for (std::vector::iterator it = orderedNodes.begin(); it != orderedNodes.end(); ++it) {
+ if ( (*it)->updateOffset(offset) )
+ more = true;
+ }
+ } while ( more );
+
+ // create trie stream
+ for (std::vector::iterator it = orderedNodes.begin(); it != orderedNodes.end(); ++it) {
+ (*it)->appendToStream(output);
+ }
+}
+
+struct EntryWithOffset
+{
+ uintptr_t nodeOffset;
+ Entry entry;
+
+ bool operator<(const EntryWithOffset& other) const { return ( nodeOffset < other.nodeOffset ); }
+};
+
+
+
+static inline void processExportNode(const uint8_t* const start, const uint8_t* p, const uint8_t* const end,
+ char* cummulativeString, int curStrOffset,
+ std::vector& output)
+{
+ if ( p >= end )
+ throw "malformed trie, node past end";
+ const uint8_t terminalSize = read_uleb128(p, end);
+ const uint8_t* children = p + terminalSize;
+ if ( terminalSize != 0 ) {
+ EntryWithOffset e;
+ e.nodeOffset = p-start;
+ e.entry.name = strdup(cummulativeString);
+ e.entry.flags = read_uleb128(p, end);
+ if ( e.entry.flags & EXPORT_SYMBOL_FLAGS_REEXPORT ) {
+ e.entry.address = 0;
+ e.entry.other = read_uleb128(p, end); // dylib ordinal
+ e.entry.importName = (char*)p;
+ }
+ else {
+ e.entry.address = read_uleb128(p, end);
+ if ( e.entry.flags & EXPORT_SYMBOL_FLAGS_STUB_AND_RESOLVER )
+ e.entry.other = read_uleb128(p, end);
+ else
+ e.entry.other = 0;
+ e.entry.importName = NULL;
+ }
+ output.push_back(e);
+ }
+ const uint8_t childrenCount = *children++;
+ const uint8_t* s = children;
+ for (uint8_t i=0; i < childrenCount; ++i) {
+ int edgeStrLen = 0;
+ while (*s != '\0') {
+ cummulativeString[curStrOffset+edgeStrLen] = *s++;
+ ++edgeStrLen;
+ }
+ cummulativeString[curStrOffset+edgeStrLen] = *s++;
+ uint32_t childNodeOffset = read_uleb128(s, end);
+ if (childNodeOffset == 0)
+ throw "malformed trie, childNodeOffset==0";
+ processExportNode(start, start+childNodeOffset, end, cummulativeString, curStrOffset+edgeStrLen, output);
+ }
+}
+
+
+inline void parseTrie(const uint8_t* start, const uint8_t* end, std::vector& output)
+{
+ // empty trie has no entries
+ if ( start == end )
+ return;
+ // worst case largest exported symbol names is length of whole trie
+ char* cummulativeString = new char[end-start];
+ std::vector entries;
+ processExportNode(start, start, end, cummulativeString, 0, entries);
+ // to preserve tie layout order, sort by node offset
+ std::sort(entries.begin(), entries.end());
+ // copy to output
+ output.reserve(entries.size());
+ for (std::vector::iterator it=entries.begin(); it != entries.end(); ++it)
+ output.push_back(it->entry);
+ delete cummulativeString;
+}
+
+
+
+
+}; // namespace trie
+}; // namespace mach_o
+
+
+#endif // __MACH_O_TRIE__
+
+
diff --git a/ld64-134.9/src/create_configure b/ld64-134.9/src/create_configure
new file mode 100755
index 0000000..1a85b46
--- /dev/null
+++ b/ld64-134.9/src/create_configure
@@ -0,0 +1,45 @@
+#!/bin/bash
+
+echo "" > ${DERIVED_FILE_DIR}/configure.h
+
+if [ -n "${IPHONEOS_DEPLOYMENT_TARGET}" ]; then
+ echo "#define DEFAULT_IPHONEOS_MIN_VERSION \"${IPHONEOS_DEPLOYMENT_TARGET}\"" >> ${DERIVED_FILE_DIR}/configure.h
+else
+ if [ -n "${MACOSX_DEPLOYMENT_TARGET}" ]; then
+ echo "#define DEFAULT_MACOSX_MIN_VERSION \"${MACOSX_DEPLOYMENT_TARGET}\"" >> ${DERIVED_FILE_DIR}/configure.h
+ fi
+fi
+
+if [ -z "${RC_SUPPORTED_ARCHS}" ]; then
+ RC_SUPPORTED_ARCHS="i386 x86_64"
+fi
+
+for ANARCH in ${RC_SUPPORTED_ARCHS}
+do
+ KNOWN_ARCHS=",armv4t,armv5,armv6,armv7,armv7f,armv7k,armv7s,i386,x86_64,"
+ FOUND=`echo "$KNOWN_ARCHS" | grep ",$ANARCH,"`
+ if [ $FOUND ]; then
+ echo "#define SUPPORT_ARCH_$ANARCH 1" >> ${DERIVED_FILE_DIR}/configure.h
+ else
+ echo "#error uknown architecture: $ANARCH" >> ${DERIVED_FILE_DIR}/configure.h
+ fi
+done
+
+echo "#define ALL_SUPPORTED_ARCHS \"${RC_SUPPORTED_ARCHS}\"" >> ${DERIVED_FILE_DIR}/configure.h
+
+
+# ld64 hardcodes a reference to /Developer/usr/lib/libLTO.dylib
+if [ -n "${DT_TOOLCHAIN_DIR}" ]
+then
+ echo "-Wl,-lazy_library,${DT_TOOLCHAIN_DIR}/usr/lib/libLTO.dylib" > ${DERIVED_SOURCES_DIR}/LTO_option.txt
+else
+ if [ -e "/Developer/usr/lib/libLTO.dylib" ]
+ then
+ echo "-Wl,-lazy_library,/Developer/usr/lib/libLTO.dylib" > ${DERIVED_SOURCES_DIR}/LTO_option.txt
+ else
+ echo "-Wl,-lazy_library,${BUILT_PRODUCTS_DIR}/../lib/libLTO.dylib" > ${DERIVED_SOURCES_DIR}/LTO_option.txt
+ fi
+fi
+
+
+
diff --git a/ld64-134.9/src/ld/Architectures.hpp b/ld64-134.9/src/ld/Architectures.hpp
new file mode 100644
index 0000000..1145550
--- /dev/null
+++ b/ld64-134.9/src/ld/Architectures.hpp
@@ -0,0 +1,61 @@
+/* -*- mode: C++; c-basic-offset: 4; tab-width: 4 -*-
+ *
+ * Copyright (c) 2005-2010 Apple Inc. All rights reserved.
+ *
+ * @APPLE_LICENSE_HEADER_START@
+ *
+ * This file contains Original Code and/or Modifications of Original Code
+ * as defined in and that are subject to the Apple Public Source License
+ * Version 2.0 (the 'License'). You may not use this file except in
+ * compliance with the License. Please obtain a copy of the License at
+ * http://www.opensource.apple.com/apsl/ and read it before using this
+ * file.
+ *
+ * The Original Code and all software distributed under the License are
+ * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
+ * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
+ * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
+ * Please see the License for the specific language governing rights and
+ * limitations under the License.
+ *
+ * @APPLE_LICENSE_HEADER_END@
+ */
+
+#ifndef __ARCHITECTURES__
+#define __ARCHITECTURES__
+
+#include "FileAbstraction.hpp"
+
+
+//
+// Architectures
+//
+struct ppc
+{
+ typedef Pointer32 P;
+};
+
+struct ppc64
+{
+ typedef Pointer64 P;
+};
+
+struct x86
+{
+ typedef Pointer32 P;
+};
+
+struct x86_64
+{
+ typedef Pointer64 P;
+};
+
+struct arm
+{
+ typedef Pointer32 P;
+};
+
+#endif // __ARCHITECTURES__
+
+
diff --git a/ld64-134.9/src/ld/HeaderAndLoadCommands.hpp b/ld64-134.9/src/ld/HeaderAndLoadCommands.hpp
new file mode 100644
index 0000000..0885715
--- /dev/null
+++ b/ld64-134.9/src/ld/HeaderAndLoadCommands.hpp
@@ -0,0 +1,1439 @@
+/* -*- mode: C++; c-basic-offset: 4; tab-width: 4 -*-*
+ *
+ * Copyright (c) 2009-2011 Apple Inc. All rights reserved.
+ *
+ * @APPLE_LICENSE_HEADER_START@
+ *
+ * This file contains Original Code and/or Modifications of Original Code
+ * as defined in and that are subject to the Apple Public Source License
+ * Version 2.0 (the 'License'). You may not use this file except in
+ * compliance with the License. Please obtain a copy of the License at
+ * http://www.opensource.apple.com/apsl/ and read it before using this
+ * file.
+ *
+ * The Original Code and all software distributed under the License are
+ * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
+ * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
+ * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
+ * Please see the License for the specific language governing rights and
+ * limitations under the License.
+ *
+ * @APPLE_LICENSE_HEADER_END@
+ */
+
+#ifndef __HEADER_LOAD_COMMANDS_HPP__
+#define __HEADER_LOAD_COMMANDS_HPP__
+
+#include
+#include
+#include
+#include
+
+#include
+
+#include "MachOFileAbstraction.hpp"
+#include "Options.h"
+#include "ld.hpp"
+
+namespace ld {
+namespace tool {
+
+class HeaderAndLoadCommandsAbtract : public ld::Atom
+{
+public:
+ HeaderAndLoadCommandsAbtract(const ld::Section& sect, ld::Atom::Definition d,
+ ld::Atom::Combine c, ld::Atom::Scope s, ld::Atom::ContentType ct,
+ ld::Atom::SymbolTableInclusion i, bool dds, bool thumb, bool al,
+ ld::Atom::Alignment a) : ld::Atom(sect, d, c, s, ct, i, dds, thumb, al, a) { }
+
+ virtual void setUUID(const uint8_t digest[16]) = 0;
+ virtual void recopyUUIDCommand() = 0;
+};
+
+template
+class HeaderAndLoadCommandsAtom : public HeaderAndLoadCommandsAbtract
+{
+public:
+ HeaderAndLoadCommandsAtom(const Options& opts, ld::Internal& state,
+ OutputFile& writer);
+
+ // overrides of ld::Atom
+ virtual ld::File* file() const { return NULL; }
+ virtual const char* name() const { return "mach-o header and load commands"; }
+ virtual uint64_t size() const;
+ virtual uint64_t objectAddress() const { return _address; }
+ virtual void copyRawContent(uint8_t buffer[]) const;
+
+ // overrides of HeaderAndLoadCommandsAbtract
+ virtual void setUUID(const uint8_t digest[16]) { memcpy(_uuid, digest, 16); }
+ virtual void recopyUUIDCommand();
+
+private:
+ typedef typename A::P P;
+ typedef typename A::P::E E;
+ typedef typename A::P::uint_t pint_t;
+
+ unsigned int nonHiddenSectionCount() const;
+ unsigned int segmentCount() const;
+ static uint32_t alignedSize(uint32_t x);
+ uint32_t magic() const;
+ uint32_t cpuType() const;
+ uint32_t cpuSubType() const;
+ uint32_t flags() const;
+ uint32_t fileType() const;
+ uint32_t commandsCount() const;
+ uint32_t threadLoadCommandSize() const;
+ uint8_t* copySingleSegmentLoadCommand(uint8_t* p) const;
+ uint8_t* copySegmentLoadCommands(uint8_t* p) const;
+ uint8_t* copyDyldInfoLoadCommand(uint8_t* p) const;
+ uint8_t* copySymbolTableLoadCommand(uint8_t* p) const;
+ uint8_t* copyDynamicSymbolTableLoadCommand(uint8_t* p) const;
+ uint8_t* copyDyldLoadCommand(uint8_t* p) const;
+ uint8_t* copyDylibIDLoadCommand(uint8_t* p) const;
+ uint8_t* copyRoutinesLoadCommand(uint8_t* p) const;
+ uint8_t* copyUUIDLoadCommand(uint8_t* p) const;
+ uint8_t* copyVersionLoadCommand(uint8_t* p) const;
+ uint8_t* copySourceVersionLoadCommand(uint8_t* p) const;
+ uint8_t* copyThreadsLoadCommand(uint8_t* p) const;
+ uint8_t* copyEntryPointLoadCommand(uint8_t* p) const;
+ uint8_t* copyEncryptionLoadCommand(uint8_t* p) const;
+ uint8_t* copySplitSegInfoLoadCommand(uint8_t* p) const;
+ uint8_t* copyDylibLoadCommand(uint8_t* p, const ld::dylib::File*) const;
+ uint8_t* copyRPathLoadCommand(uint8_t* p, const char*) const;
+ uint8_t* copySubFrameworkLoadCommand(uint8_t* p) const;
+ uint8_t* copyAllowableClientLoadCommand(uint8_t* p, const char* client) const;
+ uint8_t* copySubLibraryLoadCommand(uint8_t* p, const char* name) const;
+ uint8_t* copySubUmbrellaLoadCommand(uint8_t* p, const char* name) const;
+ uint8_t* copyFunctionStartsLoadCommand(uint8_t* p) const;
+ uint8_t* copyDataInCodeLoadCommand(uint8_t* p) const;
+ uint8_t* copyDependentDRLoadCommand(uint8_t* p) const;
+ uint8_t* copyDyldEnvLoadCommand(uint8_t* p, const char* env) const;
+
+ uint32_t sectionFlags(ld::Internal::FinalSection* sect) const;
+ bool sectionTakesNoDiskSpace(ld::Internal::FinalSection* sect) const;
+
+
+ const Options& _options;
+ ld::Internal& _state;
+ OutputFile& _writer;
+ pint_t _address;
+ bool _hasDyldInfoLoadCommand;
+ bool _hasDyldLoadCommand;
+ bool _hasDylibIDLoadCommand;
+ bool _hasThreadLoadCommand;
+ bool _hasEntryPointLoadCommand;
+ bool _hasEncryptionLoadCommand;
+ bool _hasSplitSegInfoLoadCommand;
+ bool _hasRoutinesLoadCommand;
+ bool _hasUUIDLoadCommand;
+ bool _hasSymbolTableLoadCommand;
+ bool _hasDynamicSymbolTableLoadCommand;
+ bool _hasRPathLoadCommands;
+ bool _hasSubFrameworkLoadCommand;
+ bool _hasVersionLoadCommand;
+ bool _hasFunctionStartsLoadCommand;
+ bool _hasDataInCodeLoadCommand;
+ bool _hasSourceVersionLoadCommand;
+ bool _hasDependentDRInfo;
+ uint32_t _dylibLoadCommmandsCount;
+ uint32_t _allowableClientLoadCommmandsCount;
+ uint32_t _dyldEnvironExrasCount;
+ std::vector _subLibraryNames;
+ std::vector _subUmbrellaNames;
+ uint8_t _uuid[16];
+ mutable macho_uuid_command* _uuidCmdInOutputBuffer;
+
+ static ld::Section _s_section;
+ static ld::Section _s_preload_section;
+};
+
+template
+ld::Section HeaderAndLoadCommandsAtom::_s_section("__TEXT", "__mach_header", ld::Section::typeMachHeader, true);
+template
+ld::Section HeaderAndLoadCommandsAtom::_s_preload_section("__HEADER", "__mach_header", ld::Section::typeMachHeader, true);
+
+
+template
+HeaderAndLoadCommandsAtom::HeaderAndLoadCommandsAtom(const Options& opts, ld::Internal& state, OutputFile& writer)
+ : HeaderAndLoadCommandsAbtract((opts.outputKind() == Options::kPreload) ? _s_preload_section : _s_section,
+ ld::Atom::definitionRegular, ld::Atom::combineNever,
+ ld::Atom::scopeTranslationUnit, ld::Atom::typeUnclassified,
+ ld::Atom::symbolTableNotIn, false, false, false,
+ (opts.outputKind() == Options::kPreload) ? ld::Atom::Alignment(0) : ld::Atom::Alignment(12) ),
+ _options(opts), _state(state), _writer(writer), _address(0), _uuidCmdInOutputBuffer(NULL)
+{
+ bzero(_uuid, 16);
+ _hasDyldInfoLoadCommand = opts.makeCompressedDyldInfo();
+ _hasDyldLoadCommand = ((opts.outputKind() == Options::kDynamicExecutable) || (_options.outputKind() == Options::kDyld));
+ _hasDylibIDLoadCommand = (opts.outputKind() == Options::kDynamicLibrary);
+ _hasThreadLoadCommand = _options.needsThreadLoadCommand();
+ _hasEntryPointLoadCommand = _options.needsEntryPointLoadCommand();
+ _hasEncryptionLoadCommand = opts.makeEncryptable();
+ _hasSplitSegInfoLoadCommand = opts.sharedRegionEligible();
+ _hasRoutinesLoadCommand = (opts.initFunctionName() != NULL);
+ _hasSymbolTableLoadCommand = true;
+ _hasUUIDLoadCommand = (opts.UUIDMode() != Options::kUUIDNone);
+ switch ( opts.outputKind() ) {
+ case Options::kDynamicExecutable:
+ case Options::kDynamicLibrary:
+ case Options::kDynamicBundle:
+ case Options::kDyld:
+ case Options::kKextBundle:
+ _hasDynamicSymbolTableLoadCommand = true;
+ break;
+ case Options::kObjectFile:
+ if ( ! state.someObjectFileHasDwarf )
+ _hasUUIDLoadCommand = false;
+ _hasDynamicSymbolTableLoadCommand = false;
+ for (std::vector::iterator it = _state.sections.begin(); it != _state.sections.end(); ++it) {
+ if ( (*it)->type() == ld::Section::typeNonLazyPointer ) {
+ _hasDynamicSymbolTableLoadCommand = true;
+ break;
+ }
+ }
+ break;
+ case Options::kStaticExecutable:
+ _hasDynamicSymbolTableLoadCommand = opts.positionIndependentExecutable();
+ break;
+ case Options::kPreload:
+ _hasDynamicSymbolTableLoadCommand = opts.positionIndependentExecutable();
+ break;
+ }
+ _hasRPathLoadCommands = (_options.rpaths().size() != 0);
+ _hasSubFrameworkLoadCommand = (_options.umbrellaName() != NULL);
+ _hasVersionLoadCommand = _options.addVersionLoadCommand();
+ _hasFunctionStartsLoadCommand = _options.addFunctionStarts();
+ _hasDataInCodeLoadCommand = _options.addDataInCodeInfo();
+ _hasSourceVersionLoadCommand = _options.needsSourceVersionLoadCommand();
+ _hasDependentDRInfo = _options.needsDependentDRInfo();
+ _dylibLoadCommmandsCount = _writer.dylibCount();
+ _allowableClientLoadCommmandsCount = _options.allowableClients().size();
+ _dyldEnvironExrasCount = _options.dyldEnvironExtras().size();
+ if ( ! _options.useSimplifiedDylibReExports() ) {
+ // target OS does not support LC_REEXPORT_DYLIB, so use old complicated load commands
+ for(uint32_t ord=1; ord <= _writer.dylibCount(); ++ord) {
+ const ld::dylib::File* dylib = _writer.dylibByOrdinal(ord);
+ if ( dylib->willBeReExported() ) {
+ // if child says it is an sub-framework of the image being created, then nothing to do here
+ bool isSubFramework = false;
+ const char* childInUmbrella = dylib->parentUmbrella();
+ if ( childInUmbrella != NULL ) {
+ const char* myLeaf = strrchr(_options.installPath(), '/');
+ if ( myLeaf != NULL ) {
+ if ( strcmp(childInUmbrella, &myLeaf[1]) == 0 )
+ isSubFramework = true;
+ }
+ }
+ // LC_SUB_FRAMEWORK is in child, so do nothing in parent
+ if ( ! isSubFramework ) {
+ // this dylib also needs a sub_x load command
+ bool isFrameworkReExport = false;
+ const char* lastSlash = strrchr(dylib->installPath(), '/');
+ if ( lastSlash != NULL ) {
+ char frameworkName[strlen(lastSlash)+20];
+ sprintf(frameworkName, "/%s.framework/", &lastSlash[1]);
+ isFrameworkReExport = (strstr(dylib->installPath(), frameworkName) != NULL);
+ }
+ if ( isFrameworkReExport ) {
+ // needs a LC_SUB_UMBRELLA command
+ _subUmbrellaNames.push_back(&lastSlash[1]);
+ }
+ else {
+ // needs a LC_SUB_LIBRARY command
+ const char* nameStart = &lastSlash[1];
+ if ( lastSlash == NULL )
+ nameStart = dylib->installPath();
+ int len = strlen(nameStart);
+ const char* dot = strchr(nameStart, '.');
+ if ( dot != NULL )
+ len = dot - nameStart;
+ char* subLibName = new char[len+1];
+ strlcpy(subLibName, nameStart, len+1);
+ _subLibraryNames.push_back(subLibName);
+ }
+ }
+ }
+ }
+ }
+}
+
+template
+uint32_t HeaderAndLoadCommandsAtom::alignedSize(uint32_t size)
+{
+ if ( sizeof(pint_t) == 4 )
+ return ((size+3) & (-4)); // 4-byte align all load commands for 32-bit mach-o
+ else
+ return ((size+7) & (-8)); // 8-byte align all load commands for 64-bit mach-o
+}
+
+
+template
+unsigned int HeaderAndLoadCommandsAtom::nonHiddenSectionCount() const
+{
+ unsigned int count = 0;
+ for (std::vector::iterator it = _state.sections.begin(); it != _state.sections.end(); ++it) {
+ if ( ! (*it)->isSectionHidden() && ((*it)->type() != ld::Section::typeTentativeDefs) )
+ ++count;
+ }
+ return count;
+}
+
+template
+unsigned int HeaderAndLoadCommandsAtom::segmentCount() const
+{
+ if ( _options.outputKind() == Options::kObjectFile ) {
+ // .o files have one anonymous segment that contains all sections
+ return 1;
+ }
+
+ unsigned int count = 0;
+ const char* lastSegName = "";
+ for (std::vector::iterator it = _state.sections.begin(); it != _state.sections.end(); ++it) {
+ if ( _options.outputKind() == Options::kPreload ) {
+ if ( (*it)->type() == ld::Section::typeMachHeader )
+ continue; // for -preload, don't put hidden __HEADER segment into output
+ if ( (*it)->type() == ld::Section::typeLinkEdit )
+ continue; // for -preload, don't put hidden __LINKEDIT segment into output
+ }
+ if ( strcmp(lastSegName, (*it)->segmentName()) != 0 ) {
+ lastSegName = (*it)->segmentName();
+ ++count;
+ }
+ }
+ return count;
+}
+
+
+template
+uint64_t HeaderAndLoadCommandsAtom::size() const
+{
+ uint32_t sz = sizeof(macho_header);
+
+ sz += sizeof(macho_segment_command
) * this->segmentCount();
+ sz += sizeof(macho_section
) * this->nonHiddenSectionCount();
+
+ if ( _hasDylibIDLoadCommand )
+ sz += alignedSize(sizeof(macho_dylib_command
) + strlen(_options.installPath()) + 1);
+
+ if ( _hasDyldInfoLoadCommand )
+ sz += sizeof(macho_dyld_info_command
);
+
+ if ( _hasSymbolTableLoadCommand )
+ sz += sizeof(macho_symtab_command
);
+
+ if ( _hasDynamicSymbolTableLoadCommand )
+ sz += sizeof(macho_dysymtab_command
);
+
+ if ( _hasDyldLoadCommand )
+ sz += alignedSize(sizeof(macho_dylinker_command
) + strlen(_options.dyldInstallPath()) + 1);
+
+ if ( _hasRoutinesLoadCommand )
+ sz += sizeof(macho_routines_command
);
+
+ if ( _hasUUIDLoadCommand )
+ sz += sizeof(macho_uuid_command
);
+
+ if ( _hasVersionLoadCommand )
+ sz += sizeof(macho_version_min_command
);
+
+ if ( _hasSourceVersionLoadCommand )
+ sz += sizeof(macho_source_version_command
);
+
+ if ( _hasThreadLoadCommand )
+ sz += this->threadLoadCommandSize();
+
+ if ( _hasEntryPointLoadCommand )
+ sz += sizeof(macho_entry_point_command
);
+
+ if ( _hasEncryptionLoadCommand )
+ sz += sizeof(macho_encryption_info_command
);
+
+ if ( _hasSplitSegInfoLoadCommand )
+ sz += sizeof(macho_linkedit_data_command
);
+
+ for(uint32_t ord=1; ord <= _writer.dylibCount(); ++ord) {
+ sz += alignedSize(sizeof(macho_dylib_command
) + strlen(_writer.dylibByOrdinal(ord)->installPath()) + 1);
+ }
+
+ if ( _hasRPathLoadCommands ) {
+ const std::vector& rpaths = _options.rpaths();
+ for (std::vector::const_iterator it = rpaths.begin(); it != rpaths.end(); ++it) {
+ sz += alignedSize(sizeof(macho_rpath_command) + strlen(*it) + 1);
+ }
+ }
+
+ if ( _hasSubFrameworkLoadCommand )
+ sz += alignedSize(sizeof(macho_sub_framework_command
) + strlen(_options.umbrellaName()) + 1);
+
+ for (std::vector::const_iterator it = _subLibraryNames.begin(); it != _subLibraryNames.end(); ++it) {
+ sz += alignedSize(sizeof(macho_sub_library_command) + strlen(*it) + 1);
+ }
+
+ for (std::vector::const_iterator it = _subUmbrellaNames.begin(); it != _subUmbrellaNames.end(); ++it) {
+ sz += alignedSize(sizeof(macho_sub_umbrella_command) + strlen(*it) + 1);
+ }
+
+ if ( _allowableClientLoadCommmandsCount != 0 ) {
+ const std::vector& clients = _options.allowableClients();
+ for (std::vector::const_iterator it = clients.begin(); it != clients.end(); ++it) {
+ sz += alignedSize(sizeof(macho_sub_client_command) + strlen(*it) + 1);
+ }
+ }
+
+ if ( _dyldEnvironExrasCount != 0 ) {
+ const std::vector& extras = _options.dyldEnvironExtras();
+ for (std::vector::const_iterator it = extras.begin(); it != extras.end(); ++it) {
+ sz += alignedSize(sizeof(macho_dylinker_command) + strlen(*it) + 1);
+ }
+ }
+
+ if ( _hasFunctionStartsLoadCommand )
+ sz += sizeof(macho_linkedit_data_command
);
+
+ if ( _hasDataInCodeLoadCommand )
+ sz += sizeof(macho_linkedit_data_command
);
+
+ if ( _hasDependentDRInfo )
+ sz += sizeof(macho_linkedit_data_command
);
+
+ return sz;
+}
+
+template
+uint32_t HeaderAndLoadCommandsAtom::commandsCount() const
+{
+ uint32_t count = this->segmentCount();
+
+ if ( _hasDylibIDLoadCommand )
+ ++count;
+
+ if ( _hasDyldInfoLoadCommand )
+ ++count;
+
+ if ( _hasSymbolTableLoadCommand )
+ ++count;
+
+ if ( _hasDynamicSymbolTableLoadCommand )
+ ++count;
+
+ if ( _hasDyldLoadCommand )
+ ++count;
+
+ if ( _hasRoutinesLoadCommand )
+ ++count;
+
+ if ( _hasUUIDLoadCommand )
+ ++count;
+
+ if ( _hasVersionLoadCommand )
+ ++count;
+
+ if ( _hasSourceVersionLoadCommand )
+ ++count;
+
+ if ( _hasThreadLoadCommand )
+ ++count;
+
+ if ( _hasEntryPointLoadCommand )
+ ++count;
+
+ if ( _hasEncryptionLoadCommand )
+ ++count;
+
+ if ( _hasSplitSegInfoLoadCommand )
+ ++count;
+
+ count += _dylibLoadCommmandsCount;
+
+ count += _options.rpaths().size();
+
+ if ( _hasSubFrameworkLoadCommand )
+ ++count;
+
+ count += _subLibraryNames.size();
+
+ count += _subUmbrellaNames.size();
+
+ count += _allowableClientLoadCommmandsCount;
+
+ count += _dyldEnvironExrasCount;
+
+ if ( _hasFunctionStartsLoadCommand )
+ ++count;
+
+ if ( _hasDataInCodeLoadCommand )
+ ++count;
+
+ if ( _hasDependentDRInfo )
+ ++count;
+
+ return count;
+}
+
+template
+uint32_t HeaderAndLoadCommandsAtom