Beispiel #1
0
return_val DumpASMSection( section_ptr section, unsigned_8 *contents, dis_sec_size size, unsigned pass )
{
    hash_data           *h_data;
    label_list          sec_label_list;
    label_entry         l_entry;
    ref_list            sec_ref_list;
    ref_entry           r_entry;
    return_val          err;
    hash_key            h_key;

    h_key.u.sec_handle = section->shnd;
    h_data = HashTableQuery( HandleToLabelListTable, h_key );
    if( h_data != NULL ) {
        sec_label_list = h_data->u.sec_label_list;
        l_entry = sec_label_list->first;
    } else {
        sec_label_list = NULL;
        l_entry = NULL;
    }

    r_entry = NULL;
    h_data = HashTableQuery( HandleToRefListTable, h_key );
    if( h_data != NULL ) {
        sec_ref_list = h_data->u.sec_ref_list;
        if( sec_ref_list != NULL ) {
            r_entry = sec_ref_list->first;
        }
    }

    if( pass == 1 ) {
        DoPass1Relocs( contents, r_entry, 0, size );
        return( RC_OKAY );
    }

    if( size == 0 ) {
        if( IsMasmOutput() ) {
            PrintHeader( section );
            dumpAsmLabel( l_entry, section, 0, 0, NULL, NULL );
            PrintTail( section );
        }
        return( RC_OKAY );
    }

    PrintHeader( section );
    err = DumpASMDataFromSection( contents, 0, size, &l_entry, &r_entry, section );
    if( size > 0 ) {
        l_entry = dumpAsmLabel( l_entry, section, size, size, NULL, NULL );
    }
    BufferConcatNL();
    BufferPrint();
    if( err == RC_OKAY ) {
        PrintTail( section );
    }
    return( err );
}
Beispiel #2
0
return_val DumpASMSection( section_ptr sec, unsigned_8 *contents, orl_sec_size size, unsigned pass )
{
    hash_data           *data_ptr;
    label_list          sec_label_list;
    label_entry         l_entry;
    ref_list            sec_ref_list;
    ref_entry           r_entry;
    return_val          err;

    data_ptr = HashTableQuery( HandleToLabelListTable, (hash_value) sec->shnd );
    if( data_ptr ) {
        sec_label_list = (label_list) *data_ptr;
        l_entry = sec_label_list->first;
    } else {
        sec_label_list = NULL;
        l_entry = NULL;
    }

    r_entry = NULL;
    data_ptr = HashTableQuery( HandleToRefListTable, (hash_value) sec->shnd );
    if( data_ptr ) {
        sec_ref_list = (ref_list) *data_ptr;
        if( sec_ref_list != NULL ) {
            r_entry = sec_ref_list->first;
        }
    }

    if( pass == 1 ) {
        DoPass1Relocs( contents, r_entry, 0, size );
        return( RC_OKAY );
    }

    if( size == 0 ) {
        if( IsMasmOutput() ) {
            PrintHeader( sec );
            dumpAsmLabel( l_entry, sec, 0, 0, NULL, NULL );
            PrintTail( sec );
        }
        return( RC_OKAY );
    }

    PrintHeader( sec );
    err = DumpASMDataFromSection( contents, 0, size, &l_entry, &r_entry, sec );
    if( size > 0 ) {
        l_entry = dumpAsmLabel( l_entry, sec, size, size, NULL, NULL );
    }
    BufferConcatNL();
    BufferPrint();
    if( err == RC_OKAY ) {
        PrintTail( sec );
    }
    return( err );
}
Beispiel #3
0
static void processDataInCode( section_ptr sec, unsigned_8 *contents, struct pass2 *data,
                               orl_sec_size size, label_entry *l_entry )
{
    orl_sec_size        offset;

    offset = data->loop + size;
    if( DFormat & DFF_ASM ) {
        DumpASMDataFromSection( contents, data->loop, offset, l_entry,
                                &(data->r_entry), sec );
        BufferPrint();
    } else {
        DumpDataFromSection( contents, data->loop, offset, l_entry,
                             &(data->r_entry), sec );
    }
    while( data->r_entry && ( data->r_entry->offset < offset ) ) {
        data->r_entry = data->r_entry->next;
    }
    data->loop = offset;
}