Skip to content

Commit 028f042

Browse files
rgetzsravnborg
authored andcommitted
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 <[email protected]> Signed-off-by: Bryan Wu <[email protected]> Signed-off-by: Mike Frysinger <[email protected]> Signed-off-by: Sam Ravnborg <[email protected]>
1 parent 2185a5e commit 028f042

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

scripts/kallsyms.c

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ struct sym_entry {
3535
static struct sym_entry *table;
3636
static unsigned int table_size, table_cnt;
3737
static unsigned long long _text, _stext, _etext, _sinittext, _einittext;
38+
static unsigned long long _stext_l1, _etext_l1, _stext_l2, _etext_l2;
3839
static int all_symbols = 0;
3940
static char symbol_prefix_char = '\0';
4041

@@ -92,6 +93,14 @@ static int read_symbol(FILE *in, struct sym_entry *s)
9293
_sinittext = s->addr;
9394
else if (strcmp(sym, "_einittext") == 0)
9495
_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;
95104
else if (toupper(stype) == 'A')
96105
{
97106
/* Keep these useful absolute symbols */
@@ -157,7 +166,9 @@ static int symbol_valid(struct sym_entry *s)
157166
* and inittext sections are discarded */
158167
if (!all_symbols) {
159168
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))
161172
return 0;
162173
/* Corner case. Discard any symbols with the same value as
163174
* _etext _einittext; they can move between pass 1 and 2 when

0 commit comments

Comments
 (0)