This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Re: MIPS Assembly.
Paul;
Patching uaccess.h to wrap j 2b as follows:
.set noreorder
.set nomacro
j 2b
.set macro
.set reorder
still causes problems.
If the code is "correct" and it is the link that is the problem, then I
would like to know so I can address the symptoms in the best fashion.
Here's a test module that you can compile on MIPS that should generate
the errors I'm talking about.
gcc -I/location_of_my_kernel_includes -mips32 -DMODULE -D__KERNEL__ -c
moduletest.c
Cheers,
-=chris
On Mon, Jun 21, 2004 at 04:06:14PM -0400, Paul Koning wrote:
> >>>>> "Thiemo" == Thiemo Seufer <ica2_ts@csv.ica.uni-stuttgart.de> writes:
>
> Thiemo> ...A possible alternative might be to really use jumps in that
> Thiemo> case, but I don't see how this can be done sanely without a
> Thiemo> symbol as jump target.
>
> How about using ".set nomacro"? It already means "don't change my
> code, do what I told you". If it doesn't work that way in ALL cases,
> it should. This is just another such case.
>
> Alternatively, fix the linker so it complains if the branch is out of
> range so the assembler doesn't have to reject this code?
>
> paul
>
--
Chris Jones | Software Developer | Sutus, Inc.
t: +1.604.987.8866 x 2204 | e: cjones@sutus.com
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/ppp_channel.h>
int init_module() {
int j=1;
unsigned long data;
int foo = 1024;
data = &foo;
//OFFENDING k_call -> get_user() : See <asm/uaccess.h>
// Generates "j 2b" assembly
get_user(j,(int *)data);
return 0;
}
void cleanup_module() {
}