kallsyms: support kernel symbols in Blackfin on-chip memory
authorRobin Getz <robin.getz@analog.com>
Mon, 10 Jul 2006 06:25:40 +0000 (06:25 +0000)
committerSam Ravnborg <sam@ravnborg.org>
Sun, 14 Jun 2009 20:43:45 +0000 (22:43 +0200)
The Blackfin arch has a discontiguous .text layout due to having on-chip
instruction memory and no virtual memory support.  As such, we need to
add explicit checks for these additional .text regions.

Signed-off-by: Robin Getz <robin.getz@analog.com>
Signed-off-by: Bryan Wu <cooloney@kernel.org>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
scripts/kallsyms.c

index 6654cbed965b932c2cc515243680edac93b00c0b..fb82a5b498099f35e7855f774bcfd390c13a6444 100644 (file)
@@ -35,6 +35,7 @@ struct sym_entry {
 static struct sym_entry *table;
 static unsigned int table_size, table_cnt;
 static unsigned long long _text, _stext, _etext, _sinittext, _einittext;
+static unsigned long long _stext_l1, _etext_l1, _stext_l2, _etext_l2;
 static int all_symbols = 0;
 static char symbol_prefix_char = '\0';
 
@@ -92,6 +93,14 @@ static int read_symbol(FILE *in, struct sym_entry *s)
                _sinittext = s->addr;
        else if (strcmp(sym, "_einittext") == 0)
                _einittext = 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 (strcmp(sym, "_stext_l2") == 0)
+               _stext_l2 = s->addr;
+       else if (strcmp(sym, "_etext_l2") == 0)
+               _etext_l2 = s->addr;
        else if (toupper(stype) == 'A')
        {
                /* Keep these useful absolute symbols */
@@ -157,7 +166,9 @@ static int symbol_valid(struct sym_entry *s)
         * and inittext sections are discarded */
        if (!all_symbols) {
                if ((s->addr < _stext || s->addr > _etext)
-                   && (s->addr < _sinittext || s->addr > _einittext))
+                   && (s->addr < _sinittext || s->addr > _einittext)
+                   && (s->addr < _stext_l1 || s->addr > _etext_l1)
+                   && (s->addr < _stext_l2 || s->addr > _etext_l2))
                        return 0;
                /* Corner case.  Discard any symbols with the same value as
                 * _etext _einittext; they can move between pass 1 and 2 when