orl_return DealWithSymbolSection( orl_sec_handle shnd ) { orl_return error; error = ORLSymbolSecScan( shnd, CreateNamedLabel ); return( error ); }
orl_return PrintSymTable( orl_sec_handle orl_sec_hnd ) /****************************************************/ { if( dump.symbols ) { printf( "\nSymbol table\n" ); printf( "~~~~~~~~~~~~\n" ); ORLSymbolSecScan( orl_sec_hnd, &PrintSymbolInfo ); } return( ORL_OKAY ); }
/* * Collect all external symbols from an object file. Returns 0 on error. */ static int handle_obj_file( const char *filename, orl_handle o_hnd ) /******************************************************************/ { orl_file_handle o_fhnd; orl_file_format o_format; orl_file_type o_filetype; orl_sec_handle o_symtab; orl_return o_rc; int fileh; /*** Make ORL interested in the file ***/ fileh = open( filename, O_BINARY | O_RDONLY ); if( fileh == -1 ) { return( 0 ); } o_format = ORLFileIdentify( o_hnd, (void *)(pointer_int)fileh ); if( o_format == ORL_UNRECOGNIZED_FORMAT ) { close( fileh ); return( 0 ); } o_fhnd = ORLFileInit( o_hnd, (void *)(pointer_int)fileh, o_format ); if( o_fhnd == NULL ) { close( fileh ); return( 0 ); } o_filetype = ORLFileGetType( o_fhnd ); if( o_filetype != ORL_FILE_TYPE_OBJECT ) { close( fileh ); return( 0 ); } /*** Scan the file's symbol table ***/ o_symtab = ORLFileGetSymbolTable( o_fhnd ); if( o_symtab == NULL ) { close( fileh ); return( 0 ); } o_rc = ORLSymbolSecScan( o_symtab, &do_orl_symbol ); if( o_rc != ORL_OKAY ) { close( fileh ); return( 0 ); } o_rc = ORLFileFini( o_fhnd ); if( o_rc != ORL_OKAY ) { close( fileh ); return( 0 ); } close( fileh ); return( 1 ); }
bool ObjWalkSymList( obj_file *ofile, sym_file *sfile ) /*****************************************************/ { orl_sec_handle sym_sec_hnd; if( ofile->orl != NULL ) { sym_sec_hnd = ORLFileGetSymbolTable( ofile->orl ); if( sym_sec_hnd == NULL ) return( FALSE ); if( ORLSymbolSecScan( sym_sec_hnd, &CheckSymbol ) != ORL_OKAY ) { return( FALSE ); } } else { OMFWalkSymList( ofile, sfile ); } return( TRUE ); }