* coffread.c (record_minimal_symbol): Update.
authorTom Tromey <tromey@redhat.com>
Mon, 8 Apr 2013 20:13:22 +0000 (20:13 +0000)
committerTom Tromey <tromey@redhat.com>
Mon, 8 Apr 2013 20:13:22 +0000 (20:13 +0000)
* dbxread.c (record_minimal_symbol): Update.
* elfread.c (record_minimal_symbol): Update.
* machoread.c (macho_symtab_add_minsym): Update.
* mdebugread.c (record_minimal_symbol, parse_partial_symbols):
Update.
* minsyms.c (prim_record_minimal_symbol): Update.
(prim_record_minimal_symbol_full): Remove 'bfd_section'
argument.
(prim_record_minimal_symbol_and_info): Likewise.
* minsyms.h (prim_record_minimal_symbol_full)
(prim_record_minimal_symbol_and_info): Update.
* symtab.c (allocate_symbol, initialize_symbol)
(allocate_template_symbol): Initialize SYMBOL_SECTION.
* xcoffread.c (record_minimal_symbol, scan_xcoff_symtab):
Update.

gdb/ChangeLog
gdb/coffread.c
gdb/dbxread.c
gdb/elfread.c
gdb/machoread.c
gdb/mdebugread.c
gdb/minsyms.c
gdb/minsyms.h
gdb/somread.c
gdb/xcoffread.c

index edc4d0a5a9f1b21ca78e2484bca0d95ac15890a0..11a8cf358d435e4ec886d4d60eb442bcbc71663e 100644 (file)
@@ -1,3 +1,22 @@
+2013-04-08  Tom Tromey  <tromey@redhat.com>
+
+       * coffread.c (record_minimal_symbol): Update.
+       * dbxread.c (record_minimal_symbol): Update.
+       * elfread.c (record_minimal_symbol): Update.
+       * machoread.c (macho_symtab_add_minsym): Update.
+       * mdebugread.c (record_minimal_symbol, parse_partial_symbols):
+       Update.
+       * minsyms.c (prim_record_minimal_symbol): Update.
+       (prim_record_minimal_symbol_full): Remove 'bfd_section'
+       argument.
+       (prim_record_minimal_symbol_and_info): Likewise.
+       * minsyms.h (prim_record_minimal_symbol_full)
+       (prim_record_minimal_symbol_and_info): Update.
+       * symtab.c (allocate_symbol, initialize_symbol)
+       (allocate_template_symbol): Initialize SYMBOL_SECTION.
+       * xcoffread.c (record_minimal_symbol, scan_xcoff_symtab):
+       Update.
+
 2013-04-08  Tom Tromey  <tromey@redhat.com>
 
        PR symtab/8423:
index 9076262566bd28eceaa4555c923c8bf9200f6dcd..bf3908523fbf483c78c6a7d4d4661e0f3293206b 100644 (file)
@@ -456,8 +456,6 @@ record_minimal_symbol (struct coff_symbol *cs, CORE_ADDR address,
                       enum minimal_symbol_type type, int section, 
                       struct objfile *objfile)
 {
-  struct bfd_section *bfd_section;
-
   /* We don't want TDESC entry points in the minimal symbol table.  */
   if (cs->c_name[0] == '@')
     return NULL;
@@ -472,10 +470,8 @@ record_minimal_symbol (struct coff_symbol *cs, CORE_ADDR address,
       return NULL;
     }
 
-  bfd_section = cs_to_bfd_section (cs, objfile);
   return prim_record_minimal_symbol_and_info (cs->c_name, address,
-                                             type, section,
-                                             bfd_section, objfile);
+                                             type, section, objfile);
 }
 \f
 /* coff_symfile_init ()
index 435c5186925488906e56c1cc32ffbd62e58298b9..01dc1bf8ca1bd46f8a0ca711c60880345c87cd0c 100644 (file)
@@ -440,35 +440,29 @@ record_minimal_symbol (char *name, CORE_ADDR address, int type,
 {
   enum minimal_symbol_type ms_type;
   int section;
-  asection *bfd_section;
 
   switch (type)
     {
     case N_TEXT | N_EXT:
       ms_type = mst_text;
       section = SECT_OFF_TEXT (objfile);
-      bfd_section = DBX_TEXT_SECTION (objfile);
       break;
     case N_DATA | N_EXT:
       ms_type = mst_data;
       section = SECT_OFF_DATA (objfile);
-      bfd_section = DBX_DATA_SECTION (objfile);
       break;
     case N_BSS | N_EXT:
       ms_type = mst_bss;
       section = SECT_OFF_BSS (objfile);
-      bfd_section = DBX_BSS_SECTION (objfile);
       break;
     case N_ABS | N_EXT:
       ms_type = mst_abs;
       section = -1;
-      bfd_section = NULL;
       break;
 #ifdef N_SETV
     case N_SETV | N_EXT:
       ms_type = mst_data;
       section = SECT_OFF_DATA (objfile);
-      bfd_section = DBX_DATA_SECTION (objfile);
       break;
     case N_SETV:
       /* I don't think this type actually exists; since a N_SETV is the result
@@ -476,7 +470,6 @@ record_minimal_symbol (char *name, CORE_ADDR address, int type,
          file local.  */
       ms_type = mst_file_data;
       section = SECT_OFF_DATA (objfile);
-      bfd_section = DBX_DATA_SECTION (objfile);
       break;
 #endif
     case N_TEXT:
@@ -485,7 +478,6 @@ record_minimal_symbol (char *name, CORE_ADDR address, int type,
     case N_FN_SEQ:
       ms_type = mst_file_text;
       section = SECT_OFF_TEXT (objfile);
-      bfd_section = DBX_TEXT_SECTION (objfile);
       break;
     case N_DATA:
       ms_type = mst_file_data;
@@ -507,17 +499,14 @@ record_minimal_symbol (char *name, CORE_ADDR address, int type,
          ms_type = mst_data;
       }
       section = SECT_OFF_DATA (objfile);
-      bfd_section = DBX_DATA_SECTION (objfile);
       break;
     case N_BSS:
       ms_type = mst_file_bss;
       section = SECT_OFF_BSS (objfile);
-      bfd_section = DBX_BSS_SECTION (objfile);
       break;
     default:
       ms_type = mst_unknown;
       section = -1;
-      bfd_section = NULL;
       break;
     }
 
@@ -526,7 +515,7 @@ record_minimal_symbol (char *name, CORE_ADDR address, int type,
     lowest_text_address = address;
 
   prim_record_minimal_symbol_and_info
-    (name, address, ms_type, section, bfd_section, objfile);
+    (name, address, ms_type, section, objfile);
 }
 \f
 /* Scan and build partial symbols for a symbol file.
index 668b9745dcd7d0bd7ffd0a5a4cada6a92325447b..b92ba1697516301d089daf9afed736a1364b92ab 100644 (file)
@@ -211,7 +211,7 @@ record_minimal_symbol (const char *name, int name_len, int copy_name,
                                          ms_type,
                                          gdb_bfd_section_index (objfile->obfd,
                                                                 bfd_section),
-                                         bfd_section, objfile);
+                                         objfile);
 }
 
 /* Read the symbol table of an ELF file.
index 54d8e31df25ad264a8ac163fecfe840d97efdcf6..18cd04ad13f0cccebadd9a3decbb73396422fcc9 100644 (file)
@@ -167,7 +167,7 @@ macho_symtab_add_minsym (struct objfile *objfile, const asymbol *sym)
       prim_record_minimal_symbol_and_info
         (sym->name, symaddr, ms_type,
         gdb_bfd_section_index (objfile->obfd, sym->section),
-        sym->section, objfile);
+        objfile);
     }
 }
 
index d922207e6a169cec1ef0a7465d07978487636e1b..5549610b1715fe4d50fc543651b2032c9e092e4d 100644 (file)
@@ -2256,74 +2256,59 @@ record_minimal_symbol (const char *name, const CORE_ADDR address,
                        struct objfile *objfile)
 {
   int section;
-  asection *bfd_section;
 
   switch (storage_class)
     {
       case scText:
         section = SECT_OFF_TEXT (objfile);
-        bfd_section = bfd_get_section_by_name (cur_bfd, ".text");
         break;
       case scData:
         section = SECT_OFF_DATA (objfile);
-        bfd_section = bfd_get_section_by_name (cur_bfd, ".data");
         break;
       case scBss:
         section = SECT_OFF_BSS (objfile);
-        bfd_section = bfd_get_section_by_name (cur_bfd, ".bss");
         break;
       case scSData:
         section = get_section_index (objfile, ".sdata");
-        bfd_section = bfd_get_section_by_name (cur_bfd, ".sdata");
         break;
       case scSBss:
         section = get_section_index (objfile, ".sbss");
-        bfd_section = bfd_get_section_by_name (cur_bfd, ".sbss");
         break;
       case scRData:
         section = get_section_index (objfile, ".rdata");
-        bfd_section = bfd_get_section_by_name (cur_bfd, ".rdata");
         break;
       case scInit:
         section = get_section_index (objfile, ".init");
-        bfd_section = bfd_get_section_by_name (cur_bfd, ".init");
         break;
       case scXData:
         section = get_section_index (objfile, ".xdata");
-        bfd_section = bfd_get_section_by_name (cur_bfd, ".xdata");
         break;
       case scPData:
         section = get_section_index (objfile, ".pdata");
-        bfd_section = bfd_get_section_by_name (cur_bfd, ".pdata");
         break;
       case scFini:
         section = get_section_index (objfile, ".fini");
-        bfd_section = bfd_get_section_by_name (cur_bfd, ".fini");
         break;
       case scRConst:
         section = get_section_index (objfile, ".rconst");
-        bfd_section = bfd_get_section_by_name (cur_bfd, ".rconst");
         break;
 #ifdef scTlsData
       case scTlsData:
         section = get_section_index (objfile, ".tlsdata");
-        bfd_section = bfd_get_section_by_name (cur_bfd, ".tlsdata");
         break;
 #endif
 #ifdef scTlsBss
       case scTlsBss:
         section = get_section_index (objfile, ".tlsbss");
-        bfd_section = bfd_get_section_by_name (cur_bfd, ".tlsbss");
         break;
 #endif
       default:
         /* This kind of symbol is not associated to a section.  */
         section = -1;
-        bfd_section = NULL;
     }
 
   prim_record_minimal_symbol_and_info (name, address, ms_type,
-                                       section, bfd_section, objfile);
+                                       section, objfile);
 }
 
 /* Master parsing procedure for first-pass reading of file symbols
@@ -3510,7 +3495,7 @@ parse_partial_symbols (struct objfile *objfile)
                  prim_record_minimal_symbol_and_info (name, sh.value,
                                                       mst_file_text,
                                                       SECT_OFF_TEXT (objfile),
-                                                      NULL, objfile);
+                                                      objfile);
 
                  /* FALLTHROUGH */
 
@@ -3596,13 +3581,11 @@ parse_partial_symbols (struct objfile *objfile)
                    prim_record_minimal_symbol_and_info (name, sh.value,
                                                         mst_file_data,
                                                         SECT_OFF_DATA (objfile),
-                                                        NULL,
                                                         objfile);
                  else
                    prim_record_minimal_symbol_and_info (name, sh.value,
                                                         mst_file_bss,
                                                         SECT_OFF_BSS (objfile),
-                                                        NULL,
                                                         objfile);
                  class = LOC_STATIC;
                  break;
index 6a94e112411b332ca10b7bd16aa8cba3eab16950..396b0633aade940f057b82d7182054983d787bc5 100644 (file)
@@ -892,7 +892,7 @@ prim_record_minimal_symbol (const char *name, CORE_ADDR address,
     }
 
   prim_record_minimal_symbol_and_info (name, address, ms_type,
-                                      section, NULL, objfile);
+                                      section, objfile);
 }
 
 /* See minsyms.h.  */
@@ -902,7 +902,6 @@ prim_record_minimal_symbol_full (const char *name, int name_len, int copy_name,
                                 CORE_ADDR address,
                                 enum minimal_symbol_type ms_type,
                                 int section,
-                                asection *bfd_section,
                                 struct objfile *objfile)
 {
   struct obj_section *obj_section;
@@ -945,17 +944,6 @@ prim_record_minimal_symbol_full (const char *name, int name_len, int copy_name,
   SYMBOL_SECTION (msymbol) = section;
   SYMBOL_OBJ_SECTION (msymbol) = NULL;
 
-  /* Find obj_section corresponding to bfd_section.  */
-  if (bfd_section)
-    ALL_OBJFILE_OSECTIONS (objfile, obj_section)
-      {
-       if (obj_section->the_bfd_section == bfd_section)
-         {
-           SYMBOL_OBJ_SECTION (msymbol) = obj_section;
-           break;
-         }
-      }
-
   MSYMBOL_TYPE (msymbol) = ms_type;
   MSYMBOL_TARGET_FLAG_1 (msymbol) = 0;
   MSYMBOL_TARGET_FLAG_2 (msymbol) = 0;
@@ -980,12 +968,11 @@ struct minimal_symbol *
 prim_record_minimal_symbol_and_info (const char *name, CORE_ADDR address,
                                     enum minimal_symbol_type ms_type,
                                     int section,
-                                    asection *bfd_section,
                                     struct objfile *objfile)
 {
   return prim_record_minimal_symbol_full (name, strlen (name), 1,
-                                         address, ms_type, section,
-                                         bfd_section, objfile);
+                                         address, ms_type,
+                                         section, objfile);
 }
 
 /* Compare two minimal symbols by address and return a signed result based
index 71670e38e74d1d0513fcba2cbb4bea240cb3faf9..4d484771f8db6d8b419228be01cec88fd61eef57 100644 (file)
@@ -88,7 +88,6 @@ struct cleanup *make_cleanup_discard_minimal_symbols (void);
    ADDRESS - the address of the symbol
    MS_TYPE - the type of the symbol
    SECTION - the symbol's section
-   BFD_SECTION - the symbol's BFD section; used to find the
    appropriate obj_section for the minimal symbol.  This can be NULL.
    OBJFILE - the objfile associated with the minimal symbol.  */
 
@@ -99,14 +98,12 @@ struct minimal_symbol *prim_record_minimal_symbol_full
      CORE_ADDR address,
      enum minimal_symbol_type ms_type,
      int section,
-     asection *bfd_section,
      struct objfile *objfile);
 
 /* Like prim_record_minimal_symbol_full, but:
    - uses strlen to compute NAME_LEN,
    - passes COPY_NAME = 0,
-   - passes SECTION = 0,
-   - and passes BFD_SECTION = NULL.
+   - and passes a default SECTION, depending on the type
    
    This variant does not return the new symbol.  */
 
@@ -123,7 +120,6 @@ struct minimal_symbol *prim_record_minimal_symbol_and_info
      CORE_ADDR,
      enum minimal_symbol_type,
      int section,
-     asection *bfd_section,
      struct objfile *);
 
 /* Install the minimal symbols that have been collected into the given
index 44b0c85c8d689f5a7bea9aaa91749d792bbc30ba..7772f9faf0f6a89a24e21340987db3c65a0deada 100644 (file)
@@ -314,7 +314,6 @@ som_symtab_read (bfd *abfd, struct objfile *objfile,
       prim_record_minimal_symbol_and_info (symname, symbol_value, ms_type,
                                           gdb_bfd_section_index (objfile->obfd,
                                                                  section),
-                                          section,
                                           objfile);
     }
 }
index e6a562d13c90f5b235d62b52646c3f5d2fc96cd9..60135514ac475fa7827c1b69b9776a91e6e06bd9 100644 (file)
@@ -922,15 +922,12 @@ record_minimal_symbol (const char *name, CORE_ADDR address,
                       int n_scnum,
                       struct objfile *objfile)
 {
-  int secnum;
-  asection *bfd_sect;
-
   if (name[0] == '.')
     ++name;
 
-  xcoff_secnum_to_sections (n_scnum, objfile, &bfd_sect, &secnum);
   prim_record_minimal_symbol_and_info (name, address, ms_type,
-                                      secnum, bfd_sect, objfile);
+                                      secnum_to_section (n_scnum, objfile),
+                                      objfile);
 }
 
 /* xcoff has static blocks marked in `.bs', `.es' pairs.  They cannot be
@@ -2346,7 +2343,6 @@ scan_xcoff_symtab (struct objfile *objfile)
                        (namestring, symbol.n_value,
                         sclass == C_HIDEXT ? mst_file_data : mst_data,
                         secnum_to_section (symbol.n_scnum, objfile),
-                        secnum_to_bfd_section (symbol.n_scnum, objfile),
                         objfile);
                    break;
 
@@ -2424,7 +2420,6 @@ scan_xcoff_symtab (struct objfile *objfile)
                        (namestring, symbol.n_value,
                         sclass == C_HIDEXT ? mst_file_data : mst_data,
                         secnum_to_section (symbol.n_scnum, objfile),
-                        secnum_to_bfd_section (symbol.n_scnum, objfile),
                         objfile);
                    break;
                  }
@@ -2442,7 +2437,6 @@ scan_xcoff_symtab (struct objfile *objfile)
                        (namestring, symbol.n_value,
                         sclass == C_HIDEXT ? mst_file_bss : mst_bss,
                         secnum_to_section (symbol.n_scnum, objfile),
-                        secnum_to_bfd_section (symbol.n_scnum, objfile),
                         objfile);
                    break;
                  }