Skip to contentSkip to conversation

Creating new System.map with modules symbol info

DISCUSSION Adayadil Thomas 6 participants 10 messages Nov 8, 2005 – Nov 9, 2005

lore
Share & tools
lore
#0 lore raw

Greetings.

The System map that was created when compiling kernel does'nt have the symbols of modules that are loaded later. How can I create a new System.map with the symbols of
modules also.

Any information is much appreciated.

Thanks

#1 lore raw
Quoted 8 lines · Adayadil Thomas

Greetings.

The System map that was created when compiling kernel does'nt have the symbols of modules that are loaded later. How can I create a new System.map with the symbols of
modules also.

From the linux kernel source directory, take a look at scripts/mksysmap.

--
Chris Largret <http://daga.dyndns.org>

#2 lore raw

Thanks for the reply.

Usage of mksysmap is --
mksysmap vmlinux System.map

How do I specify the module which is not included in the kernel ? Is that possible ?

Thanks

Quoted 14 lines · Chris Largret
Quoted 8 lines · Adayadil Thomas

Greetings.

The System map that was created when compiling kernel does'nt have the symbols of modules that are loaded later. How can I create a new System.map with the symbols of
modules also.

From the linux kernel source directory, take a look at scripts/mksysmap.

--
Chris Largret <http://daga.dyndns.org>

#3 lore raw
Quoted 7 lines · Adayadil Thomas

Thanks for the reply.

Usage of mksysmap is --
mksysmap vmlinux System.map

How do I specify the module which is not included in the kernel ? Is that possible ?

Not with that script.

Look at /proc/kallsyms instead.

MfG, JBG

Signature · 4 lines
Jan-Benedict Glaw       [email protected]    . +49-172-7608481             _ O _
"Eine Freie Meinung in  einem Freien Kopf    | Gegen Zensur | Gegen Krieg  _ _ O
 für einen Freien Staat voll Freier Bürger"  | im Internet! |   im Irak!   O O O
ret = do_actions((curr | FREE_SPEECH) & ~(NEW_COPYRIGHT_LAW | DRM | TCPA));
#4 lore raw
In reply to Adayadil Thomas
Quoted 7 lines · Adayadil Thomas

Thanks for the reply.

Usage of mksysmap is --
mksysmap vmlinux System.map

How do I specify the module which is not included in the kernel ? Is that possible ?

you could do:

nm -n /path/to/module.ko | grep -v '\( [aUw] \)\|\(__crc_\)\|\( \
$[adt]\)'>/path/to/module.map

This is essentially what mksysmap does, except with the ability to define 'nm' locations. This isn't really a file that could be used in place of the System.map file though. At least not if I understand the purpose of it.

The System.map file is used to keep track of symbols in the kernel. I believe the module symbols can be traced with the aid of some of the debug kernel configuration options.

--
Chris Largret <http://daga.dyndns.org>

#5 lore raw
In reply to Adayadil Thomas
Quoted 6 lines · Adayadil Thomas

Greetings.

The System map that was created when compiling kernel does'nt have the symbols of modules that are loaded later. How can I create a new System.map with the symbols of
modules also.

maybe a silly question.. but why does it matter? Eg what tool uses this info?

#6 lore raw
Quoted 10 lines · Arjan van de Ven
Quoted 6 lines · Adayadil Thomas

Greetings.

The System map that was created when compiling kernel does'nt have the symbols of modules that are loaded later. How can I create a new System.map with the symbols of
modules also.

maybe a silly question.. but why does it matter? Eg what tool uses this info?

Maybe he's creating a tool. Anyway /proc/kallsyms will have all the symbols and their offsets of the currently running kernel. It's a good way to find offsets of items not currently exported.

Cheers,
Dick Johnson
Penguin : Linux version 2.6.13.4 on an i686 machine (5589.55 BogoMips). Warning : 98.36% of all statistics are fiction.
.

****************************************************************
The information transmitted in this message is confidential and may be privileged. Any review, retransmission, dissemination, or other use of this information by persons or entities other than the intended recipient is prohibited. If you are not the intended recipient, please notify Analogic Corporation immediately - by replying to this message or by sending an email to [email protected] - and destroy all copies of this information, including any attachments, without reading or disclosing them.

Thank you.

#7 lore raw

I am trying to use lcrash to debug a panic

I have the System.map of the original kernel (without modules loaded), Kerntypes file and the dump file

    <4>Modules linked in: ip_conntrack_dos
    <4>CPU:    0
    <4>EIP:    0060:[<f8bb245b>]    Tainted: P      VLI
    <4>EFLAGS: 00010246   (2.6.12)
    <4>EIP is at init_conntrack_syn+0x193/0x214 [ip_conntrack_dos]
    <4>eax: dd0f34b3   ebx: f48de908   ecx: f48de900   edx: 00000000
    <4>esi: f4c65bc8   edi: f48de900   ebp: 00100100   esp: c040dae0
    <4>ds: 007b   es: 007b   ss: 0068

If i Use the original System.map, it doesnt find the symbol for the init_conntrack_syn
( EIP is pointing there)
However, kallsyms has an entry for that
f8b752c8 t init_conntrack_syn

If kallsyms has all the symbols, I am wondering why does it have lesser lines ?

wc -l
12343 kallsyms
32127 System.map

Will it work if I cat System.map and kallsyms together and do a sort and uniq so that i get the union of both ?

Quoted 29 lines · linux-os (Dick Johnson)
Quoted 10 lines · Arjan van de Ven
Quoted 6 lines · Adayadil Thomas

Greetings.

The System map that was created when compiling kernel does'nt have the symbols of modules that are loaded later. How can I create a new System.map with the symbols of
modules also.

maybe a silly question.. but why does it matter? Eg what tool uses this info?

Maybe he's creating a tool. Anyway /proc/kallsyms will have all the symbols and their offsets of the currently running kernel. It's a good way to find offsets of items not currently exported.

Cheers,
Dick Johnson
Penguin : Linux version 2.6.13.4 on an i686 machine (5589.55 BogoMips). Warning : 98.36% of all statistics are fiction.
.

****************************************************************
The information transmitted in this message is confidential and may be privileged. Any review, retransmission, dissemination, or other use of this information by persons or entities other than the intended recipient is prohibited. If you are not the intended recipient, please notify Analogic Corporation immediately - by replying to this message or by sending an email to [email protected] - and destroy all copies of this information, including any attachments, without reading or disclosing them.

Thank you.

#8 lore raw
Quoted 7 lines · Adayadil Thomas

[...]
If i Use the original System.map, it doesnt find the symbol for the init_conntrack_syn
( EIP is pointing there)
However, kallsyms has an entry for that
f8b752c8 t init_conntrack_syn

Quoted 5 lines

If kallsyms has all the symbols, I am wondering why does it have lesser lines ?

wc -l
12343 kallsyms
32127 System.map

By default kallsyms only stores symbols that are int the kernel's text areas, whereas System.map has all the symbols.

You can make kallsyms store all the symbols by setting CONFIG_KALLSYMS_ALL in your kernel configuration, but the extra symbol data will increase your kernel size. Depending on the target host memory size this can be either negligeable or a big problem :)

However, module symbols appear in the /proc/kallsyms file using a totally different mechanism, and even if you don't set CONFIG_KALLSYMS_ALL, module data symbols (and others) still show up there.

By the way, if you had KALLSYMS configured in the first place, the kernel itself would translate those addresses for you for free.

Quoted 2 lines

Will it work if I cat System.map and kallsyms together and do a sort and uniq so that i get the union of both ?

Unless you really need non-text symbols, kallsyms should have all the information you need. If you need _everything_ then you can just do something like (totally untested) "grep \\[ /proc/kallsyms >> System.map" to add the symbols from modules to the System.map.

I don't know if the tools out there will like this, though...

Signature · 5 lines
Paulo Marques - www.grupopie.com

The rule is perfect: in all matters of opinion our
adversaries are insane.
Mark Twain
#9 lore raw
In reply to Adayadil Thomas
Quoted 21 lines · Adayadil Thomas

I am trying to use lcrash to debug a panic

I have the System.map of the original kernel (without modules loaded), Kerntypes file and the dump file

   <4>Modules linked in: ip_conntrack_dos
   <4>CPU:    0
   <4>EIP:    0060:[<f8bb245b>]    Tainted: P      VLI
   <4>EFLAGS: 00010246   (2.6.12)
   <4>EIP is at init_conntrack_syn+0x193/0x214 [ip_conntrack_dos]
   <4>eax: dd0f34b3   ebx: f48de908   ecx: f48de900   edx: 00000000
   <4>esi: f4c65bc8   edi: f48de900   ebp: 00100100   esp: c040dae0
   <4>ds: 007b   es: 007b   ss: 0068

If i Use the original System.map, it doesnt find the symbol for the init_conntrack_syn
( EIP is pointing there)
However, kallsyms has an entry for that
f8b752c8 t init_conntrack_syn

Quoted 9 lines

If kallsyms has all the symbols, I am wondering why does it have lesser lines ?

wc -l
12343 kallsyms
32127 System.map

Will it work if I cat System.map and kallsyms together and do a sort and uniq so that i get the union of both ?

Look at the CONTENT of both files! System.map has more information. You can execute man nm to find out what each of the symbol types mean.

Cheers,
Dick Johnson
Penguin : Linux version 2.6.13.4 on an i686 machine (5589.55 BogoMips). Warning : 98.36% of all statistics are fiction.
.

****************************************************************
The information transmitted in this message is confidential and may be privileged. Any review, retransmission, dissemination, or other use of this information by persons or entities other than the intended recipient is prohibited. If you are not the intended recipient, please notify Analogic Corporation immediately - by replying to this message or by sending an email to [email protected] - and destroy all copies of this information, including any attachments, without reading or disclosing them.

Thank you.