#define DRD64_SRC_LIBGOBLIN_ELF_DYNSYM
#include"drd64_libgoblin.h"
+typedef struct {
+ Byte *pb_verneed;
+ int i_binfo_id;
+} DynSym_LibInfo;
+
/*----------------------------------------------------------------------
----------------------------------------------------------------------*/
ELF64_DynSym_ReadSection(
LibGoblin_BinaryInfo *p_binfo )
{
+ Byte *pb_gnuver_r;
+ Byte *pb_dynstr;
+ DWord dw_cnt;
+ DWord dw_symbols;
+ Elf64_Shdr *p_shdr;
+ Elf64_Verneed *p_verneed;
+ LibGoblin_SectionInfo *psec_gnuver_r;
+ LibGoblin_SectionInfo *psec_dynsym;
+ LibGoblin_SectionInfo *psec_dynstr;
+
+
+ // Check exist .dynsym section ---
+ psec_dynsym = LibGoblin_Section_GetSectionInfo_fid(
+ p_binfo, LIBGOBLIN_SECTION_ID_DYNSYM );
+ if( NULL == psec_dynsym ) {
+ return 0x00;
+ }
+ p_shdr = (Elf64_Shdr *)(psec_dynsym->pb_sechdr);
+ assert( NULL != p_shdr );
+
+ dw_symbols = (DWord)p_shdr->sh_size / (DWord)p_shdr->sh_entsize;
+
+ psec_dynstr = LibGoblin_Section_GetSectionInfo_fid(
+ p_binfo, LIBGOBLIN_SECTION_ID_DYNSTR );
+ if( NULL == psec_dynstr ) {
+ return 0x00;
+ }
+ pb_dynstr = psec_dynstr->pb_data;
+
+ // Read .gnu.version_r for Temp-Data
+ // Read Pass1 - Check max vna_other value.
+ psec_gnuver_r = LibGoblin_Section_GetSectionInfo_fid(
+ p_binfo, LIBGOBLIN_SECTION_ID_GNU_VERSION_R );
+ if( NULL == psec_gnuver_r )
+ { goto goto_ELF64_DynSym_ReadSection_phase2; }
+ pb_gnuver_r = psec_gnuver_r->pb_data;
+
+ p_verneed = (Elf64_Verneed *)pb_gnuver_r;
+
+ printf(" [Verneed] vn_version= %d, vn_cnt= %d, vn_file= %s\n",
+ p_verneed->vn_version, p_verneed->vn_cnt, (pb_dynstr + p_verneed->vn_file) );
+ printf(" [Verneed] vn_aux= %d, vn_next= %d\n\n",
+ p_verneed->vn_aux, p_verneed->vn_next );
+
+ p_verneed = (Elf64_Verneed *)(pb_gnuver_r + p_verneed->vn_next);
+ printf(" [Verneed] vn_version= %d, vn_cnt= %d, vn_file= %s\n",
+ p_verneed->vn_version, p_verneed->vn_cnt, (pb_dynstr + p_verneed->vn_file) );
+ printf(" [Verneed] vn_aux= %d, vn_next= %d\n\n",
+ p_verneed->vn_aux, p_verneed->vn_next );
+
+
+/*
+ for( dw_cnt = 0; dw_cnt < dw_symbols; dw_cnt++ ) {
+
+ }
+*/
+
+ // Read Pass2 - Read Data for Temp-Data
+
+ // Read .dymsym & .gnu.version for ObjectInfo
+
+goto_ELF64_DynSym_ReadSection_phase2:
+
/*
Byte *pb_symtab;
Byte *pb_strtab;