diff options
| author | Robin Getz <robin.getz@analog.com> | 2006-07-10 02:25:40 -0400 |
|---|---|---|
| committer | Sam Ravnborg <sam@ravnborg.org> | 2009-06-14 16:43:45 -0400 |
| commit | 028f042613c3c99db20dd7f4e4069fbbcea92dd7 (patch) | |
| tree | e23ca3d718e947a533c6e54cce9ac9b9f5f27691 | |
| parent | 2185a5ecd98d2cebc6a29b07b1ea4f7334c2ccc3 (diff) | |
kallsyms: support kernel symbols in Blackfin on-chip memory
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>
| -rw-r--r-- | scripts/kallsyms.c | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/scripts/kallsyms.c b/scripts/kallsyms.c index 6654cbed965b..fb82a5b49809 100644 --- a/scripts/kallsyms.c +++ b/scripts/kallsyms.c | |||
| @@ -35,6 +35,7 @@ struct sym_entry { | |||
| 35 | static struct sym_entry *table; | 35 | static struct sym_entry *table; |
| 36 | static unsigned int table_size, table_cnt; | 36 | static unsigned int table_size, table_cnt; |
| 37 | static unsigned long long _text, _stext, _etext, _sinittext, _einittext; | 37 | static unsigned long long _text, _stext, _etext, _sinittext, _einittext; |
| 38 | static unsigned long long _stext_l1, _etext_l1, _stext_l2, _etext_l2; | ||
| 38 | static int all_symbols = 0; | 39 | static int all_symbols = 0; |
| 39 | static char symbol_prefix_char = '\0'; | 40 | static char symbol_prefix_char = '\0'; |
| 40 | 41 | ||
| @@ -92,6 +93,14 @@ static int read_symbol(FILE *in, struct sym_entry *s) | |||
| 92 | _sinittext = s->addr; | 93 | _sinittext = s->addr; |
| 93 | else if (strcmp(sym, "_einittext") == 0) | 94 | else if (strcmp(sym, "_einittext") == 0) |
| 94 | _einittext = s->addr; | 95 | _einittext = s->addr; |
| 96 | else if (strcmp(sym, "_stext_l1") == 0) | ||
| 97 | _stext_l1 = s->addr; | ||
| 98 | else if (strcmp(sym, "_etext_l1") == 0) | ||
| 99 | _etext_l1 = s->addr; | ||
| 100 | else if (strcmp(sym, "_stext_l2") == 0) | ||
| 101 | _stext_l2 = s->addr; | ||
| 102 | else if (strcmp(sym, "_etext_l2") == 0) | ||
| 103 | _etext_l2 = s->addr; | ||
| 95 | else if (toupper(stype) == 'A') | 104 | else if (toupper(stype) == 'A') |
| 96 | { | 105 | { |
| 97 | /* Keep these useful absolute symbols */ | 106 | /* Keep these useful absolute symbols */ |
| @@ -157,7 +166,9 @@ static int symbol_valid(struct sym_entry *s) | |||
| 157 | * and inittext sections are discarded */ | 166 | * and inittext sections are discarded */ |
| 158 | if (!all_symbols) { | 167 | if (!all_symbols) { |
| 159 | if ((s->addr < _stext || s->addr > _etext) | 168 | if ((s->addr < _stext || s->addr > _etext) |
| 160 | && (s->addr < _sinittext || s->addr > _einittext)) | 169 | && (s->addr < _sinittext || s->addr > _einittext) |
| 170 | && (s->addr < _stext_l1 || s->addr > _etext_l1) | ||
| 171 | && (s->addr < _stext_l2 || s->addr > _etext_l2)) | ||
| 161 | return 0; | 172 | return 0; |
| 162 | /* Corner case. Discard any symbols with the same value as | 173 | /* Corner case. Discard any symbols with the same value as |
| 163 | * _etext _einittext; they can move between pass 1 and 2 when | 174 | * _etext _einittext; they can move between pass 1 and 2 when |
