libyasm
Data Structures | Functions
objfmt.h File Reference

YASM object format module interface. More...

Go to the source code of this file.

Data Structures

struct  yasm_objfmt_module
 Object format module interface. More...
 

Functions

yasm_objfmtyasm_objfmt_create (const yasm_objfmt_module *module, yasm_object *object)
 Create object format. More...
 
void yasm_objfmt_output (yasm_object *object, FILE *f, int all_syms, yasm_errwarns *errwarns)
 Write out (post-optimized) sections to the object file. More...
 
void yasm_objfmt_destroy (yasm_objfmt *objfmt)
 Cleans up any allocated object format memory. More...
 
yasm_sectionyasm_objfmt_add_default_section (yasm_object *object)
 Add a default section to an object. More...
 
void yasm_objfmt_init_new_section (yasm_object *object, unsigned long line)
 Initialize the object-format specific portion of a section. More...
 
yasm_sectionyasm_objfmt_section_switch (yasm_object *object, yasm_valparamhead *valparams, yasm_valparamhead *objext_valparams, unsigned long line)
 Switch object file sections. More...
 
yasm_symrecyasm_objfmt_get_special_sym (yasm_object *object, const char *name, const char *parser)
 Get a special symbol. More...
 

Detailed Description

YASM object format module interface.

Definition in file objfmt.h.

Function Documentation

yasm_section* yasm_objfmt_add_default_section ( yasm_object object)

Add a default section to an object.

Parameters
objectobject
Returns
Default section.
yasm_objfmt* yasm_objfmt_create ( const yasm_objfmt_module module,
yasm_object object 
)

Create object format.

Parameters
moduleobject format module
objectobject
Returns
NULL if architecture/machine combination not supported.
void yasm_objfmt_destroy ( yasm_objfmt objfmt)

Cleans up any allocated object format memory.

Parameters
objfmtobject format
yasm_symrec* yasm_objfmt_get_special_sym ( yasm_object object,
const char *  name,
const char *  parser 
)

Get a special symbol.

Special symbols are generally used to generate special relocation types via the WRT mechanism.

Parameters
objectobject
namesymbol name (not including any parser-specific prefix)
parserparser keyword
Returns
NULL if unrecognized, otherwise special symbol.
void yasm_objfmt_init_new_section ( yasm_object object,
unsigned long  line 
)

Initialize the object-format specific portion of a section.

Called by yasm_object_get_general(); in general should not be directly called.

Parameters
sectionsection
linevirtual line (from yasm_linemap)
void yasm_objfmt_output ( yasm_object object,
FILE *  f,
int  all_syms,
yasm_errwarns errwarns 
)

Write out (post-optimized) sections to the object file.

This function may call yasm_symrec_* functions as necessary (including yasm_symrec_traverse()) to retrieve symbolic information.

Parameters
objectobject
foutput object file
all_symsif nonzero, all symbols should be included in the object file
errwarnserror/warning set
Note
Errors and warnings are stored into errwarns.
yasm_section* yasm_objfmt_section_switch ( yasm_object object,
yasm_valparamhead valparams,
yasm_valparamhead objext_valparams,
unsigned long  line 
)

Switch object file sections.

The first val of the valparams should be the section name. Calls yasm_object_get_general() to actually get the section.

Parameters
objectobject
valparamsvalue/parameters
objext_valparamsobject format-specific value/parameters
linevirtual line (from yasm_linemap)
Returns
NULL on error, otherwise new section.