* objcopy.c (copy_archive): Preserve dates of archive members if
[deliverable/binutils-gdb.git] / bfd / nlm32-sparc.c
index 5626a86611900e5e0ac7e0965e933667b9c114bd..5963adbc70bf0840a2ca7098e179ec7bc1ec9ea4 100644 (file)
@@ -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"
@@ -123,7 +123,7 @@ nlm_sparc_read_reloc (abfd, sym, secp, rel)
      arelent *rel;
 {
   bfd_vma val, addend;
-  int index;
+  unsigned int index;
   unsigned int type;
   struct nlm32_sparc_reloc_ext tmp_reloc;
   asection *code_sec, *data_sec;
@@ -170,7 +170,7 @@ nlm_sparc_write_reloc (abfd, sec, rel)
 {
   bfd_vma val;
   struct nlm32_sparc_reloc_ext tmp_reloc;
-  int index;
+  unsigned int index;
   int type = -1;
   reloc_howto_type *tmp;
 
@@ -222,9 +222,7 @@ nlm_sparc_write_reloc (abfd, sec, rel)
   bfd_put_8 (abfd, (short)(rel->howto->type), tmp_reloc.type);
 
   if (bfd_write (&tmp_reloc, 12, 1, abfd) != 12)
-    {
-      abort();
-    }
+    return false;
 
   return true;
 }
@@ -274,10 +272,7 @@ nlm_sparc_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;
   
   /*
    * Then read in the symbol
@@ -289,7 +284,7 @@ nlm_sparc_read_import (abfd, sym)
   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;
   
   /*
    * Next, start reading in the relocs.
@@ -298,10 +293,7 @@ nlm_sparc_read_import (abfd, sym)
   nlm_relocs = ((struct nlm_relent *)
                bfd_alloc (abfd, rcount * sizeof (struct nlm_relent)));
   if (!nlm_relocs)
-    {
-      bfd_set_error (bfd_error_no_memory);
-      return false;
-    }
+    return false;
   sym -> relocs = nlm_relocs;
   sym -> rcnt = 0;
   while (sym -> rcnt < rcount)
@@ -348,9 +340,11 @@ nlm_sparc_write_import (abfd, sec, rel)
           __FUNCTION__, base + (*rel->sym_ptr_ptr)->value);
 #endif
   bfd_put_32 (abfd, base + (*rel->sym_ptr_ptr)->value, temp);
-  bfd_write ((PTR)temp, 4, 1, abfd);
+  if (bfd_write ((PTR)temp, 4, 1, abfd) != 4)
+    return false;
   bfd_put_32 (abfd, 1, temp);
-  bfd_write ((PTR)temp, 4, 1, abfd);
+  if (bfd_write ((PTR)temp, 4, 1, abfd) != 4)
+    return false;
   if (nlm_sparc_write_reloc (abfd, sec, rel) == false)
     return false;
   return true;
@@ -365,7 +359,7 @@ nlm_sparc_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];
 
This page took 0.026148 seconds and 4 git commands to generate.