diff options
Diffstat (limited to 'modules/objfmts/rdf/rdf-objfmt.c')
-rw-r--r-- | modules/objfmts/rdf/rdf-objfmt.c | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/modules/objfmts/rdf/rdf-objfmt.c b/modules/objfmts/rdf/rdf-objfmt.c index 8b704a54..69ce08b5 100644 --- a/modules/objfmts/rdf/rdf-objfmt.c +++ b/modules/objfmts/rdf/rdf-objfmt.c @@ -811,10 +811,11 @@ rdf_objfmt_destroy(yasm_objfmt *objfmt) yasm_xfree(objfmt); } -static rdf_section_data * -rdf_objfmt_init_new_section(yasm_object *object, yasm_section *sect, - const char *sectname, unsigned long line) +static void +rdf_objfmt_init_new_section(yasm_section *sect, unsigned long line) { + yasm_object *object = yasm_section_get_object(sect); + const char *sectname = yasm_section_get_name(sect); yasm_objfmt_rdf *objfmt_rdf = (yasm_objfmt_rdf *)object->objfmt; rdf_section_data *data; yasm_symrec *sym; @@ -830,7 +831,6 @@ rdf_objfmt_init_new_section(yasm_object *object, yasm_section *sect, sym = yasm_symtab_define_label(object->symtab, sectname, yasm_section_bcs_first(sect), 1, line); data->sym = sym; - return data; } static yasm_section * @@ -842,7 +842,7 @@ rdf_objfmt_add_default_section(yasm_object *object) retval = yasm_object_get_general(object, ".text", 0, 1, 0, &isnew, 0); if (isnew) { - rsd = rdf_objfmt_init_new_section(object, retval, ".text", 0); + rsd = yasm_section_get_data(retval, &rdf_section_data_cb); rsd->type = RDF_SECT_CODE; rsd->reserved = 0; yasm_section_set_default(retval, 1); @@ -950,10 +950,7 @@ rdf_objfmt_section_switch(yasm_object *object, yasm_valparamhead *valparams, retval = yasm_object_get_general(object, sectname, 0, 1, data.type == RDF_SECT_BSS, &isnew, line); - if (isnew) - rsd = rdf_objfmt_init_new_section(object, retval, sectname, line); - else - rsd = yasm_section_get_data(retval, &rdf_section_data_cb); + rsd = yasm_section_get_data(retval, &rdf_section_data_cb); if (isnew || yasm_section_is_default(retval)) { yasm_section_set_default(retval, 0); @@ -1088,6 +1085,7 @@ yasm_objfmt_module yasm_rdf_LTX_objfmt = { rdf_objfmt_output, rdf_objfmt_destroy, rdf_objfmt_add_default_section, + rdf_objfmt_init_new_section, rdf_objfmt_section_switch, rdf_objfmt_get_special_sym }; |