Re: modules linkage problem

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

 



Hi


/*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

This is not probably what you want.

obj-m := test.o
test-objs :=  foo.o func.o

should do.

Anand

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