nm: Add nm.c source and support for building the nm tool
[striptease.git] / README.txt
blob7f2644b715cb61c5a28d2bf4490ea11ca1bf31a6
1 striptease (or "tease" for short) is an enhanced version of strip.  It's
2 capable of stripping a binary's symbol table of non-text local symbols.
3 This mode, enabled with the -t switch, is similar to "strip -x", except
4 -x strips all local symbols including text symbols.  tease -t allows for
5 useful CrashReporter stacks to be generated on the deployment host.  This
6 is important in light of the hidden-visibility default (-fvisibility=hidden)
7 that results in many symbols not being marked as global and therefore being
8 stripped by an ordinary strip -x.
10 tease also includes a -no_code_signature option which strips any
11 LC_CODE_SIGNATURE load commands from the target file, in much the same way
12 as the ordinary strip's -no_uuid option.
14 tease also includes a -no_dylib filename option, which may be used more than
15 once, that strips any DYLIB load commands referencing the specified
16 filename.  The -no_dylib_unused option strips all unused dylib references.
18 Finally, tease includes an -a option, which instructs it to regenerate the
19 symbol table without stripping anything.  tease -a is intended to be used in
20 conjunction with -no_code_signature, -no_uuid, -no_dylib or -no_dylib_unused
21 to pass over the file and only strip the relevant Mach-O load commands
22 without removing anything from the symbol table.
24 striptease is based on strip.c and other supporting files in Apple's
25 cctools package.  This version of striptease is based on cctools-822,
26 corresponding to Xcode Tools 4.3 and Mac OS X 10.7.  It builds properly
27 under Xcode Tools 2.x on Mac OS X 10.4, as well.  The cctools package is
28 available from:
30 http://opensource.apple.com/tarballs/cctools/cctools-822.tar.gz
32 cctools, and therefore strip, are available under the APSL license:
34 http://www.opensource.apple.com/apsl/
36 All files from cctools necessary to build strip are included, unmodified.
37 This includes strip.c.  Changes to strip.c are made in tease.c.  Many other
38 files from the cctools package not relevant to strip (or tease) are omitted
39 from this distribution.  This README and an accompanying Makefile for
40 build system integration are also included.
42 Use "make" to build a build/Release/tease executable.
44 Use "make DEBUG=1" to build a build/Debug/tease debug executable.
46 Use "make clean" to remove the build directory and built executables.
48 Note that when building on 10.6 or 10.7, the MacOSX10.5.sdk must be present.
50 As a convenience, the install_name_tool.c source and nm.c source is also
51 included here along with an install_name_tool target and nm target in the
52 makefile.  The tools target will make all four tools (strip, tease,
53 install_name_tool, nm).  The resulting install_name_tool will run on 10.4+
54 but understand newer load commands so it can successfully adjust paths in
55 newer binaries on older systems.  The resulting nm will run on 10.4+ but
56 understand newer load commands so it can successfully examine symbols in
57 newer binaries on older systems.