1 Index: busybox-1.8.1/editors/awk.c
2 ===================================================================
3 --- busybox-1.8.1.orig/editors/awk.c 2007-11-10 23:53:16.950053243 +0100
4 +++ busybox-1.8.1/editors/awk.c 2007-11-10 23:53:23.422422084 +0100
6 tsplitter fsplitter, rsplitter;
8 #define G1 (ptr_to_globals[-1])
9 -#define G (*(struct globals2 *const)ptr_to_globals)
10 +#define G (*(struct globals2 *)ptr_to_globals)
11 /* For debug. nm --size-sort awk.o | grep -vi ' [tr] ' */
12 /* char G1size[sizeof(G1)]; - 0x6c */
13 /* char Gsize[sizeof(G)]; - 0x1cc */
14 Index: busybox-1.8.1/include/libbb.h
15 ===================================================================
16 --- busybox-1.8.1.orig/include/libbb.h 2007-11-10 23:53:38.135260518 +0100
17 +++ busybox-1.8.1/include/libbb.h 2007-11-10 23:54:15.773405393 +0100
18 @@ -1111,8 +1111,10 @@
20 /* '*const' ptr makes gcc optimize code much better.
21 * Magic prevents ptr_to_globals from going into rodata.
22 - * If you want to assign a value, use PTR_TO_GLOBALS = xxx */
23 -extern struct globals *const ptr_to_globals;
24 + * If you want to assign a value, use PTR_TO_GLOBALS = xxx
25 + * unfortunately the above hack doesn't work properly :P
27 +extern struct globals *ptr_to_globals;
28 #define PTR_TO_GLOBALS (*(struct globals**)&ptr_to_globals)
31 Index: busybox-1.8.1/libbb/messages.c
32 ===================================================================
33 --- busybox-1.8.1.orig/libbb/messages.c 2007-11-10 23:52:47.116353117 +0100
34 +++ busybox-1.8.1/libbb/messages.c 2007-11-10 23:52:57.752959269 +0100
38 /* Make it reside in R/W memory: */
39 -struct globals *const ptr_to_globals __attribute__ ((section (".data")));
40 +struct globals *ptr_to_globals __attribute__ ((section (".data")));