OSDN Git Service

* hpux-core.c (hpux_core_core_file_p): Add cast in call to
authordanglin <danglin>
Thu, 22 Apr 2004 23:17:06 +0000 (23:17 +0000)
committerdanglin <danglin>
Thu, 22 Apr 2004 23:17:06 +0000 (23:17 +0000)
make_bfd_asection.
* som.c (som_set_section_contents): Constantify second argument.
(hppa_som_gen_reloc_type): Abort for unsupported selectors.
(som_object_setup): Rework to avoid warning.
(setup_sections, som_write_fixups, bfd_section_from_som_symbol):
Likewise.

bfd/ChangeLog
bfd/hpux-core.c
bfd/som.c

index 904f0b8..d505ee6 100644 (file)
@@ -1,3 +1,13 @@
+2004-04-22  John David Anglin  <dave.anglin@nrc-cnrc.gc.ca>
+
+       * hpux-core.c (hpux_core_core_file_p): Add cast in call to 
+       make_bfd_asection.
+       * som.c (som_set_section_contents): Constantify second argument.
+       (hppa_som_gen_reloc_type): Abort for unsupported selectors.
+       (som_object_setup): Rework to avoid warning.
+       (setup_sections, som_write_fixups, bfd_section_from_som_symbol):
+       Likewise.
+
 2004-04-22  Andrew Cagney  <cagney@redhat.com>
 
        * cache.c (bfd_cache_close): Check for a previously closed file.
index 30967c9..d624ad5 100644 (file)
@@ -276,7 +276,8 @@ hpux_core_core_file_p (abfd)
        case CORE_ANON_SHMEM:
          if (!make_bfd_asection (abfd, ".data",
                                  SEC_ALLOC + SEC_LOAD + SEC_HAS_CONTENTS,
-                                 core_header.len, core_header.addr, 2))
+                                 core_header.len,
+                                 (bfd_vma) core_header.addr, 2))
            goto fail;
 
          bfd_seek (abfd, (file_ptr) core_header.len, SEEK_CUR);
index 9066257..1d2d99e 100644 (file)
--- a/bfd/som.c
+++ b/bfd/som.c
@@ -194,7 +194,7 @@ static bfd_boolean som_bfd_copy_private_bfd_data
 static bfd_boolean som_bfd_is_local_label_name
   PARAMS ((bfd *, const char *));
 static bfd_boolean som_set_section_contents
-  PARAMS ((bfd *, sec_ptr, PTR, file_ptr, bfd_size_type));
+  PARAMS ((bfd *, sec_ptr, const PTR, file_ptr, bfd_size_type));
 static bfd_boolean som_get_section_contents
   PARAMS ((bfd *, sec_ptr, PTR, file_ptr, bfd_size_type));
 static bfd_boolean som_set_arch_mach
@@ -1589,6 +1589,11 @@ hppa_som_gen_reloc_type (abfd, base_type, format, field, sym_diff, sym)
       final_types[3] = NULL;
       *final_type = base_type;
       break;
+
+    /* FIXME: These two field selectors are not currently supported.  */
+    case e_ltpsel:
+    case e_rtpsel:
+      abort ();
     }
 
   switch (base_type)
@@ -1820,10 +1825,13 @@ som_object_setup (abfd, file_hdrp, aux_hdrp, current_offset)
   found = 0;
   for (section = abfd->sections; section; section = section->next)
     {
+      bfd_vma entry;
+
       if ((section->flags & SEC_CODE) == 0)
        continue;
-      if (aux_hdrp->exec_entry >= section->vma
-         && aux_hdrp->exec_entry < section->vma + section->_cooked_size)
+      entry = aux_hdrp->exec_entry;
+      if (entry >= section->vma
+         && entry < section->vma + section->_cooked_size)
        found = 1;
     }
   if (aux_hdrp->exec_entry == 0
@@ -1898,7 +1906,7 @@ setup_sections (abfd, file_hdr, current_offset)
     {
       struct space_dictionary_record space;
       struct subspace_dictionary_record subspace, save_subspace;
-      int subspace_index;
+      unsigned int subspace_index;
       asection *space_asect;
       char *newname;
 
@@ -2725,7 +2733,7 @@ som_write_fixups (abfd, current_offset, total_reloc_sizep)
          int reloc_offset;
          unsigned int current_rounding_mode;
 #ifndef NO_PCREL_MODES
-         int current_call_mode;
+         unsigned int current_call_mode;
 #endif
 
          /* Find a subspace of this space.  */
@@ -4298,7 +4306,7 @@ bfd_section_from_som_symbol (abfd, symbol)
          && symbol->symbol_type != ST_SEC_PROG
          && symbol->symbol_type != ST_MILLICODE))
     {
-      unsigned int index = symbol->symbol_info;
+      int index = symbol->symbol_info;
       for (section = abfd->sections; section != NULL; section = section->next)
        if (section->target_index == index && som_is_subspace (section))
          return section;
@@ -5358,7 +5366,7 @@ static bfd_boolean
 som_set_section_contents (abfd, section, location, offset, count)
      bfd *abfd;
      sec_ptr section;
-     PTR location;
+     const PTR location;
      file_ptr offset;
      bfd_size_type count;
 {
@@ -5385,7 +5393,7 @@ som_set_section_contents (abfd, section, location, offset, count)
   if (bfd_seek (abfd, offset, SEEK_SET) != 0)
     return FALSE;
 
-  if (bfd_bwrite ((PTR) location, count, abfd) != count)
+  if (bfd_bwrite (location, count, abfd) != count)
     return FALSE;
   return TRUE;
 }