OSDN Git Service

(LibGoblin)
authorKoine Yuusuke(koinec) <koinec@users.osdn.me>
Wed, 16 Oct 2019 12:33:50 +0000 (21:33 +0900)
committerKoine Yuusuke(koinec) <koinec@users.osdn.me>
Wed, 16 Oct 2019 12:33:50 +0000 (21:33 +0900)
  * WorkBackup

libgoblin/drd64_libgoblin_debug_objinfo.c
libgoblin/drd64_libgoblin_elf_symtab.c
libgoblin/drd64_libgoblin_type.h

index 915ef5d..237575d 100644 (file)
@@ -94,7 +94,7 @@ void
                                p_obj->file.pv_offset, p_obj->file.qw_size, p_obj->file.i_binfile );
 
        // Symbol type - ELFNN_ST_TYPE - st_info
-       switch( p_obj->info.symbol.b_type )     {
+       switch( p_obj->elfsym.b_type )  {
                case STT_NOTYPE:        // 0 - Unspecified type.
                        strcpy( str_type, "NoType" );
                        break;
@@ -123,12 +123,12 @@ void
                        strcpy( str_type, "GNU IFunc" );
                        break;
                default:
-                       snprintf( str_type, 31, "(%02xh)", p_obj->info.symbol.b_type );
+                       snprintf( str_type, 31, "(%02xh)", p_obj->elfsym.b_type );
                        break;
        }
 
        // Symbol Binding - ELFNN_ST_BIND - st_info
-       switch( p_obj->info.symbol.b_binding )  {
+       switch( p_obj->elfsym.b_binding )       {
                case STB_LOCAL:                 // 0 - Local symbol
                        strcpy( str_binding, "Local" );
                        break;
@@ -142,13 +142,13 @@ void
                        strcpy( str_binding, "GNU Unique" );
                        break;
                default:
-                       snprintf( str_binding, 31, "(%02xh)", p_obj->info.symbol.b_binding );
+                       snprintf( str_binding, 31, "(%02xh)", p_obj->elfsym.b_binding );
                        break;
        }
 
 
        // Symbol visibility - ELFNN_ST_VISIBILITY - st_other
-       switch( p_obj->info.symbol.b_visibility )       {
+       switch( p_obj->elfsym.b_visibility )    {
                case STV_DEFAULT:       // 0x00 - Default visibility (see binding).
                        strcpy( str_visibility, "Default" );
                        break;
@@ -171,7 +171,7 @@ void
                        strcpy( str_visibility, "ELIMINATE" );
                        break;
                default:
-                       snprintf( str_binding, 31, "(%02xh)", p_obj->info.symbol.b_binding );
+                       snprintf( str_binding, 31, "(%02xh)", p_obj->elfsym.b_binding );
                        break;
        }
 
index 1d609f7..c1ee503 100644 (file)
@@ -104,21 +104,21 @@ LibGoblin_ObjectInfo *
                                        p_pginfo, ptr_loadaddr, qw_size, NULL,
                                        OBJINFO_INSETMODE_INSET | OBJINFO_INSETMODE_ADOPT, b_objtype, NULL );
 
-       p_obj->info.symbol.b_type       = b_symtype;
-       p_obj->b_type                           = b_objtype;
+       p_obj->elfsym.b_type    = b_symtype;
+       p_obj->b_type                   = b_objtype;
 
        // st_name - String table index of name.
        p_obj->pstr_name        = (char *)(pb_strtab + p_sym->st_name);
        p_obj->dw_hash          = Common_CalcDJBhash( (char *)(pb_strtab + p_sym->st_name) );
 
        // st_info - Type and binding information.
-       p_obj->info.symbol.b_binding    = ELF64_ST_BIND( p_sym->st_info );
+       p_obj->elfsym.b_binding = ELF64_ST_BIND( p_sym->st_info );
 
        // st_other - Reserved (not used).
-       p_obj->info.symbol.b_visibility = p_sym->st_other;
+       p_obj->elfsym.b_visibility      = p_sym->st_other;
 
        // st_shndx - Section index of symbol.
-       p_obj->info.symbol.w_secindex   = p_sym->st_shndx;
+       p_obj->elfsym.w_secindex        = p_sym->st_shndx;
        if(( SHN_UNDEF == p_sym->st_shndx ) && ( STT_NOTYPE != ELF64_ST_TYPE( p_sym->st_info ) ))
                { p_obj->dw_status      |=      OBJINFO_STATUS_DYNAMIC; }
 
index 817de1e..dafe631 100644 (file)
@@ -190,13 +190,6 @@ typedef    struct  {
                } objfile;
 
                struct  {
-                       Byte    b_type;                 // st_info - Type and binding information.
-                       Byte    b_binding;              // st_info - Type and binding information.
-                       Byte    b_visibility;   // st_other - Reserved (not used).
-                       Word    w_secindex;             // st_shndx - Section index of symbol.
-               } symbol;
-
-               struct  {
                        DWord   dw_size;
                        Byte    b_encoding;
                        Byte    b_bit_offset;
@@ -215,6 +208,13 @@ typedef    struct  {
        } info;
 
        struct  {
+               Byte    b_type;                 // st_info - Type and binding information.
+               Byte    b_binding;              // st_info - Type and binding information.
+               Byte    b_visibility;   // st_other - Reserved (not used).
+               Word    w_secindex;             // st_shndx - Section index of symbol.
+       } elfsym;
+
+       struct  {
                int             i_binfo_origin;
                int             i_dynsym_index;