All of lore.kernel.org
 help / color / mirror / Atom feed
* About EXPORT_SYMBOL
@ 2011-02-10 13:18 kashish bhatia
  2011-02-10 15:17 ` Dave Hylands
       [not found] ` <MDAEMON3228201102101957.AA5731619@fibcom.com>
  0 siblings, 2 replies; 7+ messages in thread
From: kashish bhatia @ 2011-02-10 13:18 UTC (permalink / raw)
  To: kernelnewbies

Hello All,

I want to export a function named ext2_free_data() which is present in
inode.c .
This function is statically defined in this file. I omit the "static"
keyword and exported it
using EXPORT_SYMBOL(ext2_free_data).
ext2_free_data() function declaration is not present in any header file , so
I included its
declaration in my own header file which I kept in fs/ext2 directory.

Now when I insert my module using insmod command ,it shows a error : Unknown
symbol in module.


Kindly help me .

-- 
Regards,
Kashish
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20110210/34640ca5/attachment.html 

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

* About EXPORT_SYMBOL
  2011-02-10 13:18 About EXPORT_SYMBOL kashish bhatia
@ 2011-02-10 15:17 ` Dave Hylands
  2011-02-10 16:23   ` kashish bhatia
       [not found] ` <MDAEMON3228201102101957.AA5731619@fibcom.com>
  1 sibling, 1 reply; 7+ messages in thread
From: Dave Hylands @ 2011-02-10 15:17 UTC (permalink / raw)
  To: kernelnewbies

Hi kashish,

On Thu, Feb 10, 2011 at 5:18 AM, kashish bhatia <koolest77@gmail.com> wrote:
> Hello All,
> I want to export a function named ext2_free_data() which is present in
> inode.c .
> This function is statically defined in this file. I omit the "static"
> keyword and exported it
> using EXPORT_SYMBOL(ext2_free_data).
> ext2_free_data() function declaration is not present in any header file , so
> I included its
> declaration in my own header file which I kept in fs/ext2 directory.

So generally speaking, functions that are declared static were done
that way for a reason.

> Now when I insert my module using insmod command ,it shows a error : Unknown
> symbol in module.

Did you rebuild the kernel as well? The kernel where the exported
symbol comes from must be rebuilt and you must load using that kernel.

Dave Hylands

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

* About EXPORT_SYMBOL
  2011-02-10 15:17 ` Dave Hylands
@ 2011-02-10 16:23   ` kashish bhatia
  2011-02-10 17:22     ` Mulyadi Santosa
  0 siblings, 1 reply; 7+ messages in thread
From: kashish bhatia @ 2011-02-10 16:23 UTC (permalink / raw)
  To: kernelnewbies

*yes I compiled the kernel again and then tried to insert my module. I think
the function is not properly exporting.*


-- 
Regards,
Kashish
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20110210/a81d077c/attachment.html 

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

* About EXPORT_SYMBOL
  2011-02-10 16:23   ` kashish bhatia
@ 2011-02-10 17:22     ` Mulyadi Santosa
  2011-02-10 18:04       ` Dave Hylands
  0 siblings, 1 reply; 7+ messages in thread
From: Mulyadi Santosa @ 2011-02-10 17:22 UTC (permalink / raw)
  To: kernelnewbies

On Thu, Feb 10, 2011 at 23:23, kashish bhatia <koolest77@gmail.com> wrote:
>
> yes I compiled the kernel again and then tried to insert my module. I think
> the function is not properly exporting.

not sure if it makes difference, but try EXPORT_SYMBOL_GPL() macro
instead.... and see if it indeed works...

-- 
regards,

Mulyadi Santosa
Freelance Linux trainer and consultant

blog: the-hydra.blogspot.com
training: mulyaditraining.blogspot.com

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

* About EXPORT_SYMBOL
  2011-02-10 17:22     ` Mulyadi Santosa
@ 2011-02-10 18:04       ` Dave Hylands
  2011-02-10 19:53         ` Sri Ram Vemulpali
  0 siblings, 1 reply; 7+ messages in thread
From: Dave Hylands @ 2011-02-10 18:04 UTC (permalink / raw)
  To: kernelnewbies

Hi Mulyadi,

On Thu, Feb 10, 2011 at 9:22 AM, Mulyadi Santosa
<mulyadi.santosa@gmail.com> wrote:
> On Thu, Feb 10, 2011 at 23:23, kashish bhatia <koolest77@gmail.com> wrote:
>>
>> yes I compiled the kernel again and then tried to insert my module. I think
>> the function is not properly exporting.
>
> not sure if it makes difference, but try EXPORT_SYMBOL_GPL() macro
> instead.... and see if it indeed works...

EXPORT_SYMBOL_GPL is more restrictive than EXPORT_SYMBOL. It only
allows the symbol to be used by modules which have GPL module
licesnce.

Kashish, so you know which symbol is unknown?

If you use insmod it should report which symbols are the unknown ones.
Otherwise you can resort to running nm on your module to see what
symbols it needs.

Dave Hylands

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

* About EXPORT_SYMBOL
  2011-02-10 18:04       ` Dave Hylands
@ 2011-02-10 19:53         ` Sri Ram Vemulpali
  0 siblings, 0 replies; 7+ messages in thread
From: Sri Ram Vemulpali @ 2011-02-10 19:53 UTC (permalink / raw)
  To: kernelnewbies

Compiling the kernel should resolve the problem.

EXPORT_SYMBOL_GPL() is more for modules that have GPL license.
So, if you export symbol with GPL license, it is imperative to have GPL
license for modules, accessing that symbol. Otherwise will EXPORT_SYMBOL
it should be fine, to access by any module. In former case, it only
warns at time of
inserting the module for GPL license. Either case you should able to
access the symbol

--Sri.

On Thu, Feb 10, 2011 at 1:04 PM, Dave Hylands <dhylands@gmail.com> wrote:
> Hi Mulyadi,
>
> On Thu, Feb 10, 2011 at 9:22 AM, Mulyadi Santosa
> <mulyadi.santosa@gmail.com> wrote:
>> On Thu, Feb 10, 2011 at 23:23, kashish bhatia <koolest77@gmail.com> wrote:
>>>
>>> yes I compiled the kernel again and then tried to insert my module. I think
>>> the function is not properly exporting.
>>
>> not sure if it makes difference, but try EXPORT_SYMBOL_GPL() macro
>> instead.... and see if it indeed works...
>
> EXPORT_SYMBOL_GPL is more restrictive than EXPORT_SYMBOL. It only
> allows the symbol to be used by modules which have GPL module
> licesnce.
>
> Kashish, so you know which symbol is unknown?
>
> If you use insmod it should report which symbols are the unknown ones.
> Otherwise you can resort to running nm on your module to see what
> symbols it needs.
>
> Dave Hylands
>
> _______________________________________________
> Kernelnewbies mailing list
> Kernelnewbies at kernelnewbies.org
> http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
>



-- 
Regards,
Sri.

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

* Transient Delivery Failure
       [not found] ` <MDAEMON3228201102101957.AA5731619@fibcom.com>
@ 2011-02-11 16:44   ` kashish bhatia
  0 siblings, 0 replies; 7+ messages in thread
From: kashish bhatia @ 2011-02-11 16:44 UTC (permalink / raw)
  To: kernelnewbies

>
> Hi Dave,
>

Yes, I know which symbol is unknown in my module. It is ext2_free_data()
function.
I think the function is not exporting properly.
The entire detail of my doubt is present in first thread of this mail.



-- 
Regards,
Kashish
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20110211/9ee984fd/attachment.html 

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

end of thread, other threads:[~2011-02-11 16:44 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-02-10 13:18 About EXPORT_SYMBOL kashish bhatia
2011-02-10 15:17 ` Dave Hylands
2011-02-10 16:23   ` kashish bhatia
2011-02-10 17:22     ` Mulyadi Santosa
2011-02-10 18:04       ` Dave Hylands
2011-02-10 19:53         ` Sri Ram Vemulpali
     [not found] ` <MDAEMON3228201102101957.AA5731619@fibcom.com>
2011-02-11 16:44   ` Transient Delivery Failure kashish bhatia

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.