comparison objgrep/main.c @ 169:466b3926019c

objgrep: weed out empty source sections
author Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
date Fri, 04 Jul 2014 01:45:03 +0000
parents c25367bb7656
children 13a9ce1590fc
comparison
equal deleted inserted replaced
168:ed1a06bf525d 169:466b3926019c
32 if (!grep_section) { 32 if (!grep_section) {
33 fprintf(stderr, "no section named \"%s\" found in %s\n", 33 fprintf(stderr, "no section named \"%s\" found in %s\n",
34 argv[2], objfilename); 34 argv[2], objfilename);
35 exit(2); 35 exit(2);
36 } 36 }
37 if (!grep_section->size) {
38 printf("%s:%s is empty\n", objfilename, grep_section->name);
39 exit(1);
40 }
37 get_int_symbol_table(); 41 get_int_symbol_table();
38 prepare_pattern(); 42 prepare_pattern();
39 binfilename = argv[3]; 43 binfilename = argv[3];
40 mmap_binfile(); 44 mmap_binfile();
41 if (!do_grep()) { 45 if (!do_grep()) {