* m16.igen (break): Call SignalException not sim_engine_halt.
[deliverable/binutils-gdb.git] / bfd / nlm32-ppc.c
index 62ac3d4d8d92ba0a947747856a54965f99d08b39..5af48345cc73bec9a40d3fd5a4991c71cd66a466 100644 (file)
@@ -1,5 +1,5 @@
 /* Support for 32-bit PowerPC NLM (NetWare Loadable Module)
-   Copyright (C) 1994 Free Software Foundation, Inc.
+   Copyright (C) 1994, 1995, 1999 Free Software Foundation, Inc.
 
 This file is part of BFD, the Binary File Descriptor library.
 
@@ -15,7 +15,7 @@ GNU General Public License for more details.
 
 You should have received a copy of the GNU General Public License
 along with this program; if not, write to the Free Software
-Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.  */
+Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
 
 #include "bfd.h"
 #include "sysdep.h"
@@ -168,7 +168,7 @@ nlm_powerpc_read_reloc (abfd, sym, secp, rel)
       name = NLM_CODE_NAME;
       val &=~ NLM_HIBIT;
     }
-  *secp = bfd_get_section_by_name (abfd, NLM_CODE_NAME);
+  *secp = bfd_get_section_by_name (abfd, name);
 
   if (sym == NULL)
     {
@@ -639,11 +639,11 @@ nlm_powerpc_read_reloc (abfd, sym, secp, rel)
 
 static boolean
 nlm_powerpc_mangle_relocs (abfd, sec, data, offset, count)
-     bfd *abfd;
-     asection *sec;
-     PTR data;
-     bfd_vma offset;
-     bfd_size_type count;
+     bfd *abfd ATTRIBUTE_UNUSED;
+     asection *sec ATTRIBUTE_UNUSED;
+     PTR data ATTRIBUTE_UNUSED;
+     bfd_vma offset ATTRIBUTE_UNUSED;
+     bfd_size_type count ATTRIBUTE_UNUSED;
 {
   return true;
 }
@@ -667,27 +667,21 @@ nlm_powerpc_read_import (abfd, sym)
   sym -> symbol.the_bfd = abfd;
   name = bfd_alloc (abfd, symlength + 1);
   if (name == NULL)
-    {
-      bfd_set_error (bfd_error_no_memory);
-      return false;
-    }
+    return false;
   if (bfd_read (name, symlength, 1, abfd) != symlength)
     return (false);
   name[symlength] = '\0';
   sym -> symbol.name = name;
   sym -> symbol.flags = 0;
   sym -> symbol.value = 0;
-  sym -> symbol.section = &bfd_und_section;
+  sym -> symbol.section = bfd_und_section_ptr;
   if (bfd_read ((PTR) temp, sizeof (temp), 1, abfd) != sizeof (temp))
     return (false);
   rcount = bfd_h_get_32 (abfd, temp);
   nlm_relocs = ((struct nlm_relent *)
                bfd_alloc (abfd, rcount * sizeof (struct nlm_relent)));
   if (nlm_relocs == (struct nlm_relent *) NULL)
-    {
-      bfd_set_error (bfd_error_no_memory);
-      return false;
-    }
+    return false;
   sym -> relocs = nlm_relocs;
   sym -> rcnt = 0;
   while (sym -> rcnt < rcount)
@@ -758,7 +752,7 @@ nlm_powerpc_write_import (abfd, sec, rel)
       val |= NLM_HIBIT;
     }
     
-  if (bfd_get_section (sym) != &bfd_und_section)
+  if (! bfd_is_und_section (bfd_get_section (sym)))
     {
       /* This is an internal relocation fixup.  The second most
         significant bit is 0 if this is a reloc against the data
@@ -794,7 +788,7 @@ nlm_powerpc_write_reloc (abfd, sec, rel, indx)
   unsigned long l_symndx;
   int l_rtype;
   int l_rsecnm;
-  const reloc_howto_type *howto;
+  reloc_howto_type *howto;
   bfd_size_type address;
 
   /* Get the sections now, for convenience.  */
@@ -806,7 +800,7 @@ nlm_powerpc_write_reloc (abfd, sec, rel, indx)
   symsec = bfd_get_section (sym);
   if (indx != -1)
     {
-      BFD_ASSERT (symsec == &bfd_und_section);
+      BFD_ASSERT (bfd_is_und_section (symsec));
       l_symndx = indx + 3;
     }
   else
@@ -905,7 +899,7 @@ nlm_powerpc_write_external (abfd, count, sym, relocs)
      asymbol *sym;
      struct reloc_and_sec *relocs;
 {
-  int i;
+  unsigned int i;
   bfd_byte len;
   unsigned char temp[NLM_TARGET_LONG_SIZE];
 #ifdef OLDFORMAT
This page took 0.025517 seconds and 4 git commands to generate.