2 * Copyright (c) 2005 Apple Computer, Inc. All rights reserved.
4 * @APPLE_LICENSE_HEADER_START@
6 * This file contains Original Code and/or Modifications of Original Code
7 * as defined in and that are subject to the Apple Public Source License
8 * Version 2.0 (the 'License'). You may not use this file except in
9 * compliance with the License. Please obtain a copy of the License at
10 * http://www.opensource.apple.com/apsl/ and read it before using this
13 * The Original Code and all software distributed under the License are
14 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
15 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
16 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
17 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
18 * Please see the License for the specific language governing rights and
19 * limitations under the License.
21 * @APPLE_LICENSE_HEADER_END@
30 #include <mach-o/loader.h>
31 #include <mach-o/nlist.h>
32 #include <mach-o/reloc.h>
33 #include <mach-o/ppc/reloc.h>
34 #include <mach-o/stab.h>
41 #include "ObjectFile.h"
42 #include "ExecutableFile.h"
45 // buiild Writer for -arch ppc64
46 #undef MACHO_32_SAME_ENDIAN
47 #undef MACHO_32_OPPOSITE_ENDIAN
48 #undef MACHO_64_SAME_ENDIAN
49 #undef MACHO_64_OPPOSITE_ENDIAN
50 #if __ppc__ || __ppc64__
51 #define MACHO_64_SAME_ENDIAN
53 #define MACHO_64_OPPOSITE_ENDIAN
55 #error unknown architecture
61 #include "MachOAbstraction.h"
62 #include "ExecutableFileMachO.cpp"
65 // buiild Writer for -arch ppc
66 #undef MACHO_32_SAME_ENDIAN
67 #undef MACHO_32_OPPOSITE_ENDIAN
68 #undef MACHO_64_SAME_ENDIAN
69 #undef MACHO_64_OPPOSITE_ENDIAN
70 #if __ppc__ || __ppc64__
71 #define MACHO_32_SAME_ENDIAN
73 #define MACHO_32_OPPOSITE_ENDIAN
75 #error unknown architecture
81 #include "MachOAbstraction.h"
82 #include "ExecutableFileMachO.cpp"
85 // buiild Writer for -arch i386
86 #undef MACHO_32_SAME_ENDIAN
87 #undef MACHO_32_OPPOSITE_ENDIAN
88 #undef MACHO_64_SAME_ENDIAN
89 #undef MACHO_64_OPPOSITE_ENDIAN
90 #if __ppc__ || __ppc64__
91 #define MACHO_32_OPPOSITE_ENDIAN
93 #define MACHO_32_SAME_ENDIAN
95 #error unknown architecture
97 #undef i386 // compiler sometimes #defines this
102 #include "MachOAbstraction.h"
103 #include "ExecutableFileMachO.cpp"