summaryrefslogtreecommitdiff
path: root/src/main.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/main.c')
-rw-r--r--src/main.c18
1 files changed, 16 insertions, 2 deletions
diff --git a/src/main.c b/src/main.c
index 3d72d5dc..bdc31999 100644
--- a/src/main.c
+++ b/src/main.c
@@ -117,10 +117,24 @@ main(int argc, char *argv[])
/* Set x86 as the architecture */
cur_arch = &x86_arch;
+ /* Set dbg as the object format */
+ cur_objfmt = find_objfmt("dbg");
+ if (!cur_objfmt) {
+ ErrorNow(_("unrecognized output format `%s'"), "dbg");
+ return EXIT_FAILURE;
+ }
+
+ /* Set NASM as the parser */
+ cur_parser = find_parser("nasm");
+ if (!cur_parser) {
+ ErrorNow(_("unrecognized parser `%s'"), "nasm");
+ return EXIT_FAILURE;
+ }
+
/* Get initial BITS setting from object format */
- x86_mode_bits = dbg_objfmt.default_mode_bits;
+ x86_mode_bits = cur_objfmt->default_mode_bits;
- sections = nasm_parser.do_parse(&nasm_parser, &dbg_objfmt, in);
+ sections = cur_parser->do_parse(cur_parser, in);
if (OutputAllErrorWarning() > 0) {
sections_delete(sections);