Example #1
0
void OvlPass2( void )
/**************************/
{
    if( FmtData.type & MK_OVERLAYS ) {
        EmitOvlVectors();
        WalkAllOvl( PSection );
    }
}
Example #2
0
void NumberSections( void )
/********************************/
{
    if( ( FmtData.type & MK_OVERLAYS ) && FmtData.u.dos.distribute ) {
        _ChkAlloc( SectOvlTab, sizeof( section * ) * ( OvlNum + 1 ) );
        SectOvlTab[0] = Root;
    }
    OvlNum = 1;
    WalkAllOvl( &NumASect );
}
Example #3
0
static unsigned long WriteDOSData( unsigned_32 mz_hdr_size )
/**********************************************************/
/* copy code from extra memory to loadfile */
{
    group_entry         *group;
    SECTION             *sect;
    unsigned long       header_size;
    outfilelist         *fnode;
    bool                repos;
    unsigned long       root_size;

    DEBUG(( DBG_BASE, "Writing data" ));
    OrderGroups( CompareDosSegments );
    CurrSect = Root;        // needed for WriteInfo.
    header_size = WriteDOSRootRelocs( mz_hdr_size );

    Root->u.file_loc = header_size;
    if( Root->areas != NULL ) {
        Root->outfile->file_loc = header_size + Root->size;
        WalkAllOvl( &AssignFileLocs );
        EmitOvlTable();
    }

// keep track of positions within the file.
    for( fnode = OutFiles; fnode != NULL; fnode = fnode->next ) {
        fnode->file_loc = 0;
    }
    Root->outfile->file_loc = Root->u.file_loc;
    Root->sect_addr = Groups->grp_addr;

/* write groups and relocations */
    root_size = 0;
    for( group = Groups; group != NULL; ) {
        sect = group->section;
        CurrSect = sect;
        fnode = sect->outfile;
        repos = WriteDOSGroup( group );
        group = group->next_group;
        if( ( group == NULL ) || ( sect != group->section ) ) {
            if( sect == Root ) {
                root_size = fnode->file_loc;
            } else {
                WriteDOSSectRelocs( sect, repos );
            }
        }
        if( repos ) {
            SeekLoad( fnode->file_loc );
        }
    }
    return( root_size );
}
Example #4
0
void FillOutFilePtrs( void )
/*********************************/
{
    WalkAllOvl( FillOutPtr );
}