modules linkage problem

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I have a kernel module source foo.c and a some source of functions in func.c. The code in foo.c call the functions in func.c. I have my function declarations in foo.h. All are in the same dir. They look like this:

-----------------------------------------------
/*foo.c - module*/
#include "foo.h"

init_module {

func1();
func2();
}

void cleanup_module { }
-----------------------------------------------
/* func.c- function definitions*/
func1() { }
func2() { }
EXPORT_SYMBOL(func1)
EXPORT_SYMBOL(func2)
-----------------------------------------------
/* foo.h - header */
extern func1();
extern func2();
---------------------------------------------

I have a Makefile like this
#Makefile
obj-m    += foo.o
foo-objs := foo.o  func.o 
export-objs    := func.o
obj-m    += func.o

When I do "make" , I have my foo.o and func.o compiled. But, when I do
$insmod ./foo.o it says :
undefined reference to func1();
undefined reference to func2();

Why are the 2 functions(in func.o) still not being linked to my foo.o. Please help.

thanks
arun

--
"There are 10 people in the world - those who understand binary and those who dont !"

[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux