* Kernel module, undefined symbol show_regs [not found] <5dcc4c8a0911241202s1d56354el9628763b05451fb9@mail.gmail.com> @ 2009-11-25 12:27 ` Tanya Gornak 2009-11-25 17:45 ` Borislav Petkov 0 siblings, 1 reply; 2+ messages in thread From: Tanya Gornak @ 2009-11-25 12:27 UTC (permalink / raw) To: linux-kernel Hello. I can't solve problem that happens while I'm making my kernel module. part of my module: // ... #include <linux/sched.h> //.... static u32 task_syscall_entry(enum utrace_resume_action action, struct utrace_engine *engine, struct task_struct *task, struct pt_regs *regs){ // ... show_regs(regs); } But, while making I get: WARNING: "show_regs" [/home/tehhi/module/trace.ko] undefined! extern void show_regs(struct pt_regs *); define in header linux/sched.h, place of source code is linux/arch/x86/kernel/process_32.c It use extern void __show_regs(struct pt_regs *); and extern asmlinkage void __backtrace(void); I think that extern means that I can use it (and there are no static symbols in this function). When trying to insert module, it predictably complains of an unknown symbol show_regs. What am I missing here? Thanks in advance. ^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: Kernel module, undefined symbol show_regs 2009-11-25 12:27 ` Kernel module, undefined symbol show_regs Tanya Gornak @ 2009-11-25 17:45 ` Borislav Petkov 0 siblings, 0 replies; 2+ messages in thread From: Borislav Petkov @ 2009-11-25 17:45 UTC (permalink / raw) To: Tanya Gornak; +Cc: linux-kernel On Wed, Nov 25, 2009 at 1:27 PM, Tanya Gornak <errizo@gmail.com> wrote: > Hello. I can't solve problem that happens while I'm making my kernel module. > > part of my module: > // ... > #include <linux/sched.h> > //.... > static u32 task_syscall_entry(enum utrace_resume_action action, > struct utrace_engine *engine, > struct task_struct *task, > struct pt_regs *regs){ > // ... > show_regs(regs); > > } > But, while making I get: > > WARNING: "show_regs" [/home/tehhi/module/trace.ko] undefined! > > extern void show_regs(struct pt_regs *); define in header > linux/sched.h, place of source code is > linux/arch/x86/kernel/process_32.c > It use extern void __show_regs(struct pt_regs *); and extern > asmlinkage void __backtrace(void); > I think that extern means that I can use it (and there are no static > symbols in this function). > > When trying to insert module, it predictably complains of an unknown > symbol show_regs. > > What am I missing here? You're using a function in a module which is not exported to modules. See http://lwn.net/images/pdf/LDD3/ch02.pdf for more details. -- Regards/Gruss, Boris ^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2009-11-25 17:45 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
[not found] <5dcc4c8a0911241202s1d56354el9628763b05451fb9@mail.gmail.com>
2009-11-25 12:27 ` Kernel module, undefined symbol show_regs Tanya Gornak
2009-11-25 17:45 ` Borislav Petkov
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®