aboutsummaryrefslogtreecommitdiffstats
path: root/scripts/kallsyms.c
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/kallsyms.c')
-rw-r--r--scripts/kallsyms.c20
1 files changed, 13 insertions, 7 deletions
diff --git a/scripts/kallsyms.c b/scripts/kallsyms.c
index fe11df83d1fc..d3d2e5341051 100644
--- a/scripts/kallsyms.c
+++ b/scripts/kallsyms.c
@@ -67,7 +67,7 @@ struct sym_entry {
67 67
68static struct sym_entry *table; 68static struct sym_entry *table;
69static int size, cnt; 69static int size, cnt;
70static unsigned long long _stext, _etext, _sinittext, _einittext; 70static unsigned long long _stext, _etext, _sinittext, _einittext, _sextratext, _eextratext;
71static int all_symbols = 0; 71static int all_symbols = 0;
72static char symbol_prefix_char = '\0'; 72static char symbol_prefix_char = '\0';
73 73
@@ -139,6 +139,10 @@ read_symbol(FILE *in, struct sym_entry *s)
139 _sinittext = s->addr; 139 _sinittext = s->addr;
140 else if (strcmp(sym, "_einittext") == 0) 140 else if (strcmp(sym, "_einittext") == 0)
141 _einittext = s->addr; 141 _einittext = s->addr;
142 else if (strcmp(sym, "_sextratext") == 0)
143 _sextratext = s->addr;
144 else if (strcmp(sym, "_eextratext") == 0)
145 _eextratext = s->addr;
142 else if (toupper(s->type) == 'A') 146 else if (toupper(s->type) == 'A')
143 { 147 {
144 /* Keep these useful absolute symbols */ 148 /* Keep these useful absolute symbols */
@@ -194,16 +198,18 @@ symbol_valid(struct sym_entry *s)
194 * and inittext sections are discarded */ 198 * and inittext sections are discarded */
195 if (!all_symbols) { 199 if (!all_symbols) {
196 if ((s->addr < _stext || s->addr > _etext) 200 if ((s->addr < _stext || s->addr > _etext)
197 && (s->addr < _sinittext || s->addr > _einittext)) 201 && (s->addr < _sinittext || s->addr > _einittext)
202 && (s->addr < _sextratext || s->addr > _eextratext))
198 return 0; 203 return 0;
199 /* Corner case. Discard any symbols with the same value as 204 /* Corner case. Discard any symbols with the same value as
200 * _etext or _einittext, they can move between pass 1 and 2 205 * _etext _einittext or _eextratext; they can move between pass
201 * when the kallsyms data is added. If these symbols move then 206 * 1 and 2 when the kallsyms data are added. If these symbols
202 * they may get dropped in pass 2, which breaks the kallsyms 207 * move then they may get dropped in pass 2, which breaks the
203 * rules. 208 * kallsyms rules.
204 */ 209 */
205 if ((s->addr == _etext && strcmp(s->sym + offset, "_etext")) || 210 if ((s->addr == _etext && strcmp(s->sym + offset, "_etext")) ||
206 (s->addr == _einittext && strcmp(s->sym + offset, "_einittext"))) 211 (s->addr == _einittext && strcmp(s->sym + offset, "_einittext")) ||
212 (s->addr == _eextratext && strcmp(s->sym + offset, "_eextratext")))
207 return 0; 213 return 0;
208 } 214 }
209 215