Getting undefined reference , how to link during module building ?

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

 



Hi Guys,
   I am trying to do the following but I am getting undefined reference error ? 

I have two modules lets say Module A & Module B. Module B defines a function called
module_b_func() which got exported also. Then I compile module B and inserted into kernel using insmod.

Then in module A I tried to call module B's function module_b_func(), When I tried to compile
I am getting undefined reference to module_b_func(). How to link moduleB's function here.

Do I need to give some options to the linker or how to compile ?

The following is my Makefile contents :

obj-m := module_A.o

M=$(shell pwd)

all:
    make -C /lib/modules/$(shell uname -r)/build/ M=$(M) modules
clean:   
    rm -rf *.o *.ko
distclean:   
    rm -rf *.markers *.order *.symvers
            
  
Thanks,
Ramesh.

[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