* elf32-mips.c (elf_mips_abi_name): Return the right ABI string for
[deliverable/binutils-gdb.git] / bfd / coffgen.c
index 5ca9c982fc2b5bc68d06ed946b04af0c5c5d315b..45eda875d5c56f2624764282a52e590ccaa9067c 100644 (file)
@@ -82,6 +82,8 @@ make_a_section_from_file (abfd, hdr, target_index)
 {
   asection *return_section;
   char *name;
+  boolean result = true;
+  flagword flags;
 
   name = NULL;
 
@@ -142,8 +144,12 @@ make_a_section_from_file (abfd, hdr, target_index)
   return_section->userdata = NULL;
   return_section->next = (asection *) NULL;
   return_section->target_index = target_index;
-  return_section->flags = bfd_coff_styp_to_sec_flags_hook (abfd, hdr, name,
-                                                          return_section);
+
+  if (! bfd_coff_styp_to_sec_flags_hook (abfd, hdr, name, return_section,
+                                        & flags))
+    result = false;
+  
+  return_section->flags = flags;
 
   /* At least on i386-coff, the line number count for a shared library
      section must be ignored.  */
@@ -155,7 +161,8 @@ make_a_section_from_file (abfd, hdr, target_index)
   /* FIXME: should this check 'hdr->s_size > 0' */
   if (hdr->s_scnptr != 0)
     return_section->flags |= SEC_HAS_CONTENTS;
-  return true;
+
+  return result;
 }
 
 /* Read in a COFF object and make it into a BFD.  This is used by
@@ -2099,16 +2106,18 @@ coff_print_symbol (abfd, filep, symbol, how)
                case C_EXT:
                  if (ISFCN (combined->u.syment.n_type))
                    {
+                     long next, llnos;
+
+                     if (auxp->fix_end)
+                       next = (auxp->u.auxent.x_sym.x_fcnary.x_fcn.x_endndx.p
+                              - root);
+                     else
+                       next = auxp->u.auxent.x_sym.x_fcnary.x_fcn.x_endndx.l;
+                     llnos = auxp->u.auxent.x_sym.x_fcnary.x_fcn.x_lnnoptr;
                      fprintf (file,
                               _("AUX tagndx %ld ttlsiz 0x%lx lnnos %ld next %ld"),
-                              tagndx,
-                              auxp->u.auxent.x_sym.x_misc.x_fsize,
-                              auxp->u.auxent.x_sym.x_fcnary.x_fcn.x_lnnoptr,
-                              (auxp->fix_end
-                               ? ((long)
-                                  (auxp->u.auxent.x_sym.x_fcnary.x_fcn.x_endndx.p
-                                   - root))
-                               : auxp->u.auxent.x_sym.x_fcnary.x_fcn.x_endndx.l));
+                              tagndx, auxp->u.auxent.x_sym.x_misc.x_fsize,
+                              llnos, next);
                      break;
                    }
                  /* else fall through */
@@ -2142,7 +2151,7 @@ coff_print_symbol (abfd, filep, symbol, how)
        }
       else
        {
-         bfd_print_symbol_vandf ((PTR) file, symbol);
+         bfd_print_symbol_vandf (abfd, (PTR) file, symbol);
          fprintf (file, " %-5s %s %s %s",
                   symbol->section->name,
                   coffsymbol (symbol)->native ? "n" : "g",
@@ -2273,7 +2282,7 @@ coff_find_nearest_line (abfd, section, symbols, offset, filename_ptr,
 
          /* Avoid endless loops on erroneous files by ensuring that
             we always move forward in the file.  */
-         if (p - cof->raw_syments >= p->u.syment.n_value)
+         if (p >= cof->raw_syments + p->u.syment.n_value)
            break;
 
          p = cof->raw_syments + p->u.syment.n_value;
This page took 0.02397 seconds and 4 git commands to generate.