annotate old/tmp/loadelf.cc @ 1616:05d449e7b9f8 draft

remove set_NDRange
author Yuhi TOMARI <yuhi@cr.ie.u-ryukyu.ac.jp>
date Tue, 14 May 2013 13:40:50 +0900
parents e66a08b5cd83
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
918
e66a08b5cd83 add loadelf in tmp/old.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1 /*
e66a08b5cd83 add loadelf in tmp/old.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
2 load spu elf file into memory with proper alignment.
e66a08b5cd83 add loadelf in tmp/old.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
3 */
e66a08b5cd83 add loadelf in tmp/old.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
4
e66a08b5cd83 add loadelf in tmp/old.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
5 #include <stdio.h>
e66a08b5cd83 add loadelf in tmp/old.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
6 #include <stdlib.h>
e66a08b5cd83 add loadelf in tmp/old.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
7 #include <unistd.h>
e66a08b5cd83 add loadelf in tmp/old.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
8 #include <fcntl.h>
e66a08b5cd83 add loadelf in tmp/old.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
9 #include <elf.h>
e66a08b5cd83 add loadelf in tmp/old.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
10 #include "types.h"
e66a08b5cd83 add loadelf in tmp/old.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
11 #include <alloca.h>
e66a08b5cd83 add loadelf in tmp/old.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
12 #include <malloc.h>
e66a08b5cd83 add loadelf in tmp/old.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
13 #include <strings.h>
e66a08b5cd83 add loadelf in tmp/old.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
14
e66a08b5cd83 add loadelf in tmp/old.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
15
e66a08b5cd83 add loadelf in tmp/old.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
16 static int
e66a08b5cd83 add loadelf in tmp/old.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
17 read_file(int fd, unsigned char *buf, int size)
e66a08b5cd83 add loadelf in tmp/old.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
18 {
e66a08b5cd83 add loadelf in tmp/old.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
19 int i = 0;
e66a08b5cd83 add loadelf in tmp/old.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
20 do {
e66a08b5cd83 add loadelf in tmp/old.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
21 int j = read(fd,buf+i,size-i);
e66a08b5cd83 add loadelf in tmp/old.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
22 if (j<0) return j;
e66a08b5cd83 add loadelf in tmp/old.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
23 i+=j;
e66a08b5cd83 add loadelf in tmp/old.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
24 } while( i< size ) ;
e66a08b5cd83 add loadelf in tmp/old.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
25 return i;
e66a08b5cd83 add loadelf in tmp/old.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
26 }
e66a08b5cd83 add loadelf in tmp/old.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
27
e66a08b5cd83 add loadelf in tmp/old.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
28 static memaddr
e66a08b5cd83 add loadelf in tmp/old.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
29 load_elf1(int fd)
e66a08b5cd83 add loadelf in tmp/old.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
30 {
e66a08b5cd83 add loadelf in tmp/old.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
31 Elf32_Ehdr header;
e66a08b5cd83 add loadelf in tmp/old.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
32
e66a08b5cd83 add loadelf in tmp/old.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
33 if (read_file(fd, (unsigned char *)&header, sizeof(header))<0) return 0;
e66a08b5cd83 add loadelf in tmp/old.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
34
e66a08b5cd83 add loadelf in tmp/old.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
35 if (header.e_ident[EI_CLASS]==ELFCLASS32) printf("32bit\n");
e66a08b5cd83 add loadelf in tmp/old.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
36 printf("entry %0lx\n", (unsigned long)header.e_entry);
e66a08b5cd83 add loadelf in tmp/old.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
37 printf("program header %0lx ", (unsigned long)header.e_phoff);
e66a08b5cd83 add loadelf in tmp/old.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
38 printf("length %0lx\n", (unsigned long)header.e_phentsize);
e66a08b5cd83 add loadelf in tmp/old.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
39 printf("section header %0lx ", (unsigned long)header.e_shoff);
e66a08b5cd83 add loadelf in tmp/old.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
40 printf("length %0lx\n", (unsigned long)header.e_shentsize);
e66a08b5cd83 add loadelf in tmp/old.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
41 printf("e_shstrndx %ld\n", (unsigned long)header.e_shstrndx);
e66a08b5cd83 add loadelf in tmp/old.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
42
e66a08b5cd83 add loadelf in tmp/old.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
43 int num = header.e_shnum;
e66a08b5cd83 add loadelf in tmp/old.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
44 Elf32_Shdr section[num] ;
e66a08b5cd83 add loadelf in tmp/old.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
45
e66a08b5cd83 add loadelf in tmp/old.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
46 lseek(fd,header.e_shoff + (sizeof(Elf32_Shdr )*(header.e_shstrndx)),SEEK_SET);
e66a08b5cd83 add loadelf in tmp/old.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
47 if (read_file(fd, (unsigned char *)&section[0], sizeof(Elf32_Shdr))<0) return 0;
e66a08b5cd83 add loadelf in tmp/old.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
48 unsigned char *text = (unsigned char *)alloca(section[0].sh_size);
e66a08b5cd83 add loadelf in tmp/old.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
49 lseek(fd,section[0].sh_offset,SEEK_SET);
e66a08b5cd83 add loadelf in tmp/old.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
50 if (read_file(fd, text, section[0].sh_size)<0) return 0;
e66a08b5cd83 add loadelf in tmp/old.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
51 // for(int i=0;i<section.sh_size;i++) putchar(text[i]);
e66a08b5cd83 add loadelf in tmp/old.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
52
e66a08b5cd83 add loadelf in tmp/old.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
53 lseek(fd,header.e_shoff,SEEK_SET);
e66a08b5cd83 add loadelf in tmp/old.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
54 if (read_file(fd, (unsigned char *)&section[0], sizeof(Elf32_Shdr)*num)<0) return 0;
e66a08b5cd83 add loadelf in tmp/old.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
55 long min = 0x7fffffff;
e66a08b5cd83 add loadelf in tmp/old.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
56 long max = 0;
e66a08b5cd83 add loadelf in tmp/old.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
57
e66a08b5cd83 add loadelf in tmp/old.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
58 for(int i=0; i< num; i++) {
e66a08b5cd83 add loadelf in tmp/old.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
59 if (section[i].sh_flags & SHF_ALLOC) {
e66a08b5cd83 add loadelf in tmp/old.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
60 int adr = section[i].sh_addr;
e66a08b5cd83 add loadelf in tmp/old.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
61 if (min>adr) min = adr;
e66a08b5cd83 add loadelf in tmp/old.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
62 adr += section[i].sh_size ;
e66a08b5cd83 add loadelf in tmp/old.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
63 if (max<adr) max = adr;
e66a08b5cd83 add loadelf in tmp/old.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
64 }
e66a08b5cd83 add loadelf in tmp/old.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
65 printf("section %d ",i) ;
e66a08b5cd83 add loadelf in tmp/old.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
66 printf(" sh_name %s\n",text+section[i].sh_name) ;
e66a08b5cd83 add loadelf in tmp/old.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
67 printf(" sh_name %lx ",(unsigned long)section[i].sh_name) ;
e66a08b5cd83 add loadelf in tmp/old.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
68 printf(" sh_type %lx ",(unsigned long)section[i].sh_type) ;
e66a08b5cd83 add loadelf in tmp/old.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
69 printf(" sh_addr %lx ",(unsigned long)section[i].sh_addr) ;
e66a08b5cd83 add loadelf in tmp/old.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
70 printf(" sh_offset %lx ",(unsigned long)section[i].sh_offset) ;
e66a08b5cd83 add loadelf in tmp/old.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
71 printf(" sh_size %lx\n",(unsigned long)section[i].sh_size) ;
e66a08b5cd83 add loadelf in tmp/old.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
72 }
e66a08b5cd83 add loadelf in tmp/old.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
73 printf("\nmax %lx min %lx\n",max,min) ;
e66a08b5cd83 add loadelf in tmp/old.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
74
e66a08b5cd83 add loadelf in tmp/old.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
75 #if 0
e66a08b5cd83 add loadelf in tmp/old.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
76 unsigned char *code = (unsigned char*)malloc(max-min);
e66a08b5cd83 add loadelf in tmp/old.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
77 #else
e66a08b5cd83 add loadelf in tmp/old.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
78 unsigned char *code ;
e66a08b5cd83 add loadelf in tmp/old.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
79 posix_memalign((void**)&code,16,max-min);
e66a08b5cd83 add loadelf in tmp/old.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
80 #endif
e66a08b5cd83 add loadelf in tmp/old.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
81
e66a08b5cd83 add loadelf in tmp/old.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
82 bzero(code,max-min);
e66a08b5cd83 add loadelf in tmp/old.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
83 printf("bzero %lx\n", (unsigned long)code) ;
e66a08b5cd83 add loadelf in tmp/old.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
84
e66a08b5cd83 add loadelf in tmp/old.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
85 long poffset = -1;
e66a08b5cd83 add loadelf in tmp/old.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
86 unsigned char *addr = code;
e66a08b5cd83 add loadelf in tmp/old.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
87 unsigned long size = 0;
e66a08b5cd83 add loadelf in tmp/old.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
88 for(int i=0; i< num; i++) {
e66a08b5cd83 add loadelf in tmp/old.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
89 if ((section[i].sh_flags & SHF_ALLOC) && (section[i].sh_type!=SHT_NOBITS)) {
e66a08b5cd83 add loadelf in tmp/old.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
90 printf("loading %lx %lx\n",
e66a08b5cd83 add loadelf in tmp/old.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
91 (unsigned long)(section[i].sh_addr),
e66a08b5cd83 add loadelf in tmp/old.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
92 (unsigned long)section[i].sh_size) ;
e66a08b5cd83 add loadelf in tmp/old.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
93 long offset = (unsigned long)(section[i].sh_addr-min)-
e66a08b5cd83 add loadelf in tmp/old.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
94 (unsigned long)section[i].sh_offset;
e66a08b5cd83 add loadelf in tmp/old.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
95 if (offset!=poffset) {
e66a08b5cd83 add loadelf in tmp/old.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
96 if (addr && size) {
e66a08b5cd83 add loadelf in tmp/old.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
97 printf(" reading %lx %lx\n",
e66a08b5cd83 add loadelf in tmp/old.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
98 (unsigned long)addr,
e66a08b5cd83 add loadelf in tmp/old.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
99 (unsigned long)size) ;
e66a08b5cd83 add loadelf in tmp/old.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
100 if (read_file(fd, addr, size)<0) return 0;
e66a08b5cd83 add loadelf in tmp/old.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
101 }
e66a08b5cd83 add loadelf in tmp/old.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
102 // there is a hole
e66a08b5cd83 add loadelf in tmp/old.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
103 printf(" hole %0x = %0x - %0x\n", offset-poffset, offset, poffset);
e66a08b5cd83 add loadelf in tmp/old.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
104 poffset = offset;
e66a08b5cd83 add loadelf in tmp/old.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
105 lseek(fd,section[i].sh_offset,SEEK_SET);
e66a08b5cd83 add loadelf in tmp/old.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
106 addr = code + (section[i].sh_addr-min);
e66a08b5cd83 add loadelf in tmp/old.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
107 }
e66a08b5cd83 add loadelf in tmp/old.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
108 unsigned char *last =
e66a08b5cd83 add loadelf in tmp/old.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
109 code + (section[i].sh_addr-min+section[i].sh_size);
e66a08b5cd83 add loadelf in tmp/old.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
110 size = last - addr;
e66a08b5cd83 add loadelf in tmp/old.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
111 }
e66a08b5cd83 add loadelf in tmp/old.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
112 }
e66a08b5cd83 add loadelf in tmp/old.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
113 printf(" last reading %lx %lx\n",
e66a08b5cd83 add loadelf in tmp/old.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
114 (unsigned long)addr,
e66a08b5cd83 add loadelf in tmp/old.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
115 (unsigned long)size) ;
e66a08b5cd83 add loadelf in tmp/old.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
116 if (read_file(fd, addr, size)<0) return 0;
e66a08b5cd83 add loadelf in tmp/old.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
117 return (memaddr)code;
e66a08b5cd83 add loadelf in tmp/old.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
118 }
e66a08b5cd83 add loadelf in tmp/old.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
119
e66a08b5cd83 add loadelf in tmp/old.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
120 static memaddr
e66a08b5cd83 add loadelf in tmp/old.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
121 load_elf(const char *name)
e66a08b5cd83 add loadelf in tmp/old.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
122 {
e66a08b5cd83 add loadelf in tmp/old.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
123 Elf32_Ehdr header;
e66a08b5cd83 add loadelf in tmp/old.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
124
e66a08b5cd83 add loadelf in tmp/old.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
125 int fd = open(name,O_RDONLY);
e66a08b5cd83 add loadelf in tmp/old.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
126 if (fd<0) return 0;
e66a08b5cd83 add loadelf in tmp/old.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
127 memaddr addr = load_elf1(fd);
e66a08b5cd83 add loadelf in tmp/old.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
128 close(fd);
e66a08b5cd83 add loadelf in tmp/old.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
129 return addr;
e66a08b5cd83 add loadelf in tmp/old.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
130 }
e66a08b5cd83 add loadelf in tmp/old.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
131
e66a08b5cd83 add loadelf in tmp/old.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
132 int
e66a08b5cd83 add loadelf in tmp/old.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
133 main(int ac, char *av[])
e66a08b5cd83 add loadelf in tmp/old.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
134 {
e66a08b5cd83 add loadelf in tmp/old.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
135 load_elf(av[1]);
e66a08b5cd83 add loadelf in tmp/old.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
136 return 0;
e66a08b5cd83 add loadelf in tmp/old.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
137 }
e66a08b5cd83 add loadelf in tmp/old.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
138
e66a08b5cd83 add loadelf in tmp/old.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
139