Hi,
Thanks for answering.
I found a solution today and I guess some of you would like to know it.
(BTW, the compilation problem mentioned below probably caused during
"copy-paste" and it's not the problem).
Actually this staff, I guess, is architecture dependent. To call a
kernel function, module must be located close enough to kernel in the
address space in order to use regular call/branch/whatever assembly
instructions. Many architectures have limitations in their jump
instructions.
I thought about it and so tried to find a workaround. The solution is in
calling functions by their pointer. So if you call printk by its
pointer, all will work fine.
Anyway, thanks to all of you who replied (to list or directly) trying to
help.
George Agasandian
E-Mail:� [EMAIL PROTECTED]
-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]] On Behalf Of Gilad Ben-Yossef
Sent: Wednesday, July 17, 2002 23:00
To: George Agasandian
Cc: [EMAIL PROTECTED]
Subject: Re: Using printk in module
On Wed, 2002-07-17 at 21:44, George Agasandian wrote:
> Hi everybody,
>
> I'm trying to write a kernel module. Actually it's written. Even more,
I
> can compile it without warnings.
> However, when I'm loading it I get the following error message:
>
> mymodule.o: Relocation overflow of type 4 for printk
The source you supplied does not compile on it's own at all. After
removing the offending parts (the code that changes the syscall table
entry) the modules compiles and loads just fine.
Also, since I see you are trying to change the syscall table and doing
it backwards while at it, better have a look at syscall tracker at
http://syscalltrack.sf.net/ and don't reinvent the wheel ;-)
Gilad.
--
Gilad Ben-Yossef <[EMAIL PROTECTED]>
http://benyossef.com
"My god, they are here. They're watching us. They're inserting pieces of
code
into BK repository while Linus is sleeping!!!" -- 'adasi' Krecicki on
lkml.
=================================================================
To unsubscribe, send mail to [EMAIL PROTECTED] with
the word "unsubscribe" in the message body, e.g., run the command
echo unsubscribe | mail [EMAIL PROTECTED]
================================================================To unsubscribe, send
mail to [EMAIL PROTECTED] with
the word "unsubscribe" in the message body, e.g., run the command
echo unsubscribe | mail [EMAIL PROTECTED]