1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
|
Index: odcctools-9.2-ld/ld64/src/MachOReaderRelocatable.hpp
===================================================================
--- odcctools-9.2-ld.orig/ld64/src/MachOReaderRelocatable.hpp 2013-08-15 14:29:30.863784082 +0000
+++ odcctools-9.2-ld/ld64/src/MachOReaderRelocatable.hpp 2013-08-15 14:29:30.931784083 +0000
@@ -28,6 +28,7 @@
#include <stdint.h>
#include <math.h>
#include <unistd.h>
+#include <stdio.h>
#include <sys/param.h>
#include <mach-o/ppc/reloc.h>
#include <mach-o/stab.h>
@@ -123,6 +124,21 @@
Kinds fKind;
};
+class BaseAtom : public ObjectFile::Atom
+{
+public:
+ BaseAtom() : fStabsStartIndex(0), fStabsCount(0) {}
+
+ virtual void setSize(uint64_t size) = 0;
+ virtual void addReference(ObjectFile::Reference* ref) = 0;
+ virtual void addLineInfo(const ObjectFile::LineInfo& info) = 0;
+ virtual void alignAtLeast(uint8_t align) = 0;
+
+ uint32_t fStabsStartIndex;
+ uint32_t fStabsCount;
+};
+
+
template <typename A>
Reference<A>::Reference(Kinds kind, const AtomAndOffset& at, const AtomAndOffset& toTarget)
@@ -213,19 +229,6 @@
DataSegment DataSegment::fgSingleton;
-class BaseAtom : public ObjectFile::Atom
-{
-public:
- BaseAtom() : fStabsStartIndex(0), fStabsCount(0) {}
-
- virtual void setSize(uint64_t size) = 0;
- virtual void addReference(ObjectFile::Reference* ref) = 0;
- virtual void addLineInfo(const ObjectFile::LineInfo& info) = 0;
- virtual void alignAtLeast(uint8_t align) = 0;
-
- uint32_t fStabsStartIndex;
- uint32_t fStabsCount;
-};
//
Index: odcctools-9.2-ld/ld64/src/MachOWriterExecutable.hpp
===================================================================
--- odcctools-9.2-ld.orig/ld64/src/MachOWriterExecutable.hpp 2013-08-15 14:29:30.863784082 +0000
+++ odcctools-9.2-ld/ld64/src/MachOWriterExecutable.hpp 2013-08-15 14:29:30.935784083 +0000
@@ -5029,6 +5029,30 @@
}
template <>
+StubHelperAtom<x86_64>::StubHelperAtom(Writer<x86_64>& writer, ObjectFile::Atom& target, ObjectFile::Atom& lazyPointer)
+ : WriterAtom<x86_64>(writer, Segment::fgTextSegment), fName(stubName(target.getName())), fTarget(target)
+{
+ writer.fAllSynthesizedStubHelpers.push_back(this);
+
+ fReferences.push_back(new WriterReference<x86_64>(3, x86_64::kPCRel32, &lazyPointer));
+ fReferences.push_back(new WriterReference<x86_64>(8, x86_64::kPCRel32, writer.fDyldHelper));
+ if ( writer.fDyldHelper == NULL )
+ throw "symbol dyld_stub_binding_helper not defined (usually in crt1.o/dylib1.o/bundle1.o)";
+}
+
+// specialize lazy pointer for x86_64 to initially pointer to stub helper
+template <>
+LazyPointerAtom<x86_64>::LazyPointerAtom(Writer<x86_64>& writer, ObjectFile::Atom& target)
+ : WriterAtom<x86_64>(writer, Segment::fgDataSegment), fName(lazyPointerName(target.getName())), fTarget(target)
+{
+ writer.fAllSynthesizedLazyPointers.push_back(this);
+
+ StubHelperAtom<x86_64>* helper = new StubHelperAtom<x86_64>(writer, target, *this);
+ fReferences.push_back(new WriterReference<x86_64>(0, x86_64::kPointer, helper));
+}
+
+
+template <>
StubAtom<x86_64>::StubAtom(Writer<x86_64>& writer, ObjectFile::Atom& target)
: WriterAtom<x86_64>(writer, Segment::fgTextSegment), fName(stubName(target.getName())), fTarget(target)
{
@@ -5165,20 +5189,6 @@
return "__jump_table";
}
-
-
-template <>
-StubHelperAtom<x86_64>::StubHelperAtom(Writer<x86_64>& writer, ObjectFile::Atom& target, ObjectFile::Atom& lazyPointer)
- : WriterAtom<x86_64>(writer, Segment::fgTextSegment), fName(stubName(target.getName())), fTarget(target)
-{
- writer.fAllSynthesizedStubHelpers.push_back(this);
-
- fReferences.push_back(new WriterReference<x86_64>(3, x86_64::kPCRel32, &lazyPointer));
- fReferences.push_back(new WriterReference<x86_64>(8, x86_64::kPCRel32, writer.fDyldHelper));
- if ( writer.fDyldHelper == NULL )
- throw "symbol dyld_stub_binding_helper not defined (usually in crt1.o/dylib1.o/bundle1.o)";
-}
-
template <>
uint64_t StubHelperAtom<x86_64>::getSize() const
{
@@ -5211,17 +5221,6 @@
}
-// specialize lazy pointer for x86_64 to initially pointer to stub helper
-template <>
-LazyPointerAtom<x86_64>::LazyPointerAtom(Writer<x86_64>& writer, ObjectFile::Atom& target)
- : WriterAtom<x86_64>(writer, Segment::fgDataSegment), fName(lazyPointerName(target.getName())), fTarget(target)
-{
- writer.fAllSynthesizedLazyPointers.push_back(this);
-
- StubHelperAtom<x86_64>* helper = new StubHelperAtom<x86_64>(writer, target, *this);
- fReferences.push_back(new WriterReference<x86_64>(0, x86_64::kPointer, helper));
-}
-
template <typename A>
LazyPointerAtom<A>::LazyPointerAtom(Writer<A>& writer, ObjectFile::Atom& target)
Index: odcctools-9.2-ld/ld64/src/Options.cpp
===================================================================
--- odcctools-9.2-ld.orig/ld64/src/Options.cpp 2013-08-15 14:29:30.863784082 +0000
+++ odcctools-9.2-ld/ld64/src/Options.cpp 2013-08-15 14:29:30.935784083 +0000
@@ -29,6 +29,10 @@
#include <fcntl.h>
#include <ctype.h>
#include <vector>
+#include <stdio.h>
+#include <unistd.h>
+#include <string.h>
+#include <limits.h>
#include "config.h"
#include "strlcpy.h"
Index: odcctools-9.2-ld/ld64/src/SectCreate.cpp
===================================================================
--- odcctools-9.2-ld.orig/ld64/src/SectCreate.cpp 2013-08-15 14:29:30.863784082 +0000
+++ odcctools-9.2-ld/ld64/src/SectCreate.cpp 2013-08-15 14:29:30.935784083 +0000
@@ -23,7 +23,10 @@
*/
#include <vector>
-
+#include <stdio.h>
+#include <unistd.h>
+#include <time.h>
+#include <string.h>
#include "ObjectFile.h"
namespace SectCreate {
Index: odcctools-9.2-ld/ld64/Makefile.in
===================================================================
--- odcctools-9.2-ld.orig/ld64/Makefile.in 2013-08-15 14:29:30.863784082 +0000
+++ odcctools-9.2-ld/ld64/Makefile.in 2013-08-15 14:29:30.935784083 +0000
@@ -37,7 +37,7 @@
MYWARNINGS =
MYDEFS = -DDEBUG
MYLDFLAGS = -L$(top_builddir)/libstuff
-MYLIBS = -lstuff
+MYLIBS = -lstuff -luuid
MYCOMPILEFLAGS = $(WARNINGS) $(MYWARNINGS) $(DEFS) $(MYDEFS) \
$(CPPFLAGS) $(MYINCLUDES) $(CFLAGS) $(MDYNAMICNOPIC)
Index: odcctools-9.2-ld/ld64/src/ld.cpp
===================================================================
--- odcctools-9.2-ld.orig/ld64/src/ld.cpp 2013-08-15 11:27:10.000000000 +0000
+++ odcctools-9.2-ld/ld64/src/ld.cpp 2013-08-15 14:38:22.975773627 +0000
@@ -639,12 +639,12 @@
void Linker::getVMInfo(vm_statistics_data_t& info)
{
- mach_msg_type_number_t count = sizeof(vm_statistics_data_t) / sizeof(natural_t);
- kern_return_t error = host_statistics(mach_host_self(), HOST_VM_INFO,
- (host_info_t)&info, &count);
- if (error != KERN_SUCCESS) {
+ //mach_msg_type_number_t count = sizeof(vm_statistics_data_t) / sizeof(natural_t);
+ //kern_return_t error = host_statistics(mach_host_self(), HOST_VM_INFO,
+ // (host_info_t)&info, &count);
+ //if (error != KERN_SUCCESS) {
bzero(&info, sizeof(vm_statistics_data_t));
- }
+ //}
}
void Linker::printStatistics()
|