lkml.org 
[lkml]   [2000]   [Jul]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: accessing kernel symbols

Uh- sure- but that's not what I meant. gshekar didn't say *why* he wanted it.
I myself would use a cat of /proc/ksyms to find out whether an SMP kernel is
running or not to decide which driver to load (e.g.). I wouldn't use the
output of ksyms except as a hint for something useful (like which flavor down
or __down is to be used this week)


On Fri, 28 Jul 2000, Keith Owens wrote:

> On Thu, 27 Jul 2000 09:24:47 -0700 (PDT),
> Matthew Jacob <mjacob@feral.com> wrote:
> >Even better (from a module writer's perspective) you can just read /proc/ksyms
> >to get address/name pairs of the functions it would be reasonably safe for
> >your module to bind to.
>
> No, please I beg you - NOOOO! Grabbing addresses out of /proc/ksyms
> and doing direct branches to them
>
> (a) Will not work on architectures where a function pointer is a
> descriptor instead of just an address (like IA64).
> (b) Does not put any reference count on the symbol you are using. If the
> symbol is in a module and there is no refernce count, it can be
> removed under you - splat! Al Viro just did a huge cleanup on
> module reference counts, don't introduce a mechanism that destroys
> that work.
>
> If you want to access a symbol from a module just refer to it by name.
> Of course the symbol has to be exported. If you need a symbol that is
> not currently exported you have to ask yourself should it be exported
> or are you looking for the wrong interface.
>


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 13:57    [W:0.153 / U:0.180 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site