/*----------------------------------------------------------------------
----------------------------------------------------------------------*/
+LIBGOBLIN_BINFO_EXTERN
+int
+ BinInfo_SearchNextSlave(
+ int i_bid_self,
+ int i_bid_now )
+{
+ LibGoblin_BinaryInfo *p_binfo_self;
+ LibGoblin_BinaryInfo *p_binfo_now;
+ LibGoblin_BinaryInfo *p_binfo_ret = NULL;
+
+ if(( 0 > i_bid_self ) || ( 0 > i_bid_now )) { return -0x01; }
+
+ p_binfo_self = BINFO( i_bid_self );
+ p_binfo_now = BINFO( i_bid_now );
+
+ while( -1 != p_binfo_now->i_binfo_next ) {
+ p_binfo_now = BINFO( p_binfo_now->i_binfo_next );
+ if( p_binfo_self->i_id == p_binfo_now->i_binfo_parent ) {
+ p_binfo_ret = p_binfo_now;
+ break;
+ }
+ }
+
+ return ((NULL != p_binfo_ret) ? p_binfo_ret->i_id : -0x01 );
+}
+
+
+/*----------------------------------------------------------------------
+----------------------------------------------------------------------*/
int
BinInfo_AppendChain(
LibGoblin_BinaryInfo *p_binfo_now )
if( dw_vermax >= dw_symbols )
{ goto goto_ELF64_DynSym_GenerateDynSymVersion_post; }
- /*
+/*
printf(" [Verneed] vn_version= %d, vn_cnt= %d, vn_file= %s, binfo= %d\n",
p_verneed->vn_version, p_verneed->vn_cnt, (pb_dynstr + p_verneed->vn_file),
i_bid );
printf(" [VernAux] vna_name= %s, vna_other= %d, \n\n",
(pb_dynstr + p_vernaux->vna_name), p_vernaux->vna_other);
- */
+*/
dw_next = p_verneed->vn_next;
} while( 0 < dw_next );
//Byte *pb_now;
int i_bid;
DWord dw_cnt;
+ DWord dw_sym;
DWord dw_vermax;
DWord dw_symbols;
Word *pw_gnuver;
Elf64_Shdr *p_shdr;
Elf64_Sym *p_sym;
DynSym_Version *p_version;
+ DynSym_Version *p_vernow;
LibGoblin_SectionInfo *psec_gnuver = NULL;
LibGoblin_SectionInfo *psec_dynsym;
LibGoblin_SectionInfo *psec_dynstr;
p_pginfo = ProgInfo_GetProgInfo( p_binfo->i_pginfo );
assert( NULL != p_pginfo );
+ // Loop. ---
p_sym = (Elf64_Sym *)psec_dynsym->pb_data;
- for( dw_cnt = 0; dw_cnt < dw_symbols; dw_cnt++, p_sym++, pw_gnuver++ ) {
+ for( dw_sym = 0; dw_sym < dw_symbols; dw_sym++, p_sym++, pw_gnuver++ ) {
// NODATA symbol.
if(( 0x00000000 == p_sym->st_value )
continue;
}
-// 2019/02/24 -- TODO
- // Check DynSym Type
- // Get libname from p_version struct
- // Search Dynamic Function ObjInfo
+ // Search DynSym_Version ---
+ i_bid = p_binfo->i_id;
+ if( 1 < *pw_gnuver ) {
+ p_vernow = p_version;
+ for( dw_cnt = 0; dw_cnt < dw_vermax; dw_cnt++, p_vernow++ ) {
+ if( *pw_gnuver == p_vernow->dw_other ) {
+ i_bid = p_vernow->i_binfo_id;
+ break;
+ }
+ }
+ }
+ else {
+ i_bid = BinInfo_SearchNextSlave( p_binfo->i_id, i_bid );
+ }
+/*
+ printf(" debug: [%2ld] %s %ld\n", dw_sym, (char *)(pb_dynstr + p_sym->st_name),
+ *pw_gnuver);
+*/
+
+ do {
+ // Check Hash
+
+ i_bid = BinInfo_SearchNextSlave( p_binfo->i_id, i_bid );
+ } while( -0x01 != i_bid );
+
+
+ // 2019/02/24 -- TODO
+ // Check DynSym Type
+ // Get libname from p_version struct
+ // Search Dynamic Function ObjInfo
/*
// st_value - Symbol value.