linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* Question about modules
@ 2003-02-28  9:36 Ibon Gotxi Garcia
  2003-02-28 16:47 ` bhupinder sahran
  0 siblings, 1 reply; 10+ messages in thread
From: Ibon Gotxi Garcia @ 2003-02-28  9:36 UTC (permalink / raw)
  To: Linux PPC embedded


I'm trying to write a simple module for an 8xx board using the SMC2.
Everything works, till I try to insmod it: I get m8xx_cpm_alloc and
m8xx_cpm_hostalloc as unresolved symbols.

I think that arch/ppc/8xx_io/commproc.c is properly compiled (I can see
both symbols on vmlinux), but somehow the build process strips them off
as they are unused (i cannot see them in /proc/ksyms in the target). Is
that right? Any clue to solve it? (having them in the target kernel
without modifying the original sources)

Many regards.
ibon

--
Ibon Gotxi Garcia <igotxi@jazzfree.com>

** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Question about modules
  2003-02-28  9:36 Question about modules Ibon Gotxi Garcia
@ 2003-02-28 16:47 ` bhupinder sahran
  2003-02-28 17:20   ` Ibon Gotxi Garcia
  0 siblings, 1 reply; 10+ messages in thread
From: bhupinder sahran @ 2003-02-28 16:47 UTC (permalink / raw)
  To: Ibon Gotxi Garcia, Linux PPC embedded


Hi

What abt System.map...
Can u check if symbols are there.

Bye
Bhupi


--- Ibon Gotxi Garcia <igotxi@jazzfree.com> wrote:
>
> I'm trying to write a simple module for an 8xx board
> using the SMC2.
> Everything works, till I try to insmod it: I get
> m8xx_cpm_alloc and
> m8xx_cpm_hostalloc as unresolved symbols.
>
> I think that arch/ppc/8xx_io/commproc.c is properly
> compiled (I can see
> both symbols on vmlinux), but somehow the build
> process strips them off
> as they are unused (i cannot see them in /proc/ksyms
> in the target). Is
> that right? Any clue to solve it? (having them in
> the target kernel
> without modifying the original sources)
>
> Many regards.
> ibon
>
> --
> Ibon Gotxi Garcia <igotxi@jazzfree.com>
>
>


** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Question about modules
  2003-02-28 16:47 ` bhupinder sahran
@ 2003-02-28 17:20   ` Ibon Gotxi Garcia
  0 siblings, 0 replies; 10+ messages in thread
From: Ibon Gotxi Garcia @ 2003-02-28 17:20 UTC (permalink / raw)
  To: bhupinder sahran; +Cc: Linux PPC embedded


On Fri, 2003-02-28 at 16:47, bhupinder sahran wrote:
> Hi
>
> What abt System.map...
> Can u check if symbols are there.
>
yes, they are, as well as in vmlinux. In my top level Makefile I find:

$(NM) vmlinux | grep -v '\(compiled\)\|\(\.o$$\)\|\( [aUw]
\)\|\(\.\.ng$$\)\|\(LASH[RL]DI\)' | sort > System.map

but I think that in the step of making zvmlinux, unneeded symbols _may_
be stripped off, because i cannot find all the symbols in the target (in
/proc/ksyms or with ksyms -a). Am i right?

Thank you for answering, anyway.

Cheers
Ibon.

> Bye
> Bhupi
>
>
> --- Ibon Gotxi Garcia <igotxi@jazzfree.com> wrote:
> >
> > I'm trying to write a simple module for an 8xx board
> > using the SMC2.
> > Everything works, till I try to insmod it: I get
> > m8xx_cpm_alloc and
> > m8xx_cpm_hostalloc as unresolved symbols.
> >
> > I think that arch/ppc/8xx_io/commproc.c is properly
> > compiled (I can see
> > both symbols on vmlinux), but somehow the build
> > process strips them off
> > as they are unused (i cannot see them in /proc/ksyms
> > in the target). Is
> > that right? Any clue to solve it? (having them in
> > the target kernel
> > without modifying the original sources)
> >
> > Many regards.
> > ibon
> >
> > --
> > Ibon Gotxi Garcia <igotxi@jazzfree.com>
> >
> >
>
>
--
Ibon Gotxi Garcia <igotxi@jazzfree.com>


** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/

^ permalink raw reply	[flat|nested] 10+ messages in thread

* RE: Question about modules
@ 2003-02-28 18:27 Jean-Denis Boyer
  2003-02-28 18:48 ` Ibon Gotxi Garcia
  2003-03-03 22:12 ` Tom Rini
  0 siblings, 2 replies; 10+ messages in thread
From: Jean-Denis Boyer @ 2003-02-28 18:27 UTC (permalink / raw)
  To: Ibon Gotxi Garcia; +Cc: Linux PPC embedded


> Everything works, till I try to insmod it: I get m8xx_cpm_alloc and
> m8xx_cpm_hostalloc as unresolved symbols.

In commproc.c, add the following line:
  EXPORT_SYMBOL(m8xx_cpm_hostalloc);


Regards,

--------------------------------------------
 Jean-Denis Boyer, B.Eng., Technical Leader
 Mediatrix Telecom Inc.
 4229 Garlock Street
 Sherbrooke (Québec)
 J1L 2C8  CANADA
 (819)829-8749 x241
--------------------------------------------

** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/

^ permalink raw reply	[flat|nested] 10+ messages in thread

* RE: Question about modules
  2003-02-28 18:27 Jean-Denis Boyer
@ 2003-02-28 18:48 ` Ibon Gotxi Garcia
  2003-03-03 22:12 ` Tom Rini
  1 sibling, 0 replies; 10+ messages in thread
From: Ibon Gotxi Garcia @ 2003-02-28 18:48 UTC (permalink / raw)
  To: Jean-Denis Boyer; +Cc: Linux PPC embedded


On Fri, 2003-02-28 at 18:27, Jean-Denis Boyer wrote:
> > Everything works, till I try to insmod it: I get m8xx_cpm_alloc and
> > m8xx_cpm_hostalloc as unresolved symbols.
>
> In commproc.c, add the following line:
>   EXPORT_SYMBOL(m8xx_cpm_hostalloc);
>


ok, i have already thought about that, but it means that my driver won't
work with "standard" kernels, isn't it?

people should change their kernel code to load my drivers, and that
isn't cool :(

thanks for your answer

Cheers
ibon.


>
> Regards,
>
> --------------------------------------------
>  Jean-Denis Boyer, B.Eng., Technical Leader
>  Mediatrix Telecom Inc.
>  4229 Garlock Street
>  Sherbrooke (Québec)
>  J1L 2C8  CANADA
>  (819)829-8749 x241
> --------------------------------------------
>
--
Ibon Gotxi Garcia <igotxi@jazzfree.com>


** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Question about modules
  2003-02-28 18:27 Jean-Denis Boyer
  2003-02-28 18:48 ` Ibon Gotxi Garcia
@ 2003-03-03 22:12 ` Tom Rini
  2003-03-03 22:23   ` Wolfgang Denk
  1 sibling, 1 reply; 10+ messages in thread
From: Tom Rini @ 2003-03-03 22:12 UTC (permalink / raw)
  To: Jean-Denis Boyer, Dan Malek; +Cc: Ibon Gotxi Garcia, Linux PPC embedded


On Fri, Feb 28, 2003 at 01:27:26PM -0500, Jean-Denis Boyer wrote:

> > Everything works, till I try to insmod it: I get m8xx_cpm_alloc and
> > m8xx_cpm_hostalloc as unresolved symbols.
>
> In commproc.c, add the following line:
>   EXPORT_SYMBOL(m8xx_cpm_hostalloc);

I'll bite... Dan is there a good reason this isn't exported?  Google
shows nothing to me :)

--
Tom Rini
http://gate.crashing.org/~trini/

** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Question about modules
  2003-03-03 22:12 ` Tom Rini
@ 2003-03-03 22:23   ` Wolfgang Denk
  0 siblings, 0 replies; 10+ messages in thread
From: Wolfgang Denk @ 2003-03-03 22:23 UTC (permalink / raw)
  To: Tom Rini; +Cc: Jean-Denis Boyer, Dan Malek, Ibon Gotxi Garcia,
	Linux PPC embedded


In message <20030303221205.GA12414@ip68-0-152-218.tc.ph.cox.net> you wrote:
>
> > In commproc.c, add the following line:
> >   EXPORT_SYMBOL(m8xx_cpm_hostalloc);
>
> I'll bite... Dan is there a good reason this isn't exported?  Google
> shows nothing to me :)

IMHO the only "good" reason they were not  exported  right  from  the
beginnng  is that the standard drivers that come with the kernel tree
cannot be built as modules anyway, so nobody needed it.

Please add.


Wolfgang Denk

--
Software Engineering:  Embedded and Realtime Systems,  Embedded Linux
Phone: (+49)-8142-4596-87  Fax: (+49)-8142-4596-88  Email: wd@denx.de
A Perl script is correct if it's halfway readable and  gets  the  job
done before your boss fires you.
                       - L. Wall & R. L. Schwartz, _Programming Perl_

** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Question about modules
       [not found] <1046783010.328.73.camel@muse>
@ 2003-03-04 14:15 ` Wolfgang Denk
  2003-03-04 14:26 ` Bret Indrelee
  1 sibling, 0 replies; 10+ messages in thread
From: Wolfgang Denk @ 2003-03-04 14:15 UTC (permalink / raw)
  To: Ibon Gotxi Garcia
  Cc: Tom Rini, Jean-Denis Boyer, Dan Malek, Linux PPC embedded


In message <1046783010.328.73.camel@muse> you wrote:
>
> I understand that reason, and i'm not certain about the usefulness of
> modules in embedded systems.

They are _very_ useful during development. They may also be useful to
make  driver  initialization   and/or   operation   controllable   by
application code.

In general you are right: statically linking the required drivers  is
usually a better approach.

> Anyway, my original purpose was to develop the driver as a module, and
> afterwards insert it into the kernel. I have just done it adding the
> EXPORT_SYMBOL macro to commproc.c and listing it in export-objs in
> arch/ppc/8xx_io/Makefile. Right, isn't it?

Yes, this is all that is needed.

Best regards,

Wolfgang Denk

--
Software Engineering:  Embedded and Realtime Systems,  Embedded Linux
Phone: (+49)-8142-4596-87  Fax: (+49)-8142-4596-88  Email: wd@denx.de
"In the face of entropy and nothingness, you kind of have to  pretend
it's  not  there  if  you  want  to  keep writing good code."
- Karl Lehenbauer

** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Question about modules
  2003-03-04 14:26 ` Bret Indrelee
@ 2003-03-04 14:25   ` Wolfgang Denk
  0 siblings, 0 replies; 10+ messages in thread
From: Wolfgang Denk @ 2003-03-04 14:25 UTC (permalink / raw)
  To: Bret Indrelee
  Cc: Ibon Gotxi Garcia, Tom Rini, Jean-Denis Boyer, Dan Malek,
	Linux PPC embedded


In message <Pine.LNX.4.33.0303040826250.2281-100000@localhost.localdomain> you wrote:
>
> Modules are generally easier to debug.

I'm not sure if I want to agree here.

First, you have to learn how to use GDB to deal with the symbol table
of a dynamically loaded module. Second, did you ever  try  to  set  a
breakpoint in the init function of a dynamically loaded module? It is
possible  to  do that, but you need a certain level of understanding,
and if your boot loader supports download over ethernet it is usually
easier and faster to debug this situation with  a  statically  linked
driver.


You are right however as far  as  the  modify-compile-load-run-unload
development cycle is concerned.

Best regards,

Wolfgang Denk

--
Software Engineering:  Embedded and Realtime Systems,  Embedded Linux
Phone: (+49)-8142-4596-87  Fax: (+49)-8142-4596-88  Email: wd@denx.de
If I can have honesty, it's easier to overlook mistakes.
	-- Kirk, "Space Seed", stardate 3141.9

** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Question about modules
       [not found] <1046783010.328.73.camel@muse>
  2003-03-04 14:15 ` Wolfgang Denk
@ 2003-03-04 14:26 ` Bret Indrelee
  2003-03-04 14:25   ` Wolfgang Denk
  1 sibling, 1 reply; 10+ messages in thread
From: Bret Indrelee @ 2003-03-04 14:26 UTC (permalink / raw)
  To: Ibon Gotxi Garcia
  Cc: Wolfgang Denk, Tom Rini, Jean-Denis Boyer, Dan Malek,
	Linux PPC embedded


On 4 Mar 2003, Ibon Gotxi Garcia wrote:
> I understand that reason, and i'm not certain about the usefulness of
> modules in embedded systems.

Modules are generally easier to debug.

>
> Anyway, my original purpose was to develop the driver as a module, and
> afterwards insert it into the kernel. I have just done it adding the
> EXPORT_SYMBOL macro to commproc.c and listing it in export-objs in
> arch/ppc/8xx_io/Makefile. Right, isn't it?
>
> Cheers.
>
> >
> > Wolfgang Denk
>
> --
> Ibon Gotxi Garcia <igotxi@jazzfree.com>
>
>
>

--
Bret Indrelee                 QLogic Corporation
Bret.Indrelee@qlogic.com      6321 Bury Drive, St 13, Eden Prairie, MN 55346


** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2003-03-04 14:26 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-02-28  9:36 Question about modules Ibon Gotxi Garcia
2003-02-28 16:47 ` bhupinder sahran
2003-02-28 17:20   ` Ibon Gotxi Garcia
  -- strict thread matches above, loose matches on Subject: below --
2003-02-28 18:27 Jean-Denis Boyer
2003-02-28 18:48 ` Ibon Gotxi Garcia
2003-03-03 22:12 ` Tom Rini
2003-03-03 22:23   ` Wolfgang Denk
     [not found] <1046783010.328.73.camel@muse>
2003-03-04 14:15 ` Wolfgang Denk
2003-03-04 14:26 ` Bret Indrelee
2003-03-04 14:25   ` Wolfgang Denk

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).