diff 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
line wrap: on
line diff
--- a/objgrep/main.c	Fri Jul 04 01:01:39 2014 +0000
+++ b/objgrep/main.c	Fri Jul 04 01:45:03 2014 +0000
@@ -34,6 +34,10 @@
 			argv[2], objfilename);
 		exit(2);
 	}
+	if (!grep_section->size) {
+		printf("%s:%s is empty\n", objfilename, grep_section->name);
+		exit(1);
+	}
 	get_int_symbol_table();
 	prepare_pattern();
 	binfilename = argv[3];