* serial.h (SERIAL_SET_TTY_STATE): Comment return value.
[deliverable/binutils-gdb.git] / gdb / xcoffread.c
index d9a723a492751c7e9b97ffdc33d16abc834a998b..aac55247ac4999139029cd8d31f9ed5ca8a57dd1 100644 (file)
@@ -41,6 +41,10 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.  */
 #include <sys/stat.h>
 #include <sys/debug.h>
 
+#include "coff/internal.h"     /* FIXME, internal data from BFD */
+#include "libcoff.h"           /* FIXME, internal data from BFD */
+#include "coff/rs6000.h"       /* FIXME, raw file-format guts of xcoff */
+
 #include "symtab.h"
 #include "gdbtypes.h"
 #include "symfile.h"
@@ -49,10 +53,6 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.  */
 #include "stabsread.h"
 #include "complaints.h"
 
-#include "coff/internal.h"     /* FIXME, internal data from BFD */
-#include "libcoff.h"           /* FIXME, internal data from BFD */
-#include "coff/rs6000.h"       /* FIXME, raw file-format guts of xcoff */
-
 /* For interface with stabsread.c.  */
 #include "aout/stab_gnu.h"
 
@@ -61,7 +61,7 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.  */
 struct coff_symbol {
   char *c_name;
   int c_symnum;                /* symbol number of this entry */
-  int c_nsyms;         /* 0 if syment only, 1 if syment + auxent */
+  int c_naux;          /* 0 if syment only, 1 if syment + auxent */
   long c_value;
   unsigned char c_sclass;
   int c_secnum;
@@ -168,12 +168,8 @@ xcoff_symfile_init PARAMS ((struct objfile *));
 static void
 xcoff_new_init PARAMS ((struct objfile *));
 
-#ifdef __STDC__
-struct section_offset;
-#endif
-
 static void
-xcoff_symfile_read PARAMS ((struct objfile *, struct section_offset *, int));
+xcoff_symfile_read PARAMS ((struct objfile *, struct section_offsets *, int));
 
 static void
 xcoff_symfile_finish PARAMS ((struct objfile *));
@@ -989,7 +985,7 @@ read_xcoff_symtab (objfile, nsyms)
   TracebackInfo *ptb;          /* Pointer to traceback table */
 
   struct internal_syment symbol[1];
-  union internal_auxent main_aux[1];
+  union internal_auxent main_aux;
   struct coff_symbol cs[1];
   CORE_ADDR file_start_addr = 0;
   CORE_ADDR file_end_addr = 0;
@@ -1070,7 +1066,7 @@ read_xcoff_symtab (objfile, nsyms)
       bfd_coff_swap_sym_in (abfd, raw_symbol, symbol);
 
       cs->c_symnum = symnum;
-      cs->c_nsyms = symbol->n_numaux;
+      cs->c_naux = symbol->n_numaux;
       if (symbol->n_zeroes) {
        symname_alloced = 0;
        /* We must use the original, unswapped, name here so the name field
@@ -1132,11 +1128,11 @@ read_xcoff_symtab (objfile, nsyms)
     /* if explicitly specified as a function, treat is as one. */
     if (ISFCN(cs->c_type) && cs->c_sclass != C_TPDEF) {
       bfd_coff_swap_aux_in (abfd, raw_auxptr, cs->c_type, cs->c_sclass,
-                           main_aux);
+                           &main_aux);
       goto function_entry_point;
     }
 
-    if ((cs->c_sclass == C_EXT || cs->c_sclass == C_HIDEXT) && cs->c_nsyms == 1)
+    if ((cs->c_sclass == C_EXT || cs->c_sclass == C_HIDEXT) && cs->c_naux == 1)
     {
        /* dealing with a symbol with a csect entry. */
 
@@ -1148,16 +1144,16 @@ read_xcoff_symtab (objfile, nsyms)
 
        /* Convert the auxent to something we can access.  */
         bfd_coff_swap_aux_in (abfd, raw_auxptr, cs->c_type, cs->c_sclass,
-                             main_aux);
+                             &main_aux);
 
-       switch (CSECT_SMTYP (main_aux)) {
+       switch (CSECT_SMTYP (&main_aux)) {
 
        case XTY_ER :
          continue;                     /* ignore all external references. */
 
        case XTY_SD :                   /* a section description. */
          {
-           switch (CSECT_SCLAS (main_aux)) {
+           switch (CSECT_SCLAS (&main_aux)) {
 
            case XMC_PR :                       /* a `.text' csect.     */
              {
@@ -1200,12 +1196,12 @@ read_xcoff_symtab (objfile, nsyms)
 
                /* If this is the very first csect seen, basically `__start'. */
                if (just_started) {
-                 first_object_file_end = cs->c_value + CSECT_LEN (main_aux);
+                 first_object_file_end = cs->c_value + CSECT_LEN (&main_aux);
                  just_started = 0;
                }
 
                file_start_addr = cs->c_value;
-               file_end_addr = cs->c_value + CSECT_LEN (main_aux);
+               file_end_addr = cs->c_value + CSECT_LEN (&main_aux);
 
                if (cs->c_name && cs->c_name[0] == '.') {
                  last_csect_name = cs->c_name;
@@ -1238,19 +1234,19 @@ read_xcoff_symtab (objfile, nsyms)
        case XTY_LD :
          
          /* a function entry point. */
-         if (CSECT_SCLAS (main_aux) == XMC_PR) {
+         if (CSECT_SCLAS (&main_aux) == XMC_PR) {
 
 function_entry_point:
            RECORD_MINIMAL_SYMBOL (cs->c_name, cs->c_value, mst_text, 
                                   symname_alloced, cs->c_secnum, objfile);
 
-           fcn_line_offset = main_aux->x_sym.x_fcnary.x_fcn.x_lnnoptr;
+           fcn_line_offset = main_aux.x_sym.x_fcnary.x_fcn.x_lnnoptr;
            fcn_start_addr = cs->c_value;
 
            /* save the function header info, which will be used
               when `.bf' is seen. */
            fcn_cs_saved = *cs;
-           fcn_aux_saved = *main_aux;
+           fcn_aux_saved = main_aux;
 
 
            ptb = NULL;
@@ -1259,11 +1255,15 @@ function_entry_point:
               already available for it. Process traceback table for
               functions with only one auxent. */
 
-           if (cs->c_nsyms == 1)
+           if (cs->c_naux == 1)
              ptb = retrieve_tracebackinfo (abfd, textsec, cs);
 
-           else if (cs->c_nsyms != 2)
-             abort ();
+           else if (cs->c_naux != 2)
+             {
+               static struct complaint msg =
+                 {"Expected one or two auxents for function", 0, 0};
+               complain (&msg);
+             }
 
            /* If there is traceback info, create and add parameters for it. */
 
@@ -1309,7 +1309,7 @@ function_entry_point:
            continue;
          }
          /* shared library function trampoline code entry point. */
-         else if (CSECT_SCLAS (main_aux) == XMC_GL) {
+         else if (CSECT_SCLAS (&main_aux) == XMC_GL) {
 
            /* record trampoline code entries as mst_unknown symbol. When we
               lookup mst symbols, we will choose mst_text over mst_unknown. */
@@ -1410,7 +1410,7 @@ function_entry_point:
       if (STREQ (cs->c_name, ".bf")) {
 
         bfd_coff_swap_aux_in (abfd, raw_auxptr, cs->c_type, cs->c_sclass,
-                             main_aux);
+                             &main_aux);
 
        within_function = 1;
 
@@ -1426,14 +1426,14 @@ function_entry_point:
       else if (STREQ (cs->c_name, ".ef")) {
 
         bfd_coff_swap_aux_in (abfd, raw_auxptr, cs->c_type, cs->c_sclass,
-                             main_aux);
+                             &main_aux);
 
        /* the value of .ef is the address of epilogue code;
           not useful for gdb */
        /* { main_aux.x_sym.x_misc.x_lnsz.x_lnno
           contains number of lines to '}' */
 
-       fcn_last_line = main_aux->x_sym.x_misc.x_lnsz.x_lnno;
+       fcn_last_line = main_aux.x_sym.x_misc.x_lnsz.x_lnno;
        new = pop_context ();
        if (context_stack_depth != 0)
          error ("invalid symbol data; .bf/.ef/.bb/.eb symbol mismatch, at symbol %d.",
@@ -2013,7 +2013,7 @@ free_debugsection()
 static void
 xcoff_symfile_read (objfile, section_offset, mainline)
   struct objfile *objfile;
-  struct section_offset *section_offset;
+  struct section_offsets *section_offset;
   int mainline;
 {
   int num_symbols;                     /* # of symbols */
This page took 0.026283 seconds and 4 git commands to generate.