}
/* Initialize the object format */
- cur_objfmt->initialize(in_filename, obj_filename);
+ if (cur_objfmt->initialize)
+ cur_objfmt->initialize(in_filename, obj_filename);
/* Set NASM as the parser */
cur_parser = find_parser("nasm");
{
sections_delete(sections);
symrec_delete_all();
- if (cur_objfmt)
+ if (cur_objfmt && cur_objfmt->cleanup)
cur_objfmt->cleanup();
line_shutdown();
/* Initializes object output. Must be called before any other object
* format functions. Should NOT open the object file; the filenames are
* provided solely for informational purposes.
+ * May be NULL if not needed by the object format.
*/
void (*initialize) (const char *in_filename, const char *obj_filename);
*/
void (*output) (FILE *f, sectionhead *sections);
- /* Cleans up anything allocated by initialize. */
+ /* Cleans up anything allocated by initialize.
+ * May be NULL if not needed by the object format.
+ */
void (*cleanup) (void);
/* Switch object file sections. The first val of the valparams should
}
/* Initialize the object format */
- cur_objfmt->initialize(in_filename, obj_filename);
+ if (cur_objfmt->initialize)
+ cur_objfmt->initialize(in_filename, obj_filename);
/* Set NASM as the parser */
cur_parser = find_parser("nasm");
{
sections_delete(sections);
symrec_delete_all();
- if (cur_objfmt)
+ if (cur_objfmt && cur_objfmt->cleanup)
cur_objfmt->cleanup();
line_shutdown();
/* Initializes object output. Must be called before any other object
* format functions. Should NOT open the object file; the filenames are
* provided solely for informational purposes.
+ * May be NULL if not needed by the object format.
*/
void (*initialize) (const char *in_filename, const char *obj_filename);
*/
void (*output) (FILE *f, sectionhead *sections);
- /* Cleans up anything allocated by initialize. */
+ /* Cleans up anything allocated by initialize.
+ * May be NULL if not needed by the object format.
+ */
void (*cleanup) (void);
/* Switch object file sections. The first val of the valparams should