It is currently Wed, 22 May 2019 08:52:20 GMT



 
Author Message
 Problem with modutils-0.99.15
Hi!

I want to write a little devicedriver and so I downloaded
modutil-0.99.15 and compiled it. But when I started the demo-driver
with:
insmod drv_hello.o

I got:
___moddi3 undefined

What shall I do? Can anyone help me?

Thanks in advance
Andi

------------------------------------------------------------------------
 Trink Andreas                    | Tel: 0316-873-7456
 Institut fuer Nachrichtentechnik | Fax: 0316-463697
 und Wellenausbreitung, TU Graz   | EMail: tr...@inw.tu-graz.ac.at
 Inffeldgasse 12, A-8010 Graz     |        tr...@finwpc06.tu-graz.ac.at
------------------------------------------------------------------------
                             Sapere aude!
------------------------------------------------------------------------



 Sat, 07 Jun 1997 19:01:11 GMT   
 Problem with modutils-0.99.15

: I want to write a little devicedriver and so I downloaded
: modutil-0.99.15 and compiled it. But when I started the demo-driver
: with:
: insmod drv_hello.o

: I got:
: ___moddi3 undefined

: What shall I do? Can anyone help me?

If you really want the demo to work, recode it without
the mod function (there is a "%" in the middle of the code
used for arithmetic modulo).  gcc 2.5.8 (at least) uses
an external rather than an inline modulo computation in
this case, and I found no way to link that in using the
modules tools.  A simple recoding of that statement
made the demo work fine for me - sorry I don't have
it on this machine, it went something like:
instead of:   c = a % b;
     use:     c = a; while (c>=b) c-=b;

For the demo, this is not a problem.  What happens when
someone really  _wants_ to use the modulo function in
a _real_ module?  Does anybody know the trick to pull
that function out of the library so that insmod can
link to it?  Either that or convince gcc to use inline
code for it?

    - Larry Doolittle   doolit...@cebaf.gov



 Sat, 07 Jun 1997 21:43:55 GMT   
 Problem with modutils-0.99.15
: I got:
: ___moddi3 undefined

__moddi3 is a compatibility routine that is automatically linked into
normal applications.  It is inserted into drv_hello.o because it used a
modulo operation "%" with two unsigned long variables.  

The function __moddi3 is defined in libgcc.a and can be linked as follows:

# ld -r -L/usr/lib/gcc-lib/i486-linux/2.6.1 -lgcc -o drv_hello drv_hello.o

The "-r" tells the linker to output in ".o" format.  The "-L" is the
path to libgcc.a (which may vary from system to system.  gcc -V is good
for finding out the current configuration.)  This technique is also
usefull for linking together multiple ".o" files into one module.  

PS: The latest modutils added some casting around the modulo to trick
    gcc into performing the operation using native i386 instructions.  

--
Take Care, Eric                    ,,,
http://www.carsinfo.com/~eric/    (o o)
------------------------------oOOo-(_)-oOOo--------------------------------
Know thyself.  If you need help, call the C.I.A.



 Sun, 08 Jun 1997 02:43:31 GMT   
 Problem with modutils-0.99.15
: Trink Andreas (tr...@finwpc06.tu-graz.ac.at) wrote:

: : I want to write a little devicedriver and so I downloaded
: : modutil-0.99.15 and compiled it. But when I started the demo-driver
: : with:
: : insmod drv_hello.o

: : I got:
: : ___moddi3 undefined

: : What shall I do? Can anyone help me?

: For the demo, this is not a problem.  What happens when
: someone really  _wants_ to use the modulo function in
: a _real_ module?

Linker is getting missing functions from libraries when asked to.
To get things done with a minimal fuss try this (I hope that I have
flags right, I am typing this from memory)

   gcc -o drv_hello.o -Xlinker -r hello.o

As a matter of fact stripping local symbols (not globals!!) should
be OK as well.

  Michal



 Sun, 08 Jun 1997 02:08:04 GMT   
 Problem with modutils-0.99.15
 > Trink Andreas (tr...@finwpc06.tu-graz.ac.at) wrote:
 [...]
 > : ___moddi3 undefined

 > : What shall I do? Can anyone help me?
 [...]
 > For the demo, this is not a problem.  What happens when
 > someone really  _wants_ to use the modulo function in
 > a _real_ module?  Does anybody know the trick to pull
 > that function out of the library so that insmod can
 > link to it?  Either that or convince gcc to use inline
 > code for it?

 >     - Larry Doolittle   doolit...@cebaf.gov

You can use the following "trick" to include the "long long" support
into a module:

        ld -r -o drv.o drv_hello.o `gcc --print-libgcc-file-name`

After this, drv.o contains the loadable module, with ___moddi3 included.

Bjorn Ekwall == bj...@blox.se



 Sun, 08 Jun 1997 08:37:18 GMT   
 
   [ 5 post ] 

Similar Threads

1. gimp 0.99.15

2. GIMP 0.99.15 Crashes in RH 5.0?


 
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by ST Software