1 |
xmw 10/08/24 14:29:29 |
2 |
|
3 |
Added: exmap-0.10-as-needed.patch exmap-0.10-gcc.patch |
4 |
exmap-0.10-makefiles.patch exmap-0.10-gcc45.patch |
5 |
exmap-0.10-fix64bit.patch exmap-0.10-kernel.patch |
6 |
Log: |
7 |
Initial comit for exmap |
8 |
(Portage version: 2.1.8.3/cvs/Linux x86_64) |
9 |
|
10 |
Revision Changes Path |
11 |
1.1 dev-util/exmap/files/exmap-0.10-as-needed.patch |
12 |
|
13 |
file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-util/exmap/files/exmap-0.10-as-needed.patch?rev=1.1&view=markup |
14 |
plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-util/exmap/files/exmap-0.10-as-needed.patch?rev=1.1&content-type=text/plain |
15 |
|
16 |
Index: exmap-0.10-as-needed.patch |
17 |
=================================================================== |
18 |
--- src/Makefile 2010-08-09 01:17:29.000000000 +0200 |
19 |
+++ src/Makefile 2010-08-09 01:21:13.000000000 +0200 |
20 |
@@ -42,15 +42,15 @@ |
21 |
OBJS += $(TR_OBJ) |
22 |
TESTS += t_range |
23 |
|
24 |
-TE_OBJ = t_elf.o Elf.o Range.o |
25 |
+TE_OBJ = t_elf.o Elf.o Range.o ../jutil/Pcre.o |
26 |
OBJS += $(TE_OBJ) |
27 |
TESTS += t_elf |
28 |
|
29 |
-TP_OBJ = t_pcre.o |
30 |
+TP_OBJ = t_pcre.o ../jutil/Pcre.o |
31 |
OBJS += $(TP_OBJ) |
32 |
TESTS += t_pcre |
33 |
|
34 |
-TX_OBJ = t_exmap.o $(EXMAP_OBJ) |
35 |
+TX_OBJ = t_exmap.o ../jutil/Pcre.o $(EXMAP_OBJ) |
36 |
OBJS += $(TX_OBJ) |
37 |
TESTS += t_exmap |
38 |
|
39 |
|
40 |
|
41 |
|
42 |
1.1 dev-util/exmap/files/exmap-0.10-gcc.patch |
43 |
|
44 |
file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-util/exmap/files/exmap-0.10-gcc.patch?rev=1.1&view=markup |
45 |
plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-util/exmap/files/exmap-0.10-gcc.patch?rev=1.1&content-type=text/plain |
46 |
|
47 |
Index: exmap-0.10-gcc.patch |
48 |
=================================================================== |
49 |
diff -ru exmap-0.10/work/exmap-0.10/jutil/jutil.cpp exm/work/exmap-0.10/jutil/jutil.cpp |
50 |
--- jutil/jutil.cpp 2006-09-28 18:52:25.000000000 +0200 |
51 |
+++ jutil/jutil.cpp 2010-02-15 15:35:43.000000000 +0100 |
52 |
@@ -3,6 +3,7 @@ |
53 |
#include <sys/types.h> |
54 |
#include <sys/stat.h> |
55 |
#include <unistd.h> |
56 |
+#include <cstring> |
57 |
#include <limits.h> |
58 |
#include <dirent.h> |
59 |
|
60 |
diff -ru exmap-0.10/work/exmap-0.10/jutil/jutil.hpp exm/work/exmap-0.10/jutil/jutil.hpp |
61 |
--- jutil/jutil.hpp 2006-09-28 18:52:25.000000000 +0200 |
62 |
+++ jutil/jutil.hpp 2010-02-15 15:40:02.000000000 +0100 |
63 |
@@ -3,6 +3,7 @@ |
64 |
|
65 |
#include <iostream> |
66 |
#include <string> |
67 |
+#include <cstdlib> |
68 |
#include <list> |
69 |
#include <map> |
70 |
|
71 |
diff -ru exmap-0.10/work/exmap-0.10/src/exmtool.cpp exm/work/exmap-0.10/src/exmtool.cpp |
72 |
--- src/exmtool.cpp 2006-09-28 18:52:25.000000000 +0200 |
73 |
+++ src/exmtool.cpp 2010-02-15 15:34:04.000000000 +0100 |
74 |
@@ -5,6 +5,7 @@ |
75 |
|
76 |
#include <sstream> |
77 |
#include <iostream> |
78 |
+#include <cstring> |
79 |
#include <vector> |
80 |
|
81 |
using namespace std; |
82 |
@@ -19,9 +18,9 @@ |
83 |
|
84 |
struct command |
85 |
{ |
86 |
- char *command; |
87 |
+ const char *command; |
88 |
Handler handler; |
89 |
- char *usage; |
90 |
+ const char *usage; |
91 |
} cmd_handles[] = { |
92 |
{ "procs", |
93 |
do_procs, |
94 |
|
95 |
diff -ru exmap-0.10/work/exmap-0.10/src/Elf.cpp norg/work/exmap-0.10/src/Elf.cpp |
96 |
--- src/Elf.cpp 2006-09-28 18:52:25.000000000 +0200 |
97 |
+++ src/Elf.cpp 2010-02-15 16:55:37.000000000 +0100 |
98 |
@@ -4,6 +4,7 @@ |
99 |
#include "Elf.hpp" |
100 |
|
101 |
#include <sstream> |
102 |
+#include <cstring> |
103 |
#include <unistd.h> // getpagesize() |
104 |
|
105 |
using namespace std; |
106 |
|
107 |
diff -ru exmap-0.10/jutil/TestRunner.cpp.orig exmap-0.10/jutil/TestRunner.cpp |
108 |
--- jutil/TestRunner.cpp.orig 2010-02-15 22:00:03.000000000 +0100 |
109 |
+++ jutil/TestRunner.cpp 2010-02-15 22:00:19.000000000 +0100 |
110 |
@@ -1,5 +1,6 @@ |
111 |
#include "TestRunner.hpp" |
112 |
#include "Pcre.hpp" |
113 |
+#include <cstdio> |
114 |
|
115 |
using namespace std; |
116 |
|
117 |
|
118 |
|
119 |
|
120 |
1.1 dev-util/exmap/files/exmap-0.10-makefiles.patch |
121 |
|
122 |
file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-util/exmap/files/exmap-0.10-makefiles.patch?rev=1.1&view=markup |
123 |
plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-util/exmap/files/exmap-0.10-makefiles.patch?rev=1.1&content-type=text/plain |
124 |
|
125 |
Index: exmap-0.10-makefiles.patch |
126 |
=================================================================== |
127 |
diff -ru exmap-0.10.orig/work/exmap-0.10/jutil/Makefile exmap-0.10/work/exmap-0.10/jutil/Makefile |
128 |
--- jutil/Makefile 2006-09-28 18:52:25.000000000 +0200 |
129 |
+++ jutil/Makefile 2010-02-17 17:31:56.000000000 +0100 |
130 |
@@ -12,21 +12,20 @@ |
131 |
OBJ += $(ETOBJ) |
132 |
EXES += egtest |
133 |
|
134 |
-CXX=g++ |
135 |
-CXXFLAGS=-Wall -Werror -g -I. |
136 |
-LD=g++ |
137 |
-LDFLAGS=-lpcre |
138 |
+CXX = g++ |
139 |
+CXXFLAGS += -Wall -Werror -I. |
140 |
+LD = ld |
141 |
|
142 |
build: $(LIBS) $(EXES) |
143 |
|
144 |
trun: $(TROBJ) $(JLIB) |
145 |
- $(LD) $(TROBJ) -o trun $(LDFLAGS) -ljutil -L. |
146 |
+ $(CXX) $(CXXFLAGS) $(LDFLAGS) $(TROBJ) -o trun -ljutil -lpcre -L. |
147 |
|
148 |
$(JLIB): $(JOBJ) |
149 |
ar rs $(JLIB) $(JOBJ) |
150 |
|
151 |
egtest: $(ETOBJ) |
152 |
- $(LD) $(ETOBJ) -o egtest $(LDFLAGS) |
153 |
+ $(CXX) $(CXXFLAGS) $(ETOBJ) -o egtest $(LDFLAGS) |
154 |
|
155 |
clean: |
156 |
rm -f $(OBJ) $(EXES) $(JLIB) *~ |
157 |
diff -ru exmap-0.10.orig/work/exmap-0.10/kernel/Makefile exmap-0.10/work/exmap-0.10/kernel/Makefile |
158 |
--- kernel/Makefile 2006-09-28 18:52:25.000000000 +0200 |
159 |
+++ kernel/Makefile 2010-02-17 17:30:06.000000000 +0100 |
160 |
@@ -7,7 +7,7 @@ |
161 |
build: kernel_modules |
162 |
|
163 |
kernel_modules: |
164 |
- make -C /lib/modules/$(shell uname -r)/build M=$(CURDIR) modules |
165 |
+ $(MAKE) -C ${KERNEL_DIR} M=$(CURDIR) modules |
166 |
|
167 |
clean: |
168 |
- make -C /lib/modules/$(shell uname -r)/build M=$(CURDIR) clean |
169 |
+ $(MAKE) -C ${KERNEL_DIR} M=$(CURDIR) clean |
170 |
Only in exmap-0.10/work/exmap-0.10/kernel/.tmp_versions: exmap.mod |
171 |
diff -ru exmap-0.10.orig/work/exmap-0.10/src/Makefile exmap-0.10/work/exmap-0.10/src/Makefile |
172 |
--- src/Makefile 2006-09-28 18:52:25.000000000 +0200 |
173 |
+++ src/Makefile 2010-02-17 17:33:38.000000000 +0100 |
174 |
@@ -1,5 +1,5 @@ |
175 |
CXX=g++ |
176 |
-LD=g++ |
177 |
+LD=ld |
178 |
JUTILDIR=../jutil |
179 |
|
180 |
#CXXFLAGS += -pg |
181 |
@@ -11,11 +11,12 @@ |
182 |
|
183 |
EXMAP_OBJ=Exmap.o Range.o Elf.o |
184 |
|
185 |
-CXXFLAGS += -g -Wall -Werror -I$(JUTILDIR) |
186 |
-LDFLAGS += -lpcre -ljutil -L$(JUTILDIR) |
187 |
+CXXFLAGS += -Wall -Werror -I$(JUTILDIR) |
188 |
+LDFLAGS += -L$(JUTILDIR) |
189 |
+LIBS += -lpcre -ljutil |
190 |
|
191 |
GTKCXXFLAGS = `pkg-config --cflags gtkmm-2.4` |
192 |
-GTKLDFLAGS = `pkg-config --libs gtkmm-2.4` |
193 |
+GTKLIBS = `pkg-config --libs gtkmm-2.4` |
194 |
|
195 |
# ------------------------------------------------------------ |
196 |
|
197 |
@@ -76,34 +77,34 @@ |
198 |
$(JUTILDIR)/trun $(TESTS) |
199 |
|
200 |
gexmap: $(GEM_OBJ) |
201 |
- $(LD) -o gexmap $(GEM_OBJ) $(LDFLAGS) $(GTKLDFLAGS) |
202 |
+ $(CXX) $(CXXFLAGS) $(LDFLAGS) -o gexmap $(GEM_OBJ) $(LIBS) $(GTKLIBS) |
203 |
|
204 |
gexmap.o: gexmap.cpp |
205 |
- $(CC) $(CXXFLAGS) $(GTKCXXFLAGS) -c $< |
206 |
+ $(CXX) $(CXXFLAGS) $(GTKCXXFLAGS) -c $< |
207 |
|
208 |
exmtool: $(CL_OBJ) |
209 |
- $(LD) -o exmtool $(CL_OBJ) $(LDFLAGS) |
210 |
+ $(CXX) $(CXXFLAGS) $(LDFLAGS) -o exmtool $(CL_OBJ) $(LIBS) |
211 |
|
212 |
elftool: $(ET_OBJ) |
213 |
- $(LD) -o elftool $(ET_OBJ) $(LDFLAGS) |
214 |
+ $(CXX) $(CXXFLAGS) $(LDFLAGS) -o elftool $(ET_OBJ) $(LIBS) |
215 |
|
216 |
showproc: $(SP_OBJ) |
217 |
- $(LD) -o showproc $(SP_OBJ) $(LDFLAGS) |
218 |
+ $(CXX) $(CXXFLAGS) $(LDFLAGS) -o showproc $(SP_OBJ) $(LIBS) |
219 |
|
220 |
t_range: $(TR_OBJ) |
221 |
- $(LD) -o t_range $(TR_OBJ) $(LDFLAGS) |
222 |
+ $(CXX) $(CXXFLAGS) $(LDFLAGS) -o t_range $(TR_OBJ) $(LIBS) |
223 |
|
224 |
t_elf: $(TE_OBJ) |
225 |
- $(LD) -o t_elf $(TE_OBJ) $(LDFLAGS) |
226 |
+ $(CXX) $(CXXFLAGS) $(LDFLAGS) -o t_elf $(TE_OBJ) $(LIBS) |
227 |
|
228 |
t_pcre: $(TP_OBJ) |
229 |
- $(LD) -o t_pcre $(TP_OBJ) $(LDFLAGS) |
230 |
+ $(CXX) $(CXXFLAGS) $(LDFLAGS) -o t_pcre $(TP_OBJ) $(LIBS) |
231 |
|
232 |
t_exmap: $(TX_OBJ) |
233 |
- $(LD) -o t_exmap $(TX_OBJ) $(LDFLAGS) |
234 |
+ $(CXX) $(CXXFLAGS) $(LDFLAGS) -o t_exmap $(TX_OBJ) $(LIBS) |
235 |
|
236 |
t_artsd: $(TA_OBJ) |
237 |
- $(LD) -o t_artsd $(TA_OBJ) $(LDFLAGS) |
238 |
+ $(CXX) $(CXXFLAGS) $(LDFLAGS) -o t_artsd $(TA_OBJ) $(LIBS) |
239 |
|
240 |
clean: cleantags cleandoc |
241 |
rm -f $(OBJS) $(EXES) $(SHLIBS) $(EXTRA_DEL_FILES) |
242 |
|
243 |
|
244 |
|
245 |
1.1 dev-util/exmap/files/exmap-0.10-gcc45.patch |
246 |
|
247 |
file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-util/exmap/files/exmap-0.10-gcc45.patch?rev=1.1&view=markup |
248 |
plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-util/exmap/files/exmap-0.10-gcc45.patch?rev=1.1&content-type=text/plain |
249 |
|
250 |
Index: exmap-0.10-gcc45.patch |
251 |
=================================================================== |
252 |
--- src/Elf.cpp 2010-05-14 01:40:27.000000000 +0200 |
253 |
+++ src/Elf.cpp 2010-05-14 01:46:06.000000000 +0200 |
254 |
@@ -579,7 +579,7 @@ |
255 |
std::string Section::find_string(istream &is, int index) |
256 |
{ |
257 |
if (!is_string_table() || index < 0) { |
258 |
- return false; |
259 |
+ return NULL; |
260 |
} |
261 |
|
262 |
int offset = _sectstruct->offset() + index; |
263 |
|
264 |
|
265 |
|
266 |
1.1 dev-util/exmap/files/exmap-0.10-fix64bit.patch |
267 |
|
268 |
file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-util/exmap/files/exmap-0.10-fix64bit.patch?rev=1.1&view=markup |
269 |
plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-util/exmap/files/exmap-0.10-fix64bit.patch?rev=1.1&content-type=text/plain |
270 |
|
271 |
Index: exmap-0.10-fix64bit.patch |
272 |
=================================================================== |
273 |
I quite frankly don't entirely understand this code, but exmap's debug |
274 |
output on i586 and x86_64 pointed out these differences and this makes |
275 |
it work. |
276 |
|
277 |
--- exmap-0.10/src/Exmap.cpp.sav 2006-09-28 18:52:25.000000000 +0200 |
278 |
+++ exmap-0.10/src/Exmap.cpp 2010-01-02 17:45:49.787955568 +0100 |
279 |
@@ -450,7 +450,7 @@ void Vma::add_pages(const list<Page> &pa |
280 |
|
281 |
bool Vma::is_vdso() |
282 |
{ |
283 |
- return fname() == "[vdso]"; |
284 |
+ return fname() == "[vdso]" || fname() == "[vsyscall]"; |
285 |
} |
286 |
|
287 |
bool Vma::is_file_backed() |
288 |
@@ -1495,7 +1495,7 @@ bool MapCalculator::calc_map_for_seg(con |
289 |
|
290 |
filevmas.pop_front(); |
291 |
dbg << pref.str() << "consuming vma\n"; |
292 |
- if (!filevmas.empty() && !filevmas.front()->is_file_backed()) { |
293 |
+ while (!filevmas.empty() && !filevmas.front()->is_file_backed()) { |
294 |
filevmas.pop_front(); |
295 |
dbg << pref.str() << "consuming anon vma\n"; |
296 |
} |
297 |
|
298 |
|
299 |
|
300 |
1.1 dev-util/exmap/files/exmap-0.10-kernel.patch |
301 |
|
302 |
file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-util/exmap/files/exmap-0.10-kernel.patch?rev=1.1&view=markup |
303 |
plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-util/exmap/files/exmap-0.10-kernel.patch?rev=1.1&content-type=text/plain |
304 |
|
305 |
Index: exmap-0.10-kernel.patch |
306 |
=================================================================== |
307 |
Tested with linux-2.6.16-gentoo-r13, linux-2.6.25-gentoo-r9, linux-2.6.26-gentoo-r4, linux-2.6.27-gentoo-r10, |
308 |
linux-2.6.28-gentoo-r6, linux-2.6.29-gentoo-r6, linux-2.6.30-gentoo-r9, linux-2.6.32-gentoo-r4, linux-2.6.32-gentoo-r5 |
309 |
|
310 |
diff -ru exmap-0.10.orig/work/exmap-0.10/kernel/exmap.c exmap-0.10/work/exmap-0.10/kernel/exmap.c |
311 |
--- kernel/exmap.c 2006-09-28 18:52:25.000000000 +0200 |
312 |
+++ kernel/exmap.c 2010-02-17 16:15:04.000000000 +0100 |
313 |
@@ -392,7 +392,11 @@ |
314 |
struct task_struct *tsk; |
315 |
int errcode = -EINVAL; |
316 |
|
317 |
+ #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,27) |
318 |
+ tsk = pid_task(find_pid_ns(pid, &init_pid_ns), PIDTYPE_PID); |
319 |
+ #else |
320 |
tsk = find_task_by_pid(pid); |
321 |
+ #endif |
322 |
if (tsk == NULL) { |
323 |
printk (KERN_ALERT |
324 |
"/proc/%s: can't find task for pid %d\n", |
325 |
@@ -507,7 +511,11 @@ |
326 |
NULL); |
327 |
|
328 |
if (exmap_proc_file == NULL) { |
329 |
+ #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,26) |
330 |
+ remove_proc_entry (PROCFS_NAME, NULL); |
331 |
+ #else |
332 |
remove_proc_entry (PROCFS_NAME, &proc_root); |
333 |
+ #endif |
334 |
printk (KERN_ALERT "/proc/%s: could not initialize\n", |
335 |
PROCFS_NAME); |
336 |
return -ENOMEM; |
337 |
@@ -523,7 +523,9 @@ |
338 |
|
339 |
exmap_proc_file->read_proc = procfile_read; |
340 |
exmap_proc_file->write_proc = procfile_write; |
341 |
+ #if LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,29) |
342 |
exmap_proc_file->owner = THIS_MODULE; |
343 |
+ #endif |
344 |
|
345 |
/* exmap_proc_file->mode = S_IFREG | S_IRUGO; */ |
346 |
/* TODO - this is quite probably a security problem */ |
347 |
@@ -532,5 +540,9 @@ |
348 |
void cleanup_module () |
349 |
{ |
350 |
printk (KERN_INFO "/proc/%s: remove\n", PROCFS_NAME); |
351 |
+ #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,26) |
352 |
+ remove_proc_entry (PROCFS_NAME, NULL); |
353 |
+ #else |
354 |
remove_proc_entry (PROCFS_NAME, &proc_root); |
355 |
+ #endif |
356 |
} |