./scripts/kallsyms.c question

From: Robin Getz
Date: Sun Jul 09 2006 - 22:27:21 EST


The application kallsyms generate assembler source containing symbol information, where "symbol information" is in these pre-defined names:

_stext, _etext, _sinittext, _einittext, _sextratext, _eextratext

I am working with a processor (Blackfin) which uses these plus two others _stext_l1, and _etext_l1.

I can add these in the same fashion as the existing (see below), but was wondering if this shouldn't be re-structured with a struct/loop rather than the existing n lines of if/else?

Thanks
-Robin

--- ./kallsyms.c.org 2006-04-02 15:42:50.000000000 -0400
+++ ./kallsyms.c 2006-04-02 15:57:25.000000000 -0400
@@ -43,7 +43,7 @@

static struct sym_entry *table;
static unsigned int table_size, table_cnt;
-static unsigned long long _stext, _etext, _sinittext, _einittext, _sextratext, _eextratext;
+static unsigned long long _stext, _etext, _sinittext, _einittext, _sextratext, _eextratext;
+static unsigned long long _stext_l1, _etext_l1;
static int all_symbols = 0;
static char symbol_prefix_char = '\0';

@@ -103,6 +103,10 @@
_sextratext = s->addr;
else if (strcmp(sym, "_eextratext") == 0)
_eextratext = s->addr;
+ else if (strcmp(sym, "_stext_l1" ) == 0)
+ _stext_l1 = s->addr;
+ else if (strcmp(sym, "_etext_l1" ) == 0)
+ _etext_l1 = s->addr;
else if (toupper(stype) == 'A')
{
/* Keep these useful absolute symbols */
@@ -161,7 +165,8 @@
if (!all_symbols) {
if ((s->addr < _stext || s->addr > _etext)
&& (s->addr < _sinittext || s->addr > _einittext)
- && (s->addr < _sextratext || s->addr > _eextratext))
+ && (s->addr < _sextratext || s->addr > _eextratext)
+ && (s->addr < _stext_l1 || s->addr > _etext_l1))
return 0;
/* Corner case. Discard any symbols with the same value as
* _etext _einittext or _eextratext; they can move between pass

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