enable multicast routing for linux 2.4 (#6037)
[oweals/openwrt.git] / target / linux / generic-2.4 / patches / 206-gcc_3.4_fixes.patch
1 --- a/arch/mips/kernel/signal.c
2 +++ b/arch/mips/kernel/signal.c
3 @@ -6,8 +6,10 @@
4   * Copyright (C) 1991, 1992  Linus Torvalds
5   * Copyright (C) 1994 - 1999  Ralf Baechle
6   * Copyright (C) 1999 Silicon Graphics, Inc.
7 + * Copyright (C) 2004  Maciej W. Rozycki
8   */
9  #include <linux/config.h>
10 +#include <linux/compiler.h>
11  #include <linux/sched.h>
12  #include <linux/mm.h>
13  #include <linux/smp.h>
14 @@ -76,7 +78,9 @@ int copy_siginfo_to_user(siginfo_t *to, 
15   * Atomically swap in the new signal mask, and wait for a signal.
16   */
17  save_static_function(sys_sigsuspend);
18 -static_unused int _sys_sigsuspend(struct pt_regs regs)
19 +static int _sys_sigsuspend(struct pt_regs regs)
20 +       __asm__("_sys_sigsuspend") __attribute_used__;
21 +static int _sys_sigsuspend(struct pt_regs regs)
22  {
23         sigset_t *uset, saveset, newset;
24  
25 @@ -102,7 +106,9 @@ static_unused int _sys_sigsuspend(struct
26  }
27  
28  save_static_function(sys_rt_sigsuspend);
29 -static_unused int _sys_rt_sigsuspend(struct pt_regs regs)
30 +static int _sys_rt_sigsuspend(struct pt_regs regs)
31 +       __asm__("_sys_rt_sigsuspend") __attribute_used__;
32 +static int _sys_rt_sigsuspend(struct pt_regs regs)
33  {
34         sigset_t *unewset, saveset, newset;
35          size_t sigsetsize;
36 --- a/arch/mips/kernel/syscall.c
37 +++ b/arch/mips/kernel/syscall.c
38 @@ -5,6 +5,7 @@
39   *
40   * Copyright (C) 1995 - 2000 by Ralf Baechle
41   * Copyright (C) 2000 Silicon Graphics, Inc.
42 + * Copyright (C) 2004  Maciej W. Rozycki
43   *
44   * TODO:  Implement the compatibility syscalls.
45   *        Don't waste that much memory for empty entries in the syscall
46 @@ -158,7 +159,9 @@ sys_mmap2(unsigned long addr, unsigned l
47  }
48  
49  save_static_function(sys_fork);
50 -static_unused int _sys_fork(struct pt_regs regs)
51 +static int _sys_fork(struct pt_regs regs)
52 +       __asm__("_sys_fork") __attribute_used__;
53 +static int _sys_fork(struct pt_regs regs)
54  {
55         int res;
56  
57 @@ -168,7 +171,9 @@ static_unused int _sys_fork(struct pt_re
58  
59  
60  save_static_function(sys_clone);
61 -static_unused int _sys_clone(struct pt_regs regs)
62 +static int _sys_clone(struct pt_regs regs)
63 +       __asm__("_sys_clone") __attribute_used__;
64 +static int _sys_clone(struct pt_regs regs)
65  {
66         unsigned long clone_flags;
67         unsigned long newsp;
68 --- a/arch/mips/ld.script.in
69 +++ b/arch/mips/ld.script.in
70 @@ -9,6 +9,7 @@ SECTIONS
71    {
72      _ftext = . ;
73      *(.text)
74 +    *(.fixup)
75      *(.rodata)
76      *(.rodata.*)
77      *(.rodata1)
78 --- a/arch/mips64/kernel/signal.c
79 +++ b/arch/mips64/kernel/signal.c
80 @@ -6,8 +6,10 @@
81   * Copyright (C) 1991, 1992  Linus Torvalds
82   * Copyright (C) 1994 - 2000  Ralf Baechle
83   * Copyright (C) 1999, 2000 Silicon Graphics, Inc.
84 + * Copyright (C) 2004  Maciej W. Rozycki
85   */
86  #include <linux/config.h>
87 +#include <linux/compiler.h>
88  #include <linux/sched.h>
89  #include <linux/mm.h>
90  #include <linux/smp.h>
91 @@ -75,7 +77,9 @@ int copy_siginfo_to_user(siginfo_t *to, 
92   * Atomically swap in the new signal mask, and wait for a signal.
93   */
94  save_static_function(sys_rt_sigsuspend);
95 -static_unused int _sys_rt_sigsuspend(abi64_no_regargs, struct pt_regs regs)
96 +static int _sys_rt_sigsuspend(abi64_no_regargs, struct pt_regs regs)
97 +       __asm__("_sys_rt_sigsuspend") __attribute_used__;
98 +static int _sys_rt_sigsuspend(abi64_no_regargs, struct pt_regs regs)
99  {
100         sigset_t *unewset, saveset, newset;
101          size_t sigsetsize;
102 --- a/arch/mips64/kernel/signal32.c
103 +++ b/arch/mips64/kernel/signal32.c
104 @@ -6,7 +6,9 @@
105   * Copyright (C) 1991, 1992  Linus Torvalds
106   * Copyright (C) 1994 - 2000  Ralf Baechle
107   * Copyright (C) 1999, 2000 Silicon Graphics, Inc.
108 + * Copyright (C) 2004  Maciej W. Rozycki
109   */
110 +#include <linux/compiler.h>
111  #include <linux/sched.h>
112  #include <linux/mm.h>
113  #include <linux/smp.h>
114 @@ -192,7 +194,9 @@ static inline int get_sigset(sigset_t *k
115   * Atomically swap in the new signal mask, and wait for a signal.
116   */
117  save_static_function(sys32_sigsuspend);
118 -static_unused int _sys32_sigsuspend(abi64_no_regargs, struct pt_regs regs)
119 +static int _sys32_sigsuspend(abi64_no_regargs, struct pt_regs regs)
120 +       __asm__("_sys32_sigsuspend") __attribute_used__;
121 +static int _sys32_sigsuspend(abi64_no_regargs, struct pt_regs regs)
122  {
123         sigset32_t *uset;
124         sigset_t newset, saveset;
125 @@ -219,7 +223,9 @@ static_unused int _sys32_sigsuspend(abi6
126  }
127  
128  save_static_function(sys32_rt_sigsuspend);
129 -static_unused int _sys32_rt_sigsuspend(abi64_no_regargs, struct pt_regs regs)
130 +static int _sys32_rt_sigsuspend(abi64_no_regargs, struct pt_regs regs)
131 +       __asm__("_sys32_rt_sigsuspend") __attribute_used__;
132 +static int _sys32_rt_sigsuspend(abi64_no_regargs, struct pt_regs regs)
133  {
134         sigset32_t *uset;
135         sigset_t newset, saveset;
136 --- a/arch/mips64/kernel/syscall.c
137 +++ b/arch/mips64/kernel/syscall.c
138 @@ -6,7 +6,9 @@
139   * Copyright (C) 1995 - 2000, 2001 by Ralf Baechle
140   * Copyright (C) 1999, 2000 Silicon Graphics, Inc.
141   * Copyright (C) 2001 MIPS Technologies, Inc.
142 + * Copyright (C) 2004  Maciej W. Rozycki
143   */
144 +#include <linux/compiler.h>
145  #include <linux/errno.h>
146  #include <linux/linkage.h>
147  #include <linux/mm.h>
148 @@ -151,7 +153,9 @@ out:
149  }
150  
151  save_static_function(sys_fork);
152 -static_unused int _sys_fork(abi64_no_regargs, struct pt_regs regs)
153 +static int _sys_fork(abi64_no_regargs, struct pt_regs regs)
154 +       __asm__("_sys_fork") __attribute_used__;
155 +static int _sys_fork(abi64_no_regargs, struct pt_regs regs)
156  {
157         int res;
158  
159 @@ -160,7 +164,9 @@ static_unused int _sys_fork(abi64_no_reg
160  }
161  
162  save_static_function(sys_clone);
163 -static_unused int _sys_clone(abi64_no_regargs, struct pt_regs regs)
164 +static int _sys_clone(abi64_no_regargs, struct pt_regs regs)
165 +       __asm__("_sys_clone") __attribute_used__;
166 +static int _sys_clone(abi64_no_regargs, struct pt_regs regs)
167  {
168         unsigned long clone_flags;
169         unsigned long newsp;
170 --- a/include/asm-mips/ptrace.h
171 +++ b/include/asm-mips/ptrace.h
172 @@ -4,6 +4,7 @@
173   * for more details.
174   *
175   * Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000 by Ralf Baechle
176 + * Copyright (C) 2004  Maciej W. Rozycki
177   *
178   * Machine dependent structs and defines to help the user use
179   * the ptrace system call.
180 @@ -64,12 +65,10 @@ __asm__ (                               
181          "sw\t$22,"__str(PT_R22)"($29)\n\t"                              \
182          "sw\t$23,"__str(PT_R23)"($29)\n\t"                              \
183          "sw\t$30,"__str(PT_R30)"($29)\n\t"                              \
184 +       "j\t_" #symbol "\n\t"                                           \
185          ".end\t" #symbol "\n\t"                                         \
186          ".size\t" #symbol",. - " #symbol)
187  
188 -/* Used in declaration of save_static functions.  */
189 -#define static_unused static __attribute__((unused))
190 -
191  #endif /* !__ASSEMBLY__ */
192  
193  /* Arbitrarily choose the same ptrace numbers as used by the Sparc code. */
194 --- a/include/asm-mips64/ptrace.h
195 +++ b/include/asm-mips64/ptrace.h
196 @@ -5,6 +5,7 @@
197   *
198   * Copyright (C) 1994, 95, 96, 97, 98, 99, 2000 by Ralf Baechle
199   * Copyright (C) 1999, 2000 Silicon Graphics, Inc.
200 + * Copyright (C) 2004  Maciej W. Rozycki
201   */
202  #ifndef _ASM_PTRACE_H
203  #define _ASM_PTRACE_H
204 @@ -61,12 +62,10 @@ __asm__ (                               
205          "sd\t$22,"__str(PT_R22)"($29)\n\t"                              \
206          "sd\t$23,"__str(PT_R23)"($29)\n\t"                              \
207          "sd\t$30,"__str(PT_R30)"($29)\n\t"                              \
208 +        "j\t_" #symbol "\n\t"                                           \
209          ".end\t" #symbol "\n\t"                                         \
210          ".size\t" #symbol",. - " #symbol)
211  
212 -/* Used in declaration of save_static functions.  */
213 -#define static_unused static __attribute__((unused))
214 -
215  #define abi64_no_regargs                                               \
216         unsigned long __dummy0,                                         \
217         unsigned long __dummy1,                                         \