OSDN Git Service

2019/03/28(Thr) 21:05
authorKoine Yuusuke(koinec) <koinec@users.osdn.me>
Thu, 28 Mar 2019 12:05:40 +0000 (21:05 +0900)
committerKoine Yuusuke(koinec) <koinec@users.osdn.me>
Thu, 28 Mar 2019 12:05:40 +0000 (21:05 +0900)
 (LibGoblin)
  * Support loadbase ptr. for DynSym / GnuHash

libgoblin/drd64_libgoblin_elf.c
libgoblin/drd64_libgoblin_elf_dynsym.c
libgoblin/drd64_libgoblin_elf_hash.c
libgoblin/drd64_libgoblin_elf_section.c

index fd00ff1..80d70c1 100644 (file)
@@ -192,7 +192,7 @@ int
                return i_result;
        }
 
-       //Debug_ObjectInfo_Print_AllGroupLink( p_pginfo, 0xff );
+       Debug_ObjectInfo_Print_AllGroupLink( p_pginfo, 0xff );
 
 
        /* Analyze Dwarf-Debug Info. */
index fe97b10..1ba8478 100644 (file)
@@ -147,8 +147,6 @@ int
                b_binding       = 255;
                i_symindex      = -0x01;
                while( -0x01 != i_bid )         {
-printf("debug: %s: startbid=%d\n", pstr_symname, i_bid );
-
                        p_binlib        = BinaryInfo_GetBinInfo( i_bid );
                        assert( NULL != p_binlib );
 
index 3fb129e..de55916 100644 (file)
@@ -82,13 +82,16 @@ int
        LibGoblin_SectionInfo   *psec_gnuver;
        LibGoblin_SectionInfo   *psec_dynsym;
        LibGoblin_SectionInfo   *psec_dynstr;
+       LibGoblin_BinaryFile    *p_bfile;
        Elf64_Sym                               *p_dynsym;
        Elf64_Sym                               *p_symnow;              //const Sym  *sym;
 
+       p_bfile = BinaryFile_GetBinaryFile( p_binfo->i_binfile );
+       assert( p_bfile );
 
        // ----------------
-       psec_dynsym     = Section_GetSectionInfo(
-                                                       p_binfo, LIBGOBLIN_SECTION_ID_DYNSYM );
+       psec_dynsym     = Section_GetSectionInfo_fromBinaryFile(
+                                                       p_bfile, LIBGOBLIN_SECTION_ID_DYNSYM);
        assert( NULL != psec_dynsym );
        if( NULL == psec_dynsym->pb_data )      {
                return -0x01;
@@ -97,8 +100,8 @@ int
        p_dynsym        = (Elf64_Sym *)pb_dynsym;
 
        // ----------------
-       psec_dynstr     = Section_GetSectionInfo(
-                                                       p_binfo, LIBGOBLIN_SECTION_ID_DYNSTR );
+       psec_dynstr     = Section_GetSectionInfo_fromBinaryFile(
+                                                       p_bfile, LIBGOBLIN_SECTION_ID_DYNSTR );
        assert( NULL != psec_dynstr );
        if( NULL == psec_dynstr->pb_data )      {
                return -0x01;
@@ -106,8 +109,8 @@ int
        pb_dynstr       = psec_dynstr->pb_data;
 
        // ----------------
-       psec_gnuhash    = Section_GetSectionInfo(
-                                                       p_binfo, LIBGOBLIN_SECTION_ID_GNU_HASH );
+       psec_gnuhash    = Section_GetSectionInfo_fromBinaryFile(
+                                                       p_bfile, LIBGOBLIN_SECTION_ID_GNU_HASH );
        assert( NULL != psec_gnuhash );
        if( NULL == psec_gnuhash->pb_data )     {
                return -0x01;
@@ -115,8 +118,8 @@ int
        pb_gnuhash      = psec_gnuhash->pb_data;
 
        // ----------------
-       psec_gnuver     = Section_GetSectionInfo(
-                                                       p_binfo, LIBGOBLIN_SECTION_ID_GNU_VERSION );
+       psec_gnuver     = Section_GetSectionInfo_fromBinaryFile(
+                                                       p_bfile, LIBGOBLIN_SECTION_ID_GNU_VERSION );
        assert( NULL != psec_gnuver );
        if( NULL == psec_gnuver->pb_data )      {
                return -0x01;
index 354765b..80a8f68 100644 (file)
@@ -103,7 +103,6 @@ int
                                p_sectbl->qw_flag                       = p_sechdr->sh_flags;
 
                                p_bfile->i_secindex[ i_cnt ]    = i_index;
-
                                break;
                        }
                }