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
|
Index: odcctools-9.2-ld/ld64/src/MachOReaderRelocatable.hpp
===================================================================
--- odcctools-9.2-ld.orig/ld64/src/MachOReaderRelocatable.hpp 2013-08-15 16:31:17.183614865 +0000
+++ odcctools-9.2-ld/ld64/src/MachOReaderRelocatable.hpp 2013-08-15 16:31:17.251614861 +0000
@@ -28,6 +28,7 @@
#include <stdint.h>
#include <math.h>
#include <unistd.h>
+#include <stdio.h>
#include <sys/param.h>
#include <vector>
@@ -83,6 +84,25 @@
uint32_t offset;
};
+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 sortReferences() = 0;
+ virtual void addLineInfo(const ObjectFile::LineInfo& info) = 0;
+ virtual uint64_t getObjectAddress() const = 0;
+ virtual uint32_t getOrdinal() const { return fOrdinal; }
+ virtual void setOrdinal(uint32_t value) { fOrdinal = value; }
+ virtual const void* getSectionRecord() const = 0;
+ virtual bool isAlias() const { return false; }
+
+ uint32_t fStabsStartIndex;
+ uint32_t fStabsCount;
+ uint32_t fOrdinal;
+};
template <typename A>
class Reference : public ObjectFile::Reference
@@ -268,26 +288,6 @@
LinkEditSegment LinkEditSegment::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 sortReferences() = 0;
- virtual void addLineInfo(const ObjectFile::LineInfo& info) = 0;
- virtual uint64_t getObjectAddress() const = 0;
- virtual uint32_t getOrdinal() const { return fOrdinal; }
- virtual void setOrdinal(uint32_t value) { fOrdinal = value; }
- virtual const void* getSectionRecord() const = 0;
- virtual bool isAlias() const { return false; }
-
- uint32_t fStabsStartIndex;
- uint32_t fStabsCount;
- uint32_t fOrdinal;
-};
-
class BaseAtomSorter
{
public:
Index: odcctools-9.2-ld/ld64/src/Options.cpp
===================================================================
--- odcctools-9.2-ld.orig/ld64/src/Options.cpp 2013-08-15 16:31:17.183614865 +0000
+++ odcctools-9.2-ld/ld64/src/Options.cpp 2013-08-15 16:31:17.251614861 +0000
@@ -28,6 +28,10 @@
#include <mach/vm_prot.h>
#include <fcntl.h>
#include <vector>
+#include <stdio.h>
+#include <unistd.h>
+#include <string.h>
+#include <limits.h>
#include "strlcpy.h"
#include "config.h"
Index: odcctools-9.2-ld/as/read.c
===================================================================
--- odcctools-9.2-ld.orig/as/read.c 2013-08-15 11:27:09.000000000 +0000
+++ odcctools-9.2-ld/as/read.c 2013-08-15 17:03:04.983570702 +0000
@@ -507,7 +507,6 @@
{ "lcomm", s_lcomm, 0 },
{ "line", s_line, 0 },
{ "long", cons, 4 },
- { "word", cons, 4 },
{ "quad", cons, 8 },
{ "lsym", s_lsym, 0 },
{ "section", s_section, 0 },
Index: odcctools-9.2-ld/ld64/src/ld.cpp
===================================================================
--- odcctools-9.2-ld.orig/ld64/src/ld.cpp 2013-08-15 16:31:17.183614865 +0000
+++ odcctools-9.2-ld/ld64/src/ld.cpp 2013-08-15 16:53:09.007584481 +0000
@@ -2926,42 +2926,42 @@
switch (fArchitecture) {
case CPU_TYPE_POWERPC:
if ( mach_o::relocatable::Reader<ppc>::validFile(p) )
- return this->addObject(new mach_o::relocatable::Reader<ppc>::Reader(p, info.path, info.modTime, fOptions.readerOptions(), fNextInputOrdinal), info, len);
+ return this->addObject(new mach_o::relocatable::Reader<ppc>(p, info.path, info.modTime, fOptions.readerOptions(), fNextInputOrdinal), info, len);
else if ( mach_o::dylib::Reader<ppc>::validFile(p, info.options.fBundleLoader) )
- return this->addDylib(new mach_o::dylib::Reader<ppc>::Reader(p, len, info.path, info.options, fOptions.readerOptions(), fNextInputOrdinal), info, len);
+ return this->addDylib(new mach_o::dylib::Reader<ppc>(p, len, info.path, info.options, fOptions.readerOptions(), fNextInputOrdinal), info, len);
else if ( archive::Reader<ppc>::validFile(p, len) )
- return this->addArchive(new archive::Reader<ppc>::Reader(p, len, info.path, info.modTime, fOptions.readerOptions(), fNextInputOrdinal), info, len);
+ return this->addArchive(new archive::Reader<ppc>(p, len, info.path, info.modTime, fOptions.readerOptions(), fNextInputOrdinal), info, len);
break;
case CPU_TYPE_POWERPC64:
if ( mach_o::relocatable::Reader<ppc64>::validFile(p) )
- return this->addObject(new mach_o::relocatable::Reader<ppc64>::Reader(p, info.path, info.modTime, fOptions.readerOptions(), fNextInputOrdinal), info, len);
+ return this->addObject(new mach_o::relocatable::Reader<ppc64>(p, info.path, info.modTime, fOptions.readerOptions(), fNextInputOrdinal), info, len);
else if ( mach_o::dylib::Reader<ppc64>::validFile(p, info.options.fBundleLoader) )
- return this->addDylib(new mach_o::dylib::Reader<ppc64>::Reader(p, len, info.path, info.options, fOptions.readerOptions(), fNextInputOrdinal), info, len);
+ return this->addDylib(new mach_o::dylib::Reader<ppc64>(p, len, info.path, info.options, fOptions.readerOptions(), fNextInputOrdinal), info, len);
else if ( archive::Reader<ppc64>::validFile(p, len) )
- return this->addArchive(new archive::Reader<ppc64>::Reader(p, len, info.path, info.modTime, fOptions.readerOptions(), fNextInputOrdinal), info, len);
+ return this->addArchive(new archive::Reader<ppc64>(p, len, info.path, info.modTime, fOptions.readerOptions(), fNextInputOrdinal), info, len);
break;
case CPU_TYPE_I386:
if ( mach_o::relocatable::Reader<x86>::validFile(p) )
- return this->addObject(new mach_o::relocatable::Reader<x86>::Reader(p, info.path, info.modTime, fOptions.readerOptions(), fNextInputOrdinal), info, len);
+ return this->addObject(new mach_o::relocatable::Reader<x86>(p, info.path, info.modTime, fOptions.readerOptions(), fNextInputOrdinal), info, len);
else if ( mach_o::dylib::Reader<x86>::validFile(p, info.options.fBundleLoader) )
- return this->addDylib(new mach_o::dylib::Reader<x86>::Reader(p, len, info.path, info.options, fOptions.readerOptions(), fNextInputOrdinal), info, len);
+ return this->addDylib(new mach_o::dylib::Reader<x86>(p, len, info.path, info.options, fOptions.readerOptions(), fNextInputOrdinal), info, len);
else if ( archive::Reader<x86>::validFile(p, len) )
- return this->addArchive(new archive::Reader<x86>::Reader(p, len, info.path, info.modTime, fOptions.readerOptions(), fNextInputOrdinal), info, len);
+ return this->addArchive(new archive::Reader<x86>(p, len, info.path, info.modTime, fOptions.readerOptions(), fNextInputOrdinal), info, len);
break;
case CPU_TYPE_X86_64:
if ( mach_o::relocatable::Reader<x86_64>::validFile(p) )
- return this->addObject(new mach_o::relocatable::Reader<x86_64>::Reader(p, info.path, info.modTime, fOptions.readerOptions(), fNextInputOrdinal), info, len);
+ return this->addObject(new mach_o::relocatable::Reader<x86_64>(p, info.path, info.modTime, fOptions.readerOptions(), fNextInputOrdinal), info, len);
else if ( mach_o::dylib::Reader<x86_64>::validFile(p, info.options.fBundleLoader) )
- return this->addDylib(new mach_o::dylib::Reader<x86_64>::Reader(p, len, info.path, info.options, fOptions.readerOptions(), fNextInputOrdinal), info, len);
+ return this->addDylib(new mach_o::dylib::Reader<x86_64>(p, len, info.path, info.options, fOptions.readerOptions(), fNextInputOrdinal), info, len);
else if ( archive::Reader<x86_64>::validFile(p, len) )
- return this->addArchive(new archive::Reader<x86_64>::Reader(p, len, info.path, info.modTime, fOptions.readerOptions(), fNextInputOrdinal), info, len);
+ return this->addArchive(new archive::Reader<x86_64>(p, len, info.path, info.modTime, fOptions.readerOptions(), fNextInputOrdinal), info, len);
case CPU_TYPE_ARM:
if ( mach_o::relocatable::Reader<arm>::validFile(p) )
- return this->addObject(new mach_o::relocatable::Reader<arm>::Reader(p, info.path, info.modTime, fOptions.readerOptions(), fNextInputOrdinal), info, len);
+ return this->addObject(new mach_o::relocatable::Reader<arm>(p, info.path, info.modTime, fOptions.readerOptions(), fNextInputOrdinal), info, len);
else if ( mach_o::dylib::Reader<arm>::validFile(p, info.options.fBundleLoader) )
- return this->addDylib(new mach_o::dylib::Reader<arm>::Reader(p, len, info.path, info.options, fOptions.readerOptions(), fNextInputOrdinal), info, len);
+ return this->addDylib(new mach_o::dylib::Reader<arm>(p, len, info.path, info.options, fOptions.readerOptions(), fNextInputOrdinal), info, len);
else if ( archive::Reader<arm>::validFile(p, len) )
- return this->addArchive(new archive::Reader<arm>::Reader(p, len, info.path, info.modTime, fOptions.readerOptions(), fNextInputOrdinal), info, len);
+ return this->addArchive(new archive::Reader<arm>(p, len, info.path, info.modTime, fOptions.readerOptions(), fNextInputOrdinal), info, len);
break;
break;
}
|