* 2.6.7: kallsyms --all-symbols shows a shift in the symbol addreses
@ 2004-06-21 16:19 Xavier Bru
2004-06-21 16:29 ` 2.6.7: kallsyms --all-symbols shows a shift in the symbol Randy.Dunlap
2004-06-21 22:18 ` 2.6.7: kallsyms --all-symbols shows a shift in the symbol addreses Keith Owens
0 siblings, 2 replies; 3+ messages in thread
From: Xavier Bru @ 2004-06-21 16:19 UTC (permalink / raw)
To: linux-ia64
Hi all!
There is a problem with the all kallsyms support in 2.6.7
scripts/kallsyms.c.
Building the table reserves the adresses for all the kernel symbols in
first step, then generates the effective addresses of the symbols in step 2.
The problem is that the symbols used to build the symbol table are not
taken in account for the size calculation, but are included in the table
in step 2.
This makes the table "bigger" than was allocated, and the symbols that
come behind are shifted.
This makes kallsyms (and KDB) give wrong addresses for these symbols.
One solution is to exclude from the symbol table the symbols used for
building it (As was provided in KDB patch :-)
--- linux-2.6.7.ori/scripts/kallsyms.c Wed Jun 16 07:20:26 2004
+++ linux-2.6.7/scripts/kallsyms.c Mon Jun 21 15:26:57 2004
@@ -74,6 +74,12 @@ symbol_valid(struct sym_entry *s)
if (strstr(s->sym, "_compiled."))
return 0;
+ if (!strcmp(s->sym, "kallsyms_addresses"))
+ return 0;
+ if (!strcmp(s->sym, "kallsyms_num_syms"))
+ return 0;
+ if (!strcmp(s->sym, "kallsyms_names"))
+ return 0;
return 1;
}
herafter the traces of the problem:
----------------------------------
$ grep numnode System.map
a000000100930740 G numnodes
# grep kallsyms_addresses /proc/kallsyms
a000000100894470 d kallsyms_addresses
# grep numnodes /proc/kallsyms
a000000100930700 d numnodes
Entering kdb (current=0xa000000100724000, pid 0) on processor 0 due to
Keyboard Entry
[0]kdb> md numnodes
0xa000000100930700 00000000 00000000 00008000 00000000 ................
0xa000000100930710 00799470 a0000001 5f757063 00007075 p.y.... cpu_up..
0xa000000100930720 00799628 a0000001 00000000 00000000 (.y.... ........
0xa000000100930730 00000003 0000000a 000015de 00000000 ........Þ.......
0xa000000100930740 00000004 00000000 00001feb 00001860 ........ë...`...
XXXXXXXX here it is !!!!
0xa000000100930750 00000100 00000000 0000000a 00000028 ............(...
0xa000000100930760 000001f4 00000bb8 00000002 0000003c ô...¸.......<...
0xa000000100930770 00000000 00000032 00010000 00000eb8 ....2.......¸...
[0]kdb>
With the fix:
------------
$ grep numnodes System.map
a000000100930700 G numnodes
# grep kallsyms_addresses /proc/kallsyms
# grep numnodes /proc/kallsyms
a000000100930700 d numnodes
Entering kdb (current=0xa000000100724000, pid 0) on processor 0 due to
Keyboard Entry
[0]kdb> md numnodes
0xa000000100930700 00000004 00000000 00001feb 0000181f ........ë.......
XXXXXXXX OK
0xa000000100930710 00000100 00000000 0000000a 00000028 ............(...
0xa000000100930720 000001f4 00000bb8 00000002 0000003c ô...¸.......<...
--
Sincères salutations.
_____________________________________________________________________
Xavier BRU BULL ISD/R&D/INTEL office: FREC B1-422
tel : +33 (0)4 76 29 77 45 http://www-frec.bull.fr
fax : +33 (0)4 76 29 77 70 mailto:Xavier.Bru@bull.net
addr: BULL, 1 rue de Provence, BP 208, 38432 Echirolles Cedex, FRANCE
_____________________________________________________________________
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: 2.6.7: kallsyms --all-symbols shows a shift in the symbol
2004-06-21 16:19 2.6.7: kallsyms --all-symbols shows a shift in the symbol addreses Xavier Bru
@ 2004-06-21 16:29 ` Randy.Dunlap
2004-06-21 22:18 ` 2.6.7: kallsyms --all-symbols shows a shift in the symbol addreses Keith Owens
1 sibling, 0 replies; 3+ messages in thread
From: Randy.Dunlap @ 2004-06-21 16:29 UTC (permalink / raw)
To: linux-ia64
On Mon, 21 Jun 2004 18:19:56 +0200 Xavier Bru wrote:
| Hi all!
|
| There is a problem with the all kallsyms support in 2.6.7
| scripts/kallsyms.c.
| Building the table reserves the adresses for all the kernel symbols in
| first step, then generates the effective addresses of the symbols in step 2.
| The problem is that the symbols used to build the symbol table are not
| taken in account for the size calculation, but are included in the table
| in step 2.
| This makes the table "bigger" than was allocated, and the symbols that
| come behind are shifted.
| This makes kallsyms (and KDB) give wrong addresses for these symbols.
|
| One solution is to exclude from the symbol table the symbols used for
| building it (As was provided in KDB patch :-)
Is this the same problem that Keith Owens made a patch for
against 2.6.7-rc3 on 2004-june-15?
Subject: [patch 2.6.7-rc3] When two kallsyms passes are not enough
http://marc.theaimsgroup.com/?l=linux-kernel&m\x108728234402407&w=2
--
~Randy
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: 2.6.7: kallsyms --all-symbols shows a shift in the symbol addreses
2004-06-21 16:19 2.6.7: kallsyms --all-symbols shows a shift in the symbol addreses Xavier Bru
2004-06-21 16:29 ` 2.6.7: kallsyms --all-symbols shows a shift in the symbol Randy.Dunlap
@ 2004-06-21 22:18 ` Keith Owens
1 sibling, 0 replies; 3+ messages in thread
From: Keith Owens @ 2004-06-21 22:18 UTC (permalink / raw)
To: linux-ia64
On Mon, 21 Jun 2004 09:29:46 -0700,
"Randy.Dunlap" <rddunlap@osdl.org> wrote:
>On Mon, 21 Jun 2004 18:19:56 +0200 Xavier Bru wrote:
>| There is a problem with the all kallsyms support in 2.6.7
>| scripts/kallsyms.c.
>| One solution is to exclude from the symbol table the symbols used for
>| building it (As was provided in KDB patch :-)
>
>Is this the same problem that Keith Owens made a patch for
>against 2.6.7-rc3 on 2004-june-15?
>Subject: [patch 2.6.7-rc3] When two kallsyms passes are not enough
>
>http://marc.theaimsgroup.com/?l=linux-kernel&m\x108728234402407&w=2
Yes. That patch has been refined and sent to Andrew Morton, it should
be in 2.6.8-*. The critical fix is -
Index: 2.6.7-kallsyms/scripts/kallsyms.c
=================================--- 2.6.7-kallsyms.orig/scripts/kallsyms.c 2004-06-20 20:12:08.000000000 +1000
+++ 2.6.7-kallsyms/scripts/kallsyms.c 2004-06-20 23:38:46.000000000 +1000
@@ -72,7 +72,15 @@ symbol_valid(struct sym_entry *s)
return 0;
}
- if (strstr(s->sym, "_compiled."))
+ /* Exclude symbols which vary between passes. Passes 1 and 2 must have
+ * identical symbol lists. The kallsyms_* symbols below are only added
+ * after pass 1, they would be included in pass 2 when --all-symbols is
+ * specified so exclude them to get a stable symbol list.
+ */
+ if (strstr(s->sym, "_compiled.") ||
+ strcmp(s->sym, "kallsyms_addresses") = 0 ||
+ strcmp(s->sym, "kallsyms_num_syms") = 0 ||
+ strcmp(s->sym, "kallsyms_names") = 0)
return 0;
return 1;
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2004-06-21 22:18 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-06-21 16:19 2.6.7: kallsyms --all-symbols shows a shift in the symbol addreses Xavier Bru
2004-06-21 16:29 ` 2.6.7: kallsyms --all-symbols shows a shift in the symbol Randy.Dunlap
2004-06-21 22:18 ` 2.6.7: kallsyms --all-symbols shows a shift in the symbol addreses Keith Owens
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox