LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 01-28-2006, 10:57 AM   #1
dudulz
Member
 
Registered: Feb 2005
Location: Australia
Distribution: [Redhat] [Slackware] [SuSe] [FreeBSD]
Posts: 81

Rep: Reputation: 15
unresolve sysmbol


I have compile source code for application. That compiling was succeed. But when i want to 'insmod' in kernel, some error like :

net.o: unresolved symbol net_random_Rsmp_1c66f64c
net.o: unresolved symbol try_inc_mod_count_Rsmp_e6105b23
net.o: unresolved symbol __pskb_pull_tail_Rsmp_33ba4209
net.o: unresolved symbol proc_net_Rsmp_d3d4c903
net.o: unresolved symbol __release_sock_Rsmp_63d0a579
net.o: unresolved symbol proc_dointvec_Rsmp_8d06b825
net.o: unresolved symbol pskb_expand_head_Rsmp_9439c693

i wish , all friends can help my problem
 
Old 01-28-2006, 12:15 PM   #2
paragn
Member
 
Registered: Jan 2006
Distribution: Red Hat EL5, Fedora 7
Posts: 259

Rep: Reputation: 30
hi,
This indicates that your linux kernel has module versioning turned on. To check this, you can run -

cat /usr/src/linux/.config | grep MOD

and if you see

CONFIG_MODULES=y
CONFIG_MODVERSIONS=y
CONFIG_KMOD=y
 
Old 01-28-2006, 08:58 PM   #3
dudulz
Member
 
Registered: Feb 2005
Location: Australia
Distribution: [Redhat] [Slackware] [SuSe] [FreeBSD]
Posts: 81

Original Poster
Rep: Reputation: 15
I have to edit that. However i don't want to compile kernel. But i just make 'Makefile' in directory source code. Like 'unionsfs' that make module kernel without to recompile kernel. Just 'insmod -f' unionsfs.o , the kernel have support it.

I wass compiling Success,compile is net_app.o but when i insert this module there are many unresolve symbol
 
Old 01-29-2006, 02:34 AM   #4
paragn
Member
 
Registered: Jan 2006
Distribution: Red Hat EL5, Fedora 7
Posts: 259

Rep: Reputation: 30
hi,
You need to add -DMODVERSIONS to make compile command. e.g
gcc -D__KERNEL__ -DMODULE -DMODVERSIONS -I/usr/src/linux/include -c net.c
 
Old 01-30-2006, 10:52 AM   #5
dudulz
Member
 
Registered: Feb 2005
Location: Australia
Distribution: [Redhat] [Slackware] [SuSe] [FreeBSD]
Posts: 81

Original Poster
Rep: Reputation: 15
DEBUGFLAGS = -DCONFIG_IP_VS_DEBUG -g

KERNELSOURCE = linux
KERNELRELEASE = $(shell echo -e "\#include <linux/version.h>\nUTS_RELEASE" \
> conftest.c && \
gcc -E -I$(KERNELSOURCE)/include conftest.c | tail -1 \
| cut -d '"' -f 2 && rm -f conftest.c)

KERNELSYMS = /boot/System.map-$(KERNELRELEASE)

MODLIB = $(INSTALL_MOD_PATH)/lib/modules/$(KERNELRELEASE)/kernel/net/ipv4/ipvs/

# Set DEPMOD_OPTS if INSTALL_MOD_PATH is not null
ifneq (, $(INSTALL_MOD_PATH))
DEPMOD_OPTS = -b $(INSTALL_MOD_PATH)
endif

CC = gcc
CFLAGS = -D__KERNEL__ -DMODULE -DEXPORT_SYMTAB -DMODVERSIONS \
$(DEBUGFLAGS) -O2 -Wall -Wstrict-prototypes \
-I$(KERNELSOURCE)/include \
-include $(KERNELSOURCE)/include/linux/modversions.h

CORE = net.o
CORE_OBJS = net_conn.o net_core.o net_ctl.o net_sched.o

SCHEDULERS = net_conn.o net_core.o net_ctl.o net_sched.o

APPMODS = net_ftp.o


all: $(CORE) $(SCHEDULERS) $(APPMODS)

ip_vs.o: $(CORE_OBJS)
$(LD) -r $^ -o $@

install: net.o
-rmmod net
insmod net.o
lsmod

modules_install:
if [ ! -d "$(MODLIB)" ]; then mkdir -p "$(MODLIB)"; fi
install -m 600 -c $(CORE) $(SCHEDULERS) $(APPMODS) "$(MODLIB)"
depmod -ae -F $(KERNELSYMS) $(DEPMOD_OPTS) $(KERNELRELEASE)

modules_uninstall:
(cd "$(MODLIB)"; rm -f $(CORE) $(SCHEDULERS) $(APPMODS))
rmdir "$(MODLIB)"

clean:
rm -f *.o *~ *.bak *.orig *.rej


################
this is Makefile file. What wrong ?
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Problem s with undefined sysmbol-flock invinciblemk Linux - General 1 03-23-2004 05:40 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 11:43 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration