aboutsummaryrefslogtreecommitdiffstats
path: root/arch/ppc
diff options
context:
space:
mode:
Diffstat (limited to 'arch/ppc')
-rw-r--r--arch/ppc/kernel/find_name.c48
1 files changed, 0 insertions, 48 deletions
diff --git a/arch/ppc/kernel/find_name.c b/arch/ppc/kernel/find_name.c
deleted file mode 100644
index 3c0fa8e0c077..000000000000
--- a/arch/ppc/kernel/find_name.c
+++ /dev/null
@@ -1,48 +0,0 @@
1#include <stdio.h>
2#include <asm/page.h>
3#include <sys/mman.h>
4#include <strings.h>
5/*
6 * Finds a given address in the System.map and prints it out
7 * with its neighbors. -- Cort
8 */
9
10int main(int argc, char **argv)
11{
12 unsigned long addr, cmp, i;
13 FILE *f;
14 char s[256], last[256];
15
16 if ( argc < 2 )
17 {
18 fprintf(stderr, "Usage: %s <address>\n", argv[0]);
19 return -1;
20 }
21
22 for ( i = 1 ; argv[i] ; i++ )
23 {
24 sscanf( argv[i], "%0lx", &addr );
25 /* adjust if addr is relative to kernelbase */
26 if ( addr < PAGE_OFFSET )
27 addr += PAGE_OFFSET;
28
29 if ( (f = fopen( "System.map", "r" )) == NULL )
30 {
31 perror("fopen()\n");
32 exit(-1);
33 }
34
35 while ( !feof(f) )
36 {
37 fgets(s, 255 , f);
38 sscanf( s, "%0lx", &cmp );
39 if ( addr < cmp )
40 break;
41 strcpy( last, s);
42 }
43
44 printf( "%s%s", last, s );
45 }
46 fclose(f);
47 return 0;
48}