Modules and ld command

From: archibald (glop00.5.archibald_at_spamgourmet.com)
Date: 09/18/03


Date: 17 Sep 2003 23:05:03 GMT


Hello all,

I have a module ( MyModule1.o ) and I can add it to Linux with modprobe.
All this works correctly.

I'm creating a new module ( MyModule2.o ) which improves some code of MyModule1.
o.

My goal would be to have only one single module to load with modprobe
( I don't want to joint together the source code of MyModule1 et MyModule2 to
create one single module )

So I can do : ld -r -o SingleModule.o MyModule1.o MyModule2.o

I would like to know if this last command ( ld ...) will give to me the same
result as to have joined the source code of the two modules.

If not, what sort of problems can I have ?

for example, if I have this :

MyModule1.c

static void func1(...);

#ifndef MYMODULE2

  static void func1(...)
  {.... }

#endif

static void func2(...)
{
  func1();
}

/* End of MyModule1.c */

MyModule2.c

static void func1(...)
{ ... }

/* End of MyModule2.c */

Is ld command above a problem ?

Thanks.

-- 
Ce message a ete poste via la plateforme Web club-Internet.fr
This message has been posted by the Web platform club-Internet.fr
http://forums.club-internet.fr/