Changeset 1517
- Timestamp:
- 12/30/11 13:39:02 (17 months ago)
- Location:
- branches/reyalp-flt
- Files:
-
- 1 added
- 8 edited
-
core/gui.c (modified) (2 diffs)
-
core/gui_menu.c (modified) (1 diff)
-
core/modules/Makefile (modified) (1 diff)
-
tools/elf2flt/elfflt.c (modified) (4 diffs)
-
tools/elf2flt/elfflt.h (modified) (1 diff)
-
tools/elf2flt/main.c (modified) (4 diffs)
-
tools/elf2flt/myio.c (modified) (1 diff)
-
tools/elf2flt/myio.h (modified) (1 diff)
-
tools/elf2flt/stoplist.txt (added)
Legend:
- Unmodified
- Added
- Removed
-
branches/reyalp-flt/core/gui.c
r1516 r1517 152 152 static void gui_show_build_info(int arg); 153 153 static void gui_show_memory_info(int arg); 154 staticvoid gui_modules_menu_load();154 void gui_modules_menu_load(); 155 155 156 156 #ifdef OPT_DEBUGGING … … 1615 1615 gui_splash = (conf.splash_show)?SPLASH_TIME:0; 1616 1616 1617 gui_modules_menu_load();1618 user_menu_restore();1619 1617 gui_lang_init(); 1620 1618 draw_init(); -
branches/reyalp-flt/core/gui_menu.c
r1514 r1517 47 47 //------------------------------------------------------------------- 48 48 void gui_menu_init(CMenu *menu_ptr) { 49 50 static char first_call=1; 51 49 52 if (menu_ptr) { 53 if ( first_call ) { 54 extern void gui_modules_menu_load(); 55 extern void user_menu_restore(); 56 57 gui_modules_menu_load(); 58 user_menu_restore(); 59 first_call=0; 60 } 61 50 62 if (conf.menu_select_first_entry) 51 63 gui_menu_set_curr_menu(menu_ptr, 0, 0); -
branches/reyalp-flt/core/modules/Makefile
r1512 r1517 43 43 # arm-elf-objdump.exe -d -r -x $< >$<.dumpobj 44 44 # $(topdir)/tools/elf2flt/elf2flt$(EXE) $< $@ -e -f -h -r -s -iexportlist.txt >$@.dump 45 $(topdir)/tools/elf2flt/elf2flt$(EXE) $< $@ -iexportlist.txt > $(DEVNULL)45 $(topdir)/tools/elf2flt/elf2flt$(EXE) $< $@ -iexportlist.txt -!$(topdir)/tools/elf2flt/stoplist.txt > $(DEVNULL) 46 46 47 47 calend.elf: simple_module.o ../gui_calendar.o -
branches/reyalp-flt/tools/elf2flt/elfflt.c
r1510 r1517 53 53 54 54 char* flag_sym_display=0; // buffer of flags. [symidx]=0 not_showed_yet, 1 already_shown 55 int flag_unsafe_sym=0; // =1 if one of imported symbol is from stoplist 55 56 56 57 /*---------------------------------------------------------------------------*/ … … 198 199 continue; 199 200 } 201 if ( stoplist_check(name) ) 202 { flag_unsafe_sym=1; } 200 203 201 204 ret = apply_import( base_sect, &rela, importidx, &s, relidx); … … 627 630 add_div0_arm(); 628 631 632 flag_unsafe_sym = 0; 633 629 634 // Do relocations 630 635 ret = relocate_section( &text); … … 637 642 if(ret != ELFFLT_OK) 638 643 return ret; 644 645 if ( flag_unsafe_sym ) 646 return ELFFLT_UNSAFE_SYMBOL; 639 647 640 648 flat->import_start = flat->reloc_start+flat_reloc_count*sizeof(reloc_record_t); -
branches/reyalp-flt/tools/elf2flt/elfflt.h
r1510 r1517 18 18 #define ELFFLT_INPUT_ERROR 10 19 19 #define ELFFLT_OUTPUT_ERROR 11 20 #define ELFFLT_UNSAFE_SYMBOL 12 20 21 21 22 -
branches/reyalp-flt/tools/elf2flt/main.c
r1510 r1517 25 25 printf("elfflt.exe filename.elf filename.flt [-vefrhsS] [-iIMPORTFILE.TXT]\n"); 26 26 printf(" -iPATH/TO/exportlist.txt for list of imported symbols\n"); 27 printf(" -!PATH/TO/stoplist.txt for list of unsafe symbols\n"); 27 28 printf(" -e dump elf\n -S show elf sections\n -f dump flat\n -r show relocations\n -h show flat headers\n -s dump elf symbols\n -v verbose"); 28 29 return 1; … … 33 34 34 35 char* filename_import =0; 36 char* filename_stoplist =0; 35 37 36 38 int i; … … 48 50 case 'v': FLAG_VERBOSE = 1; break; 49 51 case 'i': filename_import = argv[i]+2; break; 52 case '!': filename_stoplist = argv[i]+2; break; 50 53 } 51 54 } … … 62 65 63 66 load_import(filename_import); 67 load_stoplist(filename_stoplist); 64 68 65 69 int err = elfloader_load(filename_elf, filename_flt); -
branches/reyalp-flt/tools/elf2flt/myio.c
r1510 r1517 199 199 } 200 200 201 202 //========================================== 203 204 struct StopListRecord { 205 char* symbol; 206 char* warning; 207 void* next; 208 }; 209 210 211 char *stoplist_buf=0; 212 struct StopListRecord* stoplisthead=0; 213 214 215 int load_stoplist(char* stopfile) 216 { 217 if ( !stopfile ) 218 return 0; 219 220 int fd=open(stopfile, O_RDONLY|O_BINARY, 0777); 221 222 if ( fd <=0 ) { 223 PRINTERR(stderr,"No stoplist file '%s' found\n",stopfile); 224 return 0; 225 } 226 int stoplistfilesize = lseek(fd,0,SEEK_END); 227 if ( FLAG_VERBOSE ) 228 printf("Stoplist file '%s' size=%d\n",stopfile, stoplistfilesize); 229 230 stoplist_buf=malloc(stoplistfilesize+1); 231 if (!stoplist_buf) return 0; 232 233 int now=0, loaded =0; 234 if (lseek(fd, 0, SEEK_SET) != 0) return 0; 235 do 236 { 237 now = read(fd, stoplist_buf+loaded, stoplistfilesize-loaded); 238 loaded+=now; 239 } while (loaded<stoplistfilesize && now); 240 241 stoplist_buf[loaded]=0; 242 close(fd); 243 244 if ( loaded != stoplistfilesize ) 245 return -loaded; 246 247 // Parse 248 struct StopListRecord record; 249 char* sym=0, *finsym=0; 250 char* cur=stoplist_buf; 251 252 for ( ; cur<(stoplist_buf+stoplistfilesize); ) { 253 for(;*cur==' '; cur++); // skip spaces 254 255 sym=cur; 256 for(;*cur && *cur!=9 && *cur!=' ' && *cur!=0x0a; cur++); 257 if ( cur==sym ) { 258 for(;*cur && *cur!=10; cur++); 259 if ( *cur==10) {cur++;} 260 continue; 261 } 262 263 record.symbol = sym; 264 record.warning = "Error: unsafe symbol used. Please check stoplist"; 265 finsym=cur; 266 for(;*cur && *cur!=9 && *cur!=0x0a; cur++); // find \t 267 268 if ( *cur==0 ) break; 269 if ( *cur==9 ) { 270 cur++; 271 record.warning=cur; 272 } 273 274 for(;*cur && *cur!=10; cur++); // find eol 275 if ( *cur==0x0a && cur>stoplist_buf && *(cur-1)==0x0d) 276 *(cur-1)=0; 277 278 if (cur==record.warning) 279 record.warning = "Error: unsafe symbol used. Please check stoplist"; 280 281 record.next=stoplisthead; 282 stoplisthead = malloc (sizeof(struct StopListRecord)); 283 memcpy( stoplisthead, &record, sizeof(struct StopListRecord)); 284 285 if ( *cur!=0 ) { *cur=0; cur++;} 286 *finsym = 0; 287 288 if ( FLAG_VERBOSE ) 289 printf("Stop record: %s => %s\n",record.symbol, record.warning); 290 } 291 292 return loaded; 293 } 294 295 //return: 1 - found in stoplist, 0 - not found 296 int stoplist_check(char *sym) 297 { 298 struct StopListRecord *cur; 299 300 for ( cur = stoplisthead; cur; cur = cur->next ) { 301 if ( !cur->symbol ) 302 continue; 303 if ( !strcmp( sym, cur->symbol) ) { 304 PRINTERR(stderr,"%s\n",cur->warning); 305 cur->symbol = 0; // mark that this symbol is already warned 306 return 1; 307 } 308 } 309 return 0; 310 } 311 312 201 313 //========================================== 202 314 void raise_error() -
branches/reyalp-flt/tools/elf2flt/myio.h
r1510 r1517 21 21 char* get_import_symbol( unsigned symidx ); 22 22 23 int load_stoplist(char* importfile); 24 int stoplist_check(char *sym); //1 - found in stoplist, 0- not found 25 23 26 extern int FLAG_DUMP_SOURCE; 24 27 extern int FLAG_DUMP_SYMBOLS;
Note: See TracChangeset
for help on using the changeset viewer.