LibGoblin_BinaryInfo *p_binfo )
{
char *pstr_symname;
+ char *pstr_vername;
Byte *pb_dynstr;
int i_bid;
int i_result;
DWord dw_sym;
DWord dw_vermax;
DWord dw_symbols;
- Word *pw_gnuver;
+ Word w_gnuver = 0;
+ Word *pw_gnuver = NULL;
Elf64_Shdr *p_shdr;
Elf64_Sym *p_sym;
DynSym_Version *p_version;
p_pginfo = ProgInfo_GetProgInfo( p_binfo->i_pginfo );
assert( NULL != p_pginfo );
+
// Loop. ---
+ pstr_vername = NULL;
p_sym = (Elf64_Sym *)psec_dynsym->pb_data;
- for( dw_sym = 0; dw_sym < dw_symbols; dw_sym++, p_sym++, pw_gnuver++ ) {
+ //for( dw_sym = 0; dw_sym < dw_symbols; dw_sym++, p_sym++, pw_gnuver++ ) {
+ for( dw_sym = 0; dw_sym < dw_symbols; dw_sym++, p_sym++ ) {
+ if( NULL != pw_gnuver ) { w_gnuver = *pw_gnuver++; }
// NODATA symbol.
if(( 0x00000000 == p_sym->st_value )
// Search DynSym_Version ---
i_bid = p_binfo->i_id;
- if( 1 < *pw_gnuver ) {
+ if( 1 < w_gnuver ) {
p_vernow = p_version;
for( dw_cnt = 0; dw_cnt < dw_vermax; dw_cnt++, p_vernow++ ) {
- if( *pw_gnuver == p_vernow->dw_other ) {
+ if( w_gnuver == p_vernow->dw_other ) {
i_bid = p_vernow->i_binfo_id;
+ pstr_vername = p_vernow->pstr_vername;
break;
}
}
p_binlib = BinaryInfo_GetBinInfo( i_bid );
assert( NULL != p_binlib );
- i_result = ELF64_GnuHash_SearchDynSym( p_binlib, pstr_symname );
+ i_result = ELF64_GnuHash_SearchDynSym( p_binlib, pstr_symname, pstr_vername );
if( 0 <= i_result ) {
break;
}
i_bid = BinInfo_SearchNextSlave( p_binfo->i_id, i_bid );
}
- printf(" debug: [%2ld] %s (%s)\n", dw_sym, pstr_symname, p_binlib->str_filename );
- printf(" %d\n", i_result );
+ printf(" debug: [%2ld] %s (%s) = %d\n", dw_sym, pstr_symname, p_binlib->str_filename, i_result );
// 2019/03/05 -- TODO