diff options
author | David Woodhouse <dwmw2@infradead.org> | 2005-05-05 19:15:09 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@ppc970.osdl.org> | 2005-05-05 19:36:31 -0400 |
commit | 075d6eb16d273dab7b7b4b83fcee8bce4ee387ed (patch) | |
tree | d5e2cfb21dd752410649a675f2bb2a7c0db05c8e /scripts/kallsyms.c | |
parent | becf3aec2608d6807a58d0677661cb23c388d67f (diff) |
[PATCH] ppc32: platform-specific functions missing from kallsyms.
The PPC32 kernel puts platform-specific functions into separate sections so
that unneeded parts of it can be freed when we've booted and actually
worked out what we're running on today.
This makes kallsyms ignore those functions, because they're not between
_[se]text or _[se]inittext. Rather than teaching kallsyms about the
various pmac/chrp/etc sections, this patch adds '_[se]extratext' markers
for kallsyms.
Signed-off-by: David Woodhouse <dwmw2@infradead.org>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'scripts/kallsyms.c')
-rw-r--r-- | scripts/kallsyms.c | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/scripts/kallsyms.c b/scripts/kallsyms.c index fe11df83d1f..d3d2e534105 100644 --- a/scripts/kallsyms.c +++ b/scripts/kallsyms.c | |||
@@ -67,7 +67,7 @@ struct sym_entry { | |||
67 | 67 | ||
68 | static struct sym_entry *table; | 68 | static struct sym_entry *table; |
69 | static int size, cnt; | 69 | static int size, cnt; |
70 | static unsigned long long _stext, _etext, _sinittext, _einittext; | 70 | static unsigned long long _stext, _etext, _sinittext, _einittext, _sextratext, _eextratext; |
71 | static int all_symbols = 0; | 71 | static int all_symbols = 0; |
72 | static char symbol_prefix_char = '\0'; | 72 | static 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 | ||