All of lore.kernel.org
 help / color / mirror / Atom feed
* insmod problems
@ 2001-05-06 16:13 Shay Deloya
  2001-05-09  2:40 ` Ralf Baechle
  0 siblings, 1 reply; 15+ messages in thread
From: Shay Deloya @ 2001-05-06 16:13 UTC (permalink / raw)
  To: linux-mips

Hi All,

I have an old problem came up again and the old solution aren't helping.
I'm using busybox version 0.50 and with kernel 2.2 , and inserting 
some modules ,especially those with DEBUG macroes e.g:
#define DEBUG_HIGH(args...) {if (debug_level >= HIGH) printk(args);}
causes the message :
Relocation overflow of type 4 for

and insmod fails.

I'm compiling the modules with -mlong-calls and still getting this message.

Is it insmod knowen bugs that the relocation is done in bad way or 
a linker/compiler bug. I'm using compiler: egcs ver 1.0.3a
I'm checking this problem at the moment and looking for insmod bug.

Thanks,

Shay Deloya
______________________________________
Software Developer
Jungo - R&D
email: shayd@jungo.com
web: http://www.jungo.com
Phone: 1-877-514-0537(USA)  +972-9-8859365(Worldwide) ext. 221
Fax:   1-877-514-0538(USA)  +972-9-8859366(Worldwide)

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: insmod problems
  2001-05-06 16:13 insmod problems Shay Deloya
@ 2001-05-09  2:40 ` Ralf Baechle
  2001-05-10  8:53   ` Michael Shmulevich
  0 siblings, 1 reply; 15+ messages in thread
From: Ralf Baechle @ 2001-05-09  2:40 UTC (permalink / raw)
  To: Shay Deloya; +Cc: linux-mips

On Sun, May 06, 2001 at 07:13:43PM +0300, Shay Deloya wrote:

> I have an old problem came up again and the old solution aren't helping.
> I'm using busybox version 0.50 and with kernel 2.2 , and inserting 
> some modules ,especially those with DEBUG macroes e.g:
> #define DEBUG_HIGH(args...) {if (debug_level >= HIGH) printk(args);}
> causes the message :
> Relocation overflow of type 4 for
> 
> and insmod fails.
> 
> I'm compiling the modules with -mlong-calls and still getting this message.
> 
> Is it insmod knowen bugs that the relocation is done in bad way or 
> a linker/compiler bug. I'm using compiler: egcs ver 1.0.3a
> I'm checking this problem at the moment and looking for insmod bug.

You'll have to upgrade to very current binutils which for mips*-linux
targets default to elf32-trad{big,little}mips, not IRIX ELF format.  Also
it seems your modutils are a bit rotten, get the latest from ftp.kernel.org.

  Ralf

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: insmod problems
  2001-05-09  2:40 ` Ralf Baechle
@ 2001-05-10  8:53   ` Michael Shmulevich
  2001-05-10 18:46     ` Ralf Baechle
  0 siblings, 1 reply; 15+ messages in thread
From: Michael Shmulevich @ 2001-05-10  8:53 UTC (permalink / raw)
  To: Ralf Baechle; +Cc: Shay Deloya, linux-mips



Ralf Baechle wrote:

> On Sun, May 06, 2001 at 07:13:43PM +0300, Shay Deloya wrote:
> 
> 
>> I have an old problem came up again and the old solution aren't helping.
>> Relocation overflow of type 4 for
>> Is it insmod knowen bugs that the relocation is done in bad way or 
>> a linker/compiler bug. I'm using compiler: egcs ver 1.0.3a
>> I'm checking this problem at the moment and looking for insmod bug.
> 
> 
> You'll have to upgrade to very current binutils which for mips*-linux
> targets default to elf32-trad{big,little}mips, not IRIX ELF format.  Also
> it seems your modutils are a bit rotten, get the latest from ftp.kernel.org.
> 
>   Ralf

On the same topic: same source (!!) 'insmod' executable compiled with 
new (2.10) binutils doesn't exibit such relocation problem.

What may be causing 'insmod' to be dependant on binutils which compile 
it? The module *.o is exactly same as it was before.


Sincerely yours,
Michael Shmulevich
______________________________________
Software Developer
Jungo - R&D
email: michaels@jungo.com
web: http://www.jungo.com
Phone: 1-877-514-0537(USA)  +972-9-8859365(Worldwide) ext. 233
Fax:   1-877-514-0538(USA)  +972-9-8859366(Worldwide)

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: insmod problems
  2001-05-10  8:53   ` Michael Shmulevich
@ 2001-05-10 18:46     ` Ralf Baechle
  0 siblings, 0 replies; 15+ messages in thread
From: Ralf Baechle @ 2001-05-10 18:46 UTC (permalink / raw)
  To: Michael Shmulevich; +Cc: Shay Deloya, linux-mips

On Thu, May 10, 2001 at 11:53:12AM +0300, Michael Shmulevich wrote:

> On the same topic: same source (!!) 'insmod' executable compiled with 
> new (2.10) binutils doesn't exibit such relocation problem.
> 
> What may be causing 'insmod' to be dependant on binutils which compile 
> it? The module *.o is exactly same as it was before.

Without further explanation this one just sounds bizarre for now.

There always have been differences between the code generated by binutils
in the various versions; the resulting changes may result in different
behaviour of a broken programs.  These are fun to debug to say the least.
The other possibility would be binutils bugs but I'm not aware of one
with the effect you described.

  Ralf

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Insmod problems
@ 2001-12-04 16:33 Nav Mundi
  0 siblings, 0 replies; 15+ messages in thread
From: Nav Mundi @ 2001-12-04 16:33 UTC (permalink / raw)
  To: linux-kernel; +Cc: Michael Zhu

What are we doing wrong? - Nav & Michael
**************************************************

hello.c Source:

#include "/home/mzhu/linux/include/linux/config.h" 
/*retrieve the CONFIG_* macros */
#if defined(CONFIG_MODVERSIONS) && !defined(MODVERSIONS)
#define MODVERSIONS  /* force it on */
#endif

#ifdef MODVERSIONS
#include "/home/mzhu/linux/include/linux/modversions.h"
#endif

#include "/home/mzhu/linux/include/linux/module.h"

int init_module(void)  { printk("<1>Hello, world\n");  return 0; }
void cleanup_module(void) { printk("<1>Goodbye cruel world\n"); }

Output:

#>gcc -D_KERNEL_ -DMODULE -c hello.c

[This builds the hello.o file. ]

#>insmod hello.o

hello.o : unresolved symbol printk
hello.o : Note: modules without a GPL compatible license cannot use 
GPONLY_symbols





^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: Insmod problems
@ 2001-12-04 16:42 Tyler BIRD
  0 siblings, 0 replies; 15+ messages in thread
From: Tyler BIRD @ 2001-12-04 16:42 UTC (permalink / raw)
  To: nmundi, linux-kernel; +Cc: apiggyjj

You need to define the __KERNEL__ and MODULE symbols

#define __KERNEL__
#define MODULE


>>> Nav Mundi <nmundi@karthika.com> 12/04/01 09:33AM >>>
What are we doing wrong? - Nav & Michael
**************************************************

hello.c Source:

#include "/home/mzhu/linux/include/linux/config.h" 
/*retrieve the CONFIG_* macros */
#if defined(CONFIG_MODVERSIONS) && !defined(MODVERSIONS)
#define MODVERSIONS  /* force it on */
#endif

#ifdef MODVERSIONS
#include "/home/mzhu/linux/include/linux/modversions.h"
#endif

#include "/home/mzhu/linux/include/linux/module.h"

int init_module(void)  { printk("<1>Hello, world\n");  return 0; }
void cleanup_module(void) { printk("<1>Goodbye cruel world\n"); }

Output:

#>gcc -D_KERNEL_ -DMODULE -c hello.c

[This builds the hello.o file. ]

#>insmod hello.o

hello.o : unresolved symbol printk
hello.o : Note: modules without a GPL compatible license cannot use 
GPONLY_symbols




-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org 
More majordomo info at  http://vger.kernel.org/majordomo-info.html 
Please read the FAQ at  http://www.tux.org/lkml/


^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: Insmod problems
  2001-12-04 17:06 ` Michael Zhu
@ 2001-12-04 16:55   ` Thiago Rondon
  2001-12-04 17:47   ` rddunlap
  1 sibling, 0 replies; 15+ messages in thread
From: Thiago Rondon @ 2001-12-04 16:55 UTC (permalink / raw)
  To: Michael Zhu; +Cc: Tyler BIRD, linux-kernel


_KERNEL_ != __KERNEL__

gcc -D__KERNEL__ -DMODULE -c hello.c

> gcc -D_KERNEL_ -DMODULE -c hello.c
>
> --- Tyler BIRD <BIRDTY@uvsc.edu> wrote:
> > You need to define the __KERNEL__ and MODULE symbols
> >
> > #define __KERNEL__
> > #define MODULE
> >
> >
> > >>> Nav Mundi <nmundi@karthika.com> 12/04/01 09:33AM
> > >>>
> > What are we doing wrong? - Nav & Michael
> > **************************************************
> >
> > hello.c Source:
> >
> > #include "/home/mzhu/linux/include/linux/config.h"
> > /*retrieve the CONFIG_* macros */
> > #if defined(CONFIG_MODVERSIONS) &&
> > !defined(MODVERSIONS)
> > #define MODVERSIONS  /* force it on */
> > #endif
> >
> > #ifdef MODVERSIONS
> > #include
> > "/home/mzhu/linux/include/linux/modversions.h"
> > #endif
> >
> > #include "/home/mzhu/linux/include/linux/module.h"
> >
> > int init_module(void)  { printk("<1>Hello,
> > world\n");  return 0; }
> > void cleanup_module(void) { printk("<1>Goodbye cruel
> > world\n"); }
> >
> > Output:
> >
> > #>gcc -D_KERNEL_ -DMODULE -c hello.c
> >
> > [This builds the hello.o file. ]
> >
> > #>insmod hello.o
> >
> > hello.o : unresolved symbol printk
> > hello.o : Note: modules without a GPL compatible
> > license cannot use
> > GPONLY_symbols
> >
> >
> >
> >
> > -
> > To unsubscribe from this list: send the line
> > "unsubscribe linux-kernel" in
> > the body of a message to majordomo@vger.kernel.org
> > More majordomo info at
> > http://vger.kernel.org/majordomo-info.html
> > Please read the FAQ at  http://www.tux.org/lkml/
> >
>
>
> ______________________________________________________
> Send your holiday cheer with http://greetings.yahoo.ca
> -
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at  http://www.tux.org/lkml/
>


^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: Insmod problems
       [not found] <sc0c9a91.036@mail-smtp.uvsc.edu>
@ 2001-12-04 17:06 ` Michael Zhu
  2001-12-04 16:55   ` Thiago Rondon
  2001-12-04 17:47   ` rddunlap
  0 siblings, 2 replies; 15+ messages in thread
From: Michael Zhu @ 2001-12-04 17:06 UTC (permalink / raw)
  To: Tyler BIRD; +Cc: linux-kernel

I've define these two when I compile the module. The
command line is:

gcc -D_KERNEL_ -DMODULE -c hello.c


--- Tyler BIRD <BIRDTY@uvsc.edu> wrote:
> You need to define the __KERNEL__ and MODULE symbols
> 
> #define __KERNEL__
> #define MODULE
> 
> 
> >>> Nav Mundi <nmundi@karthika.com> 12/04/01 09:33AM
> >>>
> What are we doing wrong? - Nav & Michael
> **************************************************
> 
> hello.c Source:
> 
> #include "/home/mzhu/linux/include/linux/config.h" 
> /*retrieve the CONFIG_* macros */
> #if defined(CONFIG_MODVERSIONS) &&
> !defined(MODVERSIONS)
> #define MODVERSIONS  /* force it on */
> #endif
> 
> #ifdef MODVERSIONS
> #include
> "/home/mzhu/linux/include/linux/modversions.h"
> #endif
> 
> #include "/home/mzhu/linux/include/linux/module.h"
> 
> int init_module(void)  { printk("<1>Hello,
> world\n");  return 0; }
> void cleanup_module(void) { printk("<1>Goodbye cruel
> world\n"); }
> 
> Output:
> 
> #>gcc -D_KERNEL_ -DMODULE -c hello.c
> 
> [This builds the hello.o file. ]
> 
> #>insmod hello.o
> 
> hello.o : unresolved symbol printk
> hello.o : Note: modules without a GPL compatible
> license cannot use 
> GPONLY_symbols
> 
> 
> 
> 
> -
> To unsubscribe from this list: send the line
> "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org 
> More majordomo info at 
> http://vger.kernel.org/majordomo-info.html 
> Please read the FAQ at  http://www.tux.org/lkml/
> 


______________________________________________________ 
Send your holiday cheer with http://greetings.yahoo.ca

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: Insmod problems
@ 2001-12-04 17:30 Tyler BIRD
  0 siblings, 0 replies; 15+ messages in thread
From: Tyler BIRD @ 2001-12-04 17:30 UTC (permalink / raw)
  To: apiggyjj; +Cc: linux-kernel

Try this

―--------

#define MODULE

#include <linux/module.h>
int init_module(void) { printk("<1>Hello World"); return 0;}
void cleanup_module(void) {printk("<1>Goodbye cruel world\n"); }
―---

gcc -c -D__KERNEL__ hello.c

compiled and loaded fine on my system

I think linux/module.h defines
the kernel version. Make sure that you have the kernel source headers installed under /usr/include
which is a link to /usr/src/linux/include.

you oughta put the above include/module.h at the begining of your source.



Also there has been a macro lately to
delate which routines will be init_module, cleanup_module22

>>> Michael Zhu <apiggyjj@yahoo.ca> 12/04/01 10:06AM >>>
I've define these two when I compile the module. The
command line is:

gcc -D_KERNEL_ -DMODULE -c hello.c


--- Tyler BIRD <BIRDTY@uvsc.edu> wrote:
> You need to define the __KERNEL__ and MODULE symbols
> 
> #define __KERNEL__
> #define MODULE
> 
> 
> >>> Nav Mundi <nmundi@karthika.com> 12/04/01 09:33AM
> >>>
> What are we doing wrong? - Nav & Michael
> **************************************************
> 
> hello.c Source:
> 
> #include "/home/mzhu/linux/include/linux/config.h" 
> /*retrieve the CONFIG_* macros */
> #if defined(CONFIG_MODVERSIONS) &&
> !defined(MODVERSIONS)
> #define MODVERSIONS  /* force it on */
> #endif
> 
> #ifdef MODVERSIONS
> #include
> "/home/mzhu/linux/include/linux/modversions.h"
> #endif
> 
> #include "/home/mzhu/linux/include/linux/module.h"
> 
> int init_module(void)  { printk("<1>Hello,
> world\n");  return 0; }
> void cleanup_module(void) { printk("<1>Goodbye cruel
> world\n"); }
> 
> Output:
> 
> #>gcc -D_KERNEL_ -DMODULE -c hello.c
> 
> [This builds the hello.o file. ]
> 
> #>insmod hello.o
> 
> hello.o : unresolved symbol printk
> hello.o : Note: modules without a GPL compatible
> license cannot use 
> GPONLY_symbols
> 
> 
> 
> 
> -
> To unsubscribe from this list: send the line
> "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org 
> More majordomo info at 
> http://vger.kernel.org/majordomo-info.html 
> Please read the FAQ at  http://www.tux.org/lkml/ 
> 


______________________________________________________ 
Send your holiday cheer with http://greetings.yahoo.ca


^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: Insmod problems
  2001-12-04 17:06 ` Michael Zhu
  2001-12-04 16:55   ` Thiago Rondon
@ 2001-12-04 17:47   ` rddunlap
  1 sibling, 0 replies; 15+ messages in thread
From: rddunlap @ 2001-12-04 17:47 UTC (permalink / raw)
  To: Michael Zhu; +Cc: Tyler BIRD, linux-kernel

On Tue, 4 Dec 2001, Michael Zhu wrote:

| I've define these two when I compile the module. The
| command line is:
|
| gcc -D_KERNEL_ -DMODULE -c hello.c

Check the spelling of "__KERNEL__".

~Randy

| --- Tyler BIRD <BIRDTY@uvsc.edu> wrote:
| > You need to define the __KERNEL__ and MODULE symbols
| >
| > #define __KERNEL__
| > #define MODULE
| >
| >
| > >>> Nav Mundi <nmundi@karthika.com> 12/04/01 09:33AM
| > >>>
| > What are we doing wrong? - Nav & Michael
| > **************************************************
| >
| > hello.c Source:
| >
| > #include "/home/mzhu/linux/include/linux/config.h"
| > /*retrieve the CONFIG_* macros */
| > #if defined(CONFIG_MODVERSIONS) &&
| > !defined(MODVERSIONS)
| > #define MODVERSIONS  /* force it on */
| > #endif
| >
| > #ifdef MODVERSIONS
| > #include
| > "/home/mzhu/linux/include/linux/modversions.h"
| > #endif
| >
| > #include "/home/mzhu/linux/include/linux/module.h"
| >
| > int init_module(void)  { printk("<1>Hello,
| > world\n");  return 0; }
| > void cleanup_module(void) { printk("<1>Goodbye cruel
| > world\n"); }
| >
| > Output:
| >
| > #>gcc -D_KERNEL_ -DMODULE -c hello.c
| >
| > [This builds the hello.o file. ]
| >
| > #>insmod hello.o
| >
| > hello.o : unresolved symbol printk
| > hello.o : Note: modules without a GPL compatible
| > license cannot use
| > GPONLY_symbols


^ permalink raw reply	[flat|nested] 15+ messages in thread

* RE: Insmod problems
       [not found] <81C25B579A82D31192BE00105A812084028931E9@AUGUSTA>
@ 2001-12-04 18:13 ` Michael Zhu
  0 siblings, 0 replies; 15+ messages in thread
From: Michael Zhu @ 2001-12-04 18:13 UTC (permalink / raw)
  To: Christine Ames, Tyler BIRD; +Cc: linux-kernel

I've changed my source file like this:
#define MODULE

#include <linux/module.h>

int init_module(void)  { printk("<1>Hello, world\n");
return 0; }
void cleanup_module(void) { printk("<1>Goodbye cruel
world\n"); }

And I use the following message to build the module.
But when I use insmod to load the module I got the
following error message:

hello.o : kernel-module version mismatch
         hello.o was compiled for kernel version
2.4.12
         while this kernel is version 2.4.8

What is wrong? My kernel version is 2.4.8. Is there
something wrong with the gcc compilier? My gcc
compilier is gcc-2.95.

Thanks to everyone. Your help is very beneficial to
me.

Michael

--- Christine Ames <CAmes@PacificDigital.com> wrote:
> > -----Original Message-----
> > From: Michael Zhu [mailto:apiggyjj@yahoo.ca]
> > Sent: Tuesday, December 04, 2001 9:07 AM
> 
> <snip>
> 
> > 
> > 
> > I've define these two when I compile the module.
> The
> > command line is:
> > 
> > gcc -D_KERNEL_ -DMODULE -c hello.c
> > 
> > 
> <snip>
> > 
> 
> See http://www.xml.com/ldd/chapter/book/ch02.html
> 
> Where your source should be similar to:
> 
> #define MODULE		// <- HERE!!! define MODULE 
> #include <linux/module.h>
> 
> int init_module(void)  { printk("<1>Hello,
> world\n"); return 0; }
> void cleanup_module(void) { printk("<1>Goodbye cruel
> world\n"); }
> 


______________________________________________________ 
Send your holiday cheer with http://greetings.yahoo.ca

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: Insmod problems
       [not found] <sc0ca5e8.017@mail-smtp.uvsc.edu>
@ 2001-12-04 18:20 ` Michael Zhu
  2001-12-04 18:33   ` Tommy Reynolds
  2001-12-04 19:10   ` Alan Cox
  0 siblings, 2 replies; 15+ messages in thread
From: Michael Zhu @ 2001-12-04 18:20 UTC (permalink / raw)
  To: Tyler BIRD; +Cc: linux-kernel

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset=us-ascii, Size: 3313 bytes --]

I've changed my source file like this:
#define MODULE

#include <linux/module.h>

int init_module(void)  { printk("<1>Hello, world\n");
return 0; }
void cleanup_module(void) { printk("<1>Goodbye cruel
world\n"); }

And I use the following command line to build the
module.

gcc -c -D__KERNEL__ hello.c

But when I use insmod to load the module I got the
following error message:

hello.o : kernel-module version mismatch
         hello.o was compiled for kernel version
2.4.12
         while this kernel is version 2.4.8

What is wrong? My kernel version is 2.4.8. Is there
something wrong with the gcc compilier? My gcc
compilier is gcc-2.95.

Thanks to everyone. Your help is very beneficial to
me.

Michael




--- Tyler BIRD <BIRDTY@uvsc.edu> wrote:
> Try this
> 
> ¯--------
> 
> #define MODULE
> 
> #include <linux/module.h>
> int init_module(void) { printk("<1>Hello World");
> return 0;}
> void cleanup_module(void) {printk("<1>Goodbye cruel
> world\n"); }
> ¯---
> 
> gcc -c -D__KERNEL__ hello.c
> 
> compiled and loaded fine on my system
> 
> I think linux/module.h defines
> the kernel version. Make sure that you have the
> kernel source headers installed under /usr/include
> which is a link to /usr/src/linux/include.
> 
> you oughta put the above include/module.h at the
> begining of your source.
> 
> 
> 
> Also there has been a macro lately to
> delate which routines will be init_module,
> cleanup_module22
> 
> >>> Michael Zhu <apiggyjj@yahoo.ca> 12/04/01 10:06AM
> >>>
> I've define these two when I compile the module. The
> command line is:
> 
> gcc -D_KERNEL_ -DMODULE -c hello.c
> 
> 
> --- Tyler BIRD <BIRDTY@uvsc.edu> wrote:
> > You need to define the __KERNEL__ and MODULE
> symbols
> > 
> > #define __KERNEL__
> > #define MODULE
> > 
> > 
> > >>> Nav Mundi <nmundi@karthika.com> 12/04/01
> 09:33AM
> > >>>
> > What are we doing wrong? - Nav & Michael
> > **************************************************
> > 
> > hello.c Source:
> > 
> > #include "/home/mzhu/linux/include/linux/config.h"
> 
> > /*retrieve the CONFIG_* macros */
> > #if defined(CONFIG_MODVERSIONS) &&
> > !defined(MODVERSIONS)
> > #define MODVERSIONS  /* force it on */
> > #endif
> > 
> > #ifdef MODVERSIONS
> > #include
> > "/home/mzhu/linux/include/linux/modversions.h"
> > #endif
> > 
> > #include "/home/mzhu/linux/include/linux/module.h"
> > 
> > int init_module(void)  { printk("<1>Hello,
> > world\n");  return 0; }
> > void cleanup_module(void) { printk("<1>Goodbye
> cruel
> > world\n"); }
> > 
> > Output:
> > 
> > #>gcc -D_KERNEL_ -DMODULE -c hello.c
> > 
> > [This builds the hello.o file. ]
> > 
> > #>insmod hello.o
> > 
> > hello.o : unresolved symbol printk
> > hello.o : Note: modules without a GPL compatible
> > license cannot use 
> > GPONLY_symbols
> > 
> > 
> > 
> > 
> > -
> > To unsubscribe from this list: send the line
> > "unsubscribe linux-kernel" in
> > the body of a message to majordomo@vger.kernel.org
> 
> > More majordomo info at 
> > http://vger.kernel.org/majordomo-info.html 
> > Please read the FAQ at  http://www.tux.org/lkml/ 
> > 
> 
> 
>
______________________________________________________
> 
> Send your holiday cheer with
> http://greetings.yahoo.ca
> 


______________________________________________________ 
Send your holiday cheer with http://greetings.yahoo.ca

^ permalink raw reply	[flat|nested] 15+ messages in thread

* RE: Insmod problems
@ 2001-12-04 18:24 Tyler BIRD
  0 siblings, 0 replies; 15+ messages in thread
From: Tyler BIRD @ 2001-12-04 18:24 UTC (permalink / raw)
  To: CAmes, apiggyjj; +Cc: linux-kernel

in linux/module.h header file
KERNEL_VERSION is defined.

what you need to do is make sure the directory /usr/include is a link
to the include directory in your kernel source and not the header files os some other kernel.

if you cant do that try something like this

___NO_VERSION___
#include <linux/module.h>
KERNEL_VERSION(major,minor,release)


read more on this site

http://www.xml.com/ldd/chapter/book/ch02.html#t2 


>>> Michael Zhu <apiggyjj@yahoo.ca> 12/04/01 11:13AM >>>
I've changed my source file like this:
#define MODULE

#include <linux/module.h>

int init_module(void)  { printk("<1>Hello, world\n");
return 0; }
void cleanup_module(void) { printk("<1>Goodbye cruel
world\n"); }

And I use the following message to build the module.
But when I use insmod to load the module I got the
following error message:

hello.o : kernel-module version mismatch
         hello.o was compiled for kernel version
2.4.12
         while this kernel is version 2.4.8

What is wrong? My kernel version is 2.4.8. Is there
something wrong with the gcc compilier? My gcc
compilier is gcc-2.95.

Thanks to everyone. Your help is very beneficial to
me.

Michael

--- Christine Ames <CAmes@PacificDigital.com> wrote:
> > -----Original Message-----
> > From: Michael Zhu [mailto:apiggyjj@yahoo.ca] 
> > Sent: Tuesday, December 04, 2001 9:07 AM
> 
> <snip>
> 
> > 
> > 
> > I've define these two when I compile the module.
> The
> > command line is:
> > 
> > gcc -D_KERNEL_ -DMODULE -c hello.c
> > 
> > 
> <snip>
> > 
> 
> See http://www.xml.com/ldd/chapter/book/ch02.html 
> 
> Where your source should be similar to:
> 
> #define MODULE		// <- HERE!!! define MODULE 
> #include <linux/module.h>
> 
> int init_module(void)  { printk("<1>Hello,
> world\n"); return 0; }
> void cleanup_module(void) { printk("<1>Goodbye cruel
> world\n"); }
> 


______________________________________________________ 
Send your holiday cheer with http://greetings.yahoo.ca


^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: Insmod problems
  2001-12-04 18:20 ` Michael Zhu
@ 2001-12-04 18:33   ` Tommy Reynolds
  2001-12-04 19:10   ` Alan Cox
  1 sibling, 0 replies; 15+ messages in thread
From: Tommy Reynolds @ 2001-12-04 18:33 UTC (permalink / raw)
  To: apiggyjj; +Cc: linux-kernel

[-- Attachment #1: Type: text/plain, Size: 1318 bytes --]

More important activities lacking, "Michael Zhu" <apiggyjj@yahoo.ca> wrote:

> I've changed my source file like this:
> #define MODULE
> 
> #include <linux/module.h>
> 
> int init_module(void)  { printk("<1>Hello, world\n");
> return 0; }
> void cleanup_module(void) { printk("<1>Goodbye cruel
> world\n"); }
> 
> And I use the following command line to build the
> module.
> 
> gcc -c -D__KERNEL__ hello.c
> 
> But when I use insmod to load the module I got the
> following error message:
> 
> hello.o : kernel-module version mismatch
>          hello.o was compiled for kernel version
> 2.4.12
>          while this kernel is version 2.4.8
> 
> What is wrong? My kernel version is 2.4.8. Is there
> something wrong with the gcc compilier? My gcc
> compilier is gcc-2.95.

You're not picking up the correct kernel header files.  Don't allow GCC to pick
up the files from "/usr/include/linux":

$ gcc -I/usr/src/linux/include -c -D__KERNEL__ hello.c

-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- + -- -- -- -- -- -- -- -- -- --
Tommy Reynolds                               | mailto: <reynolds@redhat.com>
Red Hat, Inc., Embedded Development Services | Phone:  +1.256.704.9286
307 Wynn Drive NW, Huntsville, AL 35805 USA  | FAX:    +1.256.837.3839
Senior Software Developer                    | Mobile: +1.919.641.2923

[-- Attachment #2: Type: application/pgp-signature, Size: 197 bytes --]

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: Insmod problems
  2001-12-04 18:20 ` Michael Zhu
  2001-12-04 18:33   ` Tommy Reynolds
@ 2001-12-04 19:10   ` Alan Cox
  1 sibling, 0 replies; 15+ messages in thread
From: Alan Cox @ 2001-12-04 19:10 UTC (permalink / raw)
  To: apiggyjj; +Cc: Tyler BIRD, linux-kernel

> I've changed my source file like this:
> #define MODULE
> 
> #include <linux/module.h>

Is your kernel configured with module versioning ?


^ permalink raw reply	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2001-12-04 19:04 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2001-12-04 17:30 Insmod problems Tyler BIRD
  -- strict thread matches above, loose matches on Subject: below --
2001-12-04 18:24 Tyler BIRD
     [not found] <sc0ca5e8.017@mail-smtp.uvsc.edu>
2001-12-04 18:20 ` Michael Zhu
2001-12-04 18:33   ` Tommy Reynolds
2001-12-04 19:10   ` Alan Cox
     [not found] <81C25B579A82D31192BE00105A812084028931E9@AUGUSTA>
2001-12-04 18:13 ` Michael Zhu
     [not found] <sc0c9a91.036@mail-smtp.uvsc.edu>
2001-12-04 17:06 ` Michael Zhu
2001-12-04 16:55   ` Thiago Rondon
2001-12-04 17:47   ` rddunlap
2001-12-04 16:42 Tyler BIRD
2001-12-04 16:33 Nav Mundi
2001-05-06 16:13 insmod problems Shay Deloya
2001-05-09  2:40 ` Ralf Baechle
2001-05-10  8:53   ` Michael Shmulevich
2001-05-10 18:46     ` Ralf Baechle

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.