Make the assembler generate an error if there is an attempt to define a section with...
[deliverable/binutils-gdb.git] / gdb / xcoffread.c
index bc4877389b0f1ce7e0c84388298cdb1c2df39180..6985a43d388042ea71b79ef5230a490917df0da0 100644 (file)
@@ -1,5 +1,5 @@
 /* Read AIX xcoff symbol tables and convert to internal format, for GDB.
-   Copyright (C) 1986-2019 Free Software Foundation, Inc.
+   Copyright (C) 1986-2020 Free Software Foundation, Inc.
    Derived from coffread.c, dbxread.c, and a lot of hacking.
    Contributed by IBM Corporation.
 
@@ -1522,7 +1522,7 @@ read_xcoff_symtab (struct objfile *objfile, struct partial_symtab *pst)
 }
 
 #define        SYMBOL_DUP(SYMBOL1, SYMBOL2)    \
-  (SYMBOL2) = XOBNEW (&objfile->objfile_obstack, struct symbol); \
+  (SYMBOL2) = new (&objfile->objfile_obstack) symbol (); \
   *(SYMBOL2) = *(SYMBOL1);
 
 
@@ -1574,7 +1574,7 @@ process_xcoff_symbol (struct coff_symbol *cs, struct objfile *objfile)
          will be patched with the type from its stab entry later on in
          patch_block_stabs (), unless the file was compiled without -g.  */
 
-      SYMBOL_SET_LINKAGE_NAME (sym, SYMNAME_ALLOC (name, symname_alloced));
+      sym->set_linkage_name (SYMNAME_ALLOC (name, symname_alloced));
       SYMBOL_TYPE (sym) = objfile_type (objfile)->nodebug_text_symbol;
 
       SYMBOL_ACLASS_INDEX (sym) = LOC_BLOCK;
@@ -2634,8 +2634,9 @@ scan_xcoff_symtab (minimal_symbol_reader &reader,
                  namestring = gdbarch_static_transform_name
                                 (gdbarch, namestring);
 
-               add_psymbol_to_list (namestring, p - namestring, true,
-                                    VAR_DOMAIN, LOC_STATIC,
+               add_psymbol_to_list (gdb::string_view (namestring,
+                                                      p - namestring),
+                                    true, VAR_DOMAIN, LOC_STATIC,
                                     SECT_OFF_DATA (objfile),
                                     psymbol_placement::STATIC,
                                     symbol.n_value,
@@ -2645,8 +2646,9 @@ scan_xcoff_symtab (minimal_symbol_reader &reader,
              case 'G':
                /* The addresses in these entries are reported to be
                   wrong.  See the code that reads 'G's for symtabs.  */
-               add_psymbol_to_list (namestring, p - namestring, true,
-                                    VAR_DOMAIN, LOC_STATIC,
+               add_psymbol_to_list (gdb::string_view (namestring,
+                                                      p - namestring),
+                                    true, VAR_DOMAIN, LOC_STATIC,
                                     SECT_OFF_DATA (objfile),
                                     psymbol_placement::GLOBAL,
                                     symbol.n_value,
@@ -2664,15 +2666,17 @@ scan_xcoff_symtab (minimal_symbol_reader &reader,
                    || (p == namestring + 1
                        && namestring[0] != ' '))
                  {
-                   add_psymbol_to_list (namestring, p - namestring, true,
-                                        STRUCT_DOMAIN, LOC_TYPEDEF, -1,
+                   add_psymbol_to_list (gdb::string_view (namestring,
+                                                          p - namestring),
+                                        true, STRUCT_DOMAIN, LOC_TYPEDEF, -1,
                                         psymbol_placement::STATIC,
                                         0, psymtab_language, objfile);
                    if (p[2] == 't')
                      {
                        /* Also a typedef with the same name.  */
-                       add_psymbol_to_list (namestring, p - namestring, true,
-                                            VAR_DOMAIN, LOC_TYPEDEF, -1,
+                       add_psymbol_to_list (gdb::string_view (namestring,
+                                                              p - namestring),
+                                            true, VAR_DOMAIN, LOC_TYPEDEF, -1,
                                             psymbol_placement::STATIC,
                                             0, psymtab_language, objfile);
                        p += 1;
@@ -2683,8 +2687,9 @@ scan_xcoff_symtab (minimal_symbol_reader &reader,
              case 't':
                if (p != namestring)    /* a name is there, not just :T...  */
                  {
-                   add_psymbol_to_list (namestring, p - namestring, true,
-                                        VAR_DOMAIN, LOC_TYPEDEF, -1,
+                   add_psymbol_to_list (gdb::string_view (namestring,
+                                                          p - namestring),
+                                        true, VAR_DOMAIN, LOC_TYPEDEF, -1,
                                         psymbol_placement::STATIC,
                                         0, psymtab_language, objfile);
                  }
@@ -2745,7 +2750,7 @@ scan_xcoff_symtab (minimal_symbol_reader &reader,
                          ;
                        /* Note that the value doesn't matter for
                           enum constants in psymtabs, just in symtabs.  */
-                       add_psymbol_to_list (p, q - p, true,
+                       add_psymbol_to_list (gdb::string_view (p, q - p), true,
                                             VAR_DOMAIN, LOC_CONST, -1,
                                             psymbol_placement::STATIC,
                                             0, psymtab_language, objfile);
@@ -2763,8 +2768,9 @@ scan_xcoff_symtab (minimal_symbol_reader &reader,
 
              case 'c':
                /* Constant, e.g. from "const" in Pascal.  */
-               add_psymbol_to_list (namestring, p - namestring, true,
-                                    VAR_DOMAIN, LOC_CONST, -1,
+               add_psymbol_to_list (gdb::string_view (namestring,
+                                                      p - namestring),
+                                    true, VAR_DOMAIN, LOC_CONST, -1,
                                     psymbol_placement::STATIC,
                                     0, psymtab_language, objfile);
                continue;
@@ -2780,8 +2786,9 @@ scan_xcoff_symtab (minimal_symbol_reader &reader,
                    function_outside_compilation_unit_complaint (name);
                    xfree (name);
                  }
-               add_psymbol_to_list (namestring, p - namestring, true,
-                                    VAR_DOMAIN, LOC_BLOCK,
+               add_psymbol_to_list (gdb::string_view (namestring,
+                                                      p - namestring),
+                                    true, VAR_DOMAIN, LOC_BLOCK,
                                     SECT_OFF_TEXT (objfile),
                                     psymbol_placement::STATIC,
                                     symbol.n_value,
@@ -2810,8 +2817,9 @@ scan_xcoff_symtab (minimal_symbol_reader &reader,
                if (startswith (namestring, "@FIX"))
                  continue;
 
-               add_psymbol_to_list (namestring, p - namestring, true,
-                                    VAR_DOMAIN, LOC_BLOCK,
+               add_psymbol_to_list (gdb::string_view (namestring,
+                                                      p - namestring),
+                                    true, VAR_DOMAIN, LOC_BLOCK,
                                     SECT_OFF_TEXT (objfile),
                                     psymbol_placement::GLOBAL,
                                     symbol.n_value,
This page took 0.030058 seconds and 4 git commands to generate.