aboutsummaryrefslogtreecommitdiffstats
path: root/scripts/kallsyms.c
diff options
context:
space:
mode:
authorRobin Getz <rgetz@blackfin.uclinux.org>2008-02-06 04:36:26 -0500
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2008-02-06 13:41:01 -0500
commita3b81113fb6658629f4ebaabf8dd3067cd341020 (patch)
treec6823e84d410f18b110ce07726643d7dc841553d /scripts/kallsyms.c
parent0a5dcb51770be3cd0202d6b90a07996fb40130b6 (diff)
remove support for un-needed _extratext section
When passing a zero address to kallsyms_lookup(), the kernel thought it was a valid kernel address, even if it is not. This is because is_ksym_addr() called is_kernel_extratext() and checked against labels that don't exist on many archs (which default as zero). Since PPC was the only kernel which defines _extra_text, (in 2005), and no longer needs it, this patch removes _extra_text support. For some history (provided by Jon): http://ozlabs.org/pipermail/linuxppc-dev/2005-September/019734.html http://ozlabs.org/pipermail/linuxppc-dev/2005-September/019736.html http://ozlabs.org/pipermail/linuxppc-dev/2005-September/019751.html [akpm@linux-foundation.org: coding-style fixes] Signed-off-by: Robin Getz <rgetz@blackfin.uclinux.org> Cc: David Woodhouse <dwmw2@infradead.org> Cc: Jon Loeliger <jdl@freescale.com> Cc: Paul Mackerras <paulus@samba.org> Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org> Cc: Sam Ravnborg <sam@ravnborg.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'scripts/kallsyms.c')
-rw-r--r--scripts/kallsyms.c24
1 files changed, 10 insertions, 14 deletions
diff --git a/scripts/kallsyms.c b/scripts/kallsyms.c
index 1f11d848532a..8fb87003d5d3 100644
--- a/scripts/kallsyms.c
+++ b/scripts/kallsyms.c
@@ -41,7 +41,7 @@ struct sym_entry {
41 41
42static struct sym_entry *table; 42static struct sym_entry *table;
43static unsigned int table_size, table_cnt; 43static unsigned int table_size, table_cnt;
44static unsigned long long _text, _stext, _etext, _sinittext, _einittext, _sextratext, _eextratext; 44static unsigned long long _text, _stext, _etext, _sinittext, _einittext;
45static int all_symbols = 0; 45static int all_symbols = 0;
46static char symbol_prefix_char = '\0'; 46static char symbol_prefix_char = '\0';
47 47
@@ -99,10 +99,6 @@ static int read_symbol(FILE *in, struct sym_entry *s)
99 _sinittext = s->addr; 99 _sinittext = s->addr;
100 else if (strcmp(sym, "_einittext") == 0) 100 else if (strcmp(sym, "_einittext") == 0)
101 _einittext = s->addr; 101 _einittext = s->addr;
102 else if (strcmp(sym, "_sextratext") == 0)
103 _sextratext = s->addr;
104 else if (strcmp(sym, "_eextratext") == 0)
105 _eextratext = s->addr;
106 else if (toupper(stype) == 'A') 102 else if (toupper(stype) == 'A')
107 { 103 {
108 /* Keep these useful absolute symbols */ 104 /* Keep these useful absolute symbols */
@@ -165,18 +161,18 @@ static int symbol_valid(struct sym_entry *s)
165 * and inittext sections are discarded */ 161 * and inittext sections are discarded */
166 if (!all_symbols) { 162 if (!all_symbols) {
167 if ((s->addr < _stext || s->addr > _etext) 163 if ((s->addr < _stext || s->addr > _etext)
168 && (s->addr < _sinittext || s->addr > _einittext) 164 && (s->addr < _sinittext || s->addr > _einittext))
169 && (s->addr < _sextratext || s->addr > _eextratext))
170 return 0; 165 return 0;
171 /* Corner case. Discard any symbols with the same value as 166 /* Corner case. Discard any symbols with the same value as
172 * _etext _einittext or _eextratext; they can move between pass 167 * _etext _einittext; they can move between pass 1 and 2 when
173 * 1 and 2 when the kallsyms data are added. If these symbols 168 * the kallsyms data are added. If these symbols move then
174 * move then they may get dropped in pass 2, which breaks the 169 * they may get dropped in pass 2, which breaks the kallsyms
175 * kallsyms rules. 170 * rules.
176 */ 171 */
177 if ((s->addr == _etext && strcmp((char*)s->sym + offset, "_etext")) || 172 if ((s->addr == _etext &&
178 (s->addr == _einittext && strcmp((char*)s->sym + offset, "_einittext")) || 173 strcmp((char *)s->sym + offset, "_etext")) ||
179 (s->addr == _eextratext && strcmp((char*)s->sym + offset, "_eextratext"))) 174 (s->addr == _einittext &&
175 strcmp((char *)s->sym + offset, "_einittext")))
180 return 0; 176 return 0;
181 } 177 }
182 178