Re: /proc/ksyms and /proc/kallsyms relation

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi...

On Thu, Nov 6, 2008 at 10:42 PM, Giannis Kozyrakis <trv@xxxxxxxxxxx> wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Hello,
>
> I've recently begun to study kernel modules, and how they changed
> between kernel 2.4 and 2.6, with respect to symbol exporting options.
>
> In kernel 2.4, there was a /proc/ksyms file. This file, if I understand
> correctly, was a method to access the kernel's public symbol table. This
> table had all the public kernel's symbols (variables, functions..) and
> its associated global addresses, along with some othere usefull stuff,
> like a CRC value, and the module exporting every specific symbol.
>
> Fine until this point.
>
> In 2.6 kernels, /proc/ksyms disappeared. Many suggest that it was
> replaced by /proc/kallsyms file. BUT this file seems to be something
> completely different, and I haven't figured out in what way it is different.
>
> So, some questions to anyone that knows more on this:
>
> 1. Is my description of the functionality of /proc/ksyms in 2.4 kernels
> correct?
>
> 2. What exactly the /proc/kallsyms file contains? Why this file exists
> and how is it used?
>
> 3. Why was there this change in name and behavior of this file?
>
> 4. If one wants to find out what are the exported symbols from some
> module, how can he achive this?
>
>
> - From what I understand about /proc/kallsyms, it contains even the
> symbols that are not exported using EXPORT_SYMBOL(symbol_name).
> /proc/ksyms, contained every symbol appart from those that were not
> exported (considering the export all default policy in 2.4, in contrast
> with the export none policy of 2.6)

I think you're correct. kallsyms contains symbols located in text
section, bss section, data section... be it local or global. however,
I do see that my kernel (Ubuntu's 2.6.22-14 generic) is configured
with CONFIG_KALLSYMS_ALL=y, so maybe that explains why I saw abundant
symbol names.

Using kallsyms, i saw that every symbols name are suffixed with module
name where they belong to. So simply grepping module name will tell
you which ones are exported (you probably just want to see the global
ones.....T, B and D).

Kallsyms itself, AFAIK, is either a special section in kernel memory
layout...or special linked list that contains those symbols.
Therefore, it has constructor, destructor and accessor functions.

regards,

Mulyadi.

--
To unsubscribe from this list: send an email with
"unsubscribe kernelnewbies" to ecartis@xxxxxxxxxxxx
Please read the FAQ at http://kernelnewbies.org/FAQ


[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux