OSDN Git Service

Fixes to allow sources to compile under Solaris 2.8
authornickc <nickc>
Thu, 21 Dec 2000 18:40:20 +0000 (18:40 +0000)
committernickc <nickc>
Thu, 21 Dec 2000 18:40:20 +0000 (18:40 +0000)
bfd/ChangeLog
bfd/coff-rs6000.c
bfd/coffcode.h
bfd/elf32-fr30.c
bfd/elf32-m32r.c
bfd/peicode.h
bfd/po/bfd.pot
bfd/vms-hdr.c

index 4830e2b..675ef88 100644 (file)
@@ -1,3 +1,16 @@
+2000-12-21  Santeri Paavolainen <santtu@ssh.com>
+
+       * vms-hdr.c: Include alloca.h if HAVE_ALLOCA_H is defined.
+
+       * peicode.h (pe_ILF_object_p): Add const to import of TARGET_LITTLE_SYM.
+
+       * elf32-m32r.c (m32r_elf_generic_reloc): Add cast to avoid (void *)
+       arithmetic.
+
+       * elf32-fr30.c: Add casts to avoid (void *) arithmetic.
+
+       * coffcode.h (styp_to_sec_flags): Add empty statement after label.
+
 2000-12-21  Richard Sandiford  <rsandifo@redhat.com>
 
        * libbfd.c (bfd_get_bits): Added
index 23a1d9e..da0e147 100644 (file)
@@ -1643,9 +1643,9 @@ xcoff_write_one_armap_big (abfd, map, orl_count, orl_ccount, stridx, bits64,
   struct xcoff_ar_hdr_big hdr;
   char *p;
   unsigned char buf[4];
+  const bfd_arch_info_type *arch_info = NULL;
   bfd *sub;
   file_ptr fileoff;
-  const bfd_arch_info_type *arch_info;
   bfd *object_bfd;
   unsigned int i;
 
@@ -1657,7 +1657,7 @@ xcoff_write_one_armap_big (abfd, map, orl_count, orl_ccount, stridx, bits64,
   if (bits64)
     sprintf (hdr.nextoff, "%d", 0);
   else
-    sprintf (hdr.nextoff, "%d", (strtol (prevoff, (char **) NULL, 10)
+    sprintf (hdr.nextoff, "%ld", (strtol (prevoff, (char **) NULL, 10)
                                 + 4 + orl_ccount * 4 + stridx));
   memcpy (hdr.prevoff, prevoff, sizeof (hdr.prevoff));
   sprintf (hdr.date, "%d", 0);
@@ -1719,7 +1719,8 @@ xcoff_write_one_armap_big (abfd, map, orl_count, orl_ccount, stridx, bits64,
 
       if (ob != object_bfd)
        arch_info = bfd_get_arch_info (ob);
-      if ((arch_info->bits_per_address == 64) != bits64)
+
+      if (arch_info && (arch_info->bits_per_address == 64) != bits64)
        continue;
 
       name = *map[i].name;
@@ -1751,7 +1752,7 @@ xcoff_write_armap_big (abfd, elength, map, orl_count, stridx)
   unsigned int i;
   unsigned int orl_count_32, orl_count_64;
   unsigned int stridx_32, stridx_64;
-  const bfd_arch_info_type *arch_info;
+  const bfd_arch_info_type *arch_info = NULL;
   bfd *object_bfd;
 
   /* First, we look through the symbols and work out which are
@@ -1768,7 +1769,7 @@ xcoff_write_armap_big (abfd, elength, map, orl_count, stridx)
       if (ob != object_bfd)
        arch_info = bfd_get_arch_info (ob);
       len = strlen (*map[i].name) + 1;
-      if (arch_info->bits_per_address == 64)
+      if (arch_info && arch_info->bits_per_address == 64)
        {
          orl_count_64++;
          stridx_64 += len;
index 1dac3c3..05eba02 100644 (file)
@@ -1017,7 +1017,9 @@ styp_to_sec_flags (abfd, hdr, name, section)
 
              esym += (isym.n_numaux + 1) * bfd_coff_symesz (abfd);
            }
-         breakloop:
+       breakloop:
+         /* SunOS requires a statement after any label.  */
+         ;
        }
     }
 
index f2b4b44..526212b 100644 (file)
@@ -278,9 +278,9 @@ fr30_elf_i20_reloc (abfd, reloc_entry, symbol, data,
   if (relocation > (((bfd_vma) 1 << 20) - 1))
     return bfd_reloc_overflow;
 
-  x = bfd_get_32 (abfd, data + reloc_entry->address);
+  x = bfd_get_32 (abfd, (char *) data + reloc_entry->address);
   x = (x & 0xff0f0000) | (relocation & 0x0000ffff) | ((relocation & 0x000f0000) << 4);
-  bfd_put_32 (abfd, x, data + reloc_entry->address);
+  bfd_put_32 (abfd, x, (char *) data + reloc_entry->address);
 
   return bfd_reloc_ok;
 }
@@ -321,7 +321,7 @@ fr30_elf_i32_reloc (abfd, reloc_entry, symbol, data,
     + symbol->section->output_offset
     + reloc_entry->addend;
 
-  bfd_put_32 (abfd, relocation, data + reloc_entry->address + 2);
+  bfd_put_32 (abfd, relocation, (char *) data + reloc_entry->address + 2);
 
   return bfd_reloc_ok;
 }
index 307bdc7..5b2d63f 100644 (file)
@@ -578,7 +578,7 @@ m32r_elf_generic_reloc (input_bfd, reloc_entry, symbol, data,
      PTR data;
      asection *input_section;
      bfd *output_bfd;
-     char **error_message;
+     char **error_message ATTRIBUTE_UNUSED;
 {
   bfd_reloc_status_type ret;
   bfd_vma relocation;
@@ -624,7 +624,7 @@ m32r_elf_generic_reloc (input_bfd, reloc_entry, symbol, data,
     }
 
   relocation += reloc_entry->addend;
-  inplace_address = data + reloc_entry->address;
+  inplace_address = (bfd_byte *) data + reloc_entry->address;
 
 #define DOIT(x)                                        \
   x = ( (x & ~reloc_entry->howto->dst_mask) |          \
index 9071c72..22ddb2a 100644 (file)
@@ -137,7 +137,7 @@ static asection_ptr       pe_ILF_make_a_section   PARAMS ((pe_ILF_vars *, const
 static void               pe_ILF_make_a_reloc     PARAMS ((pe_ILF_vars *, bfd_vma, bfd_reloc_code_real_type, asection_ptr));
 static void               pe_ILF_make_a_symbol    PARAMS ((pe_ILF_vars *, const char *, const char *, asection_ptr, flagword));
 static void               pe_ILF_save_relocs      PARAMS ((pe_ILF_vars *, asection_ptr));
-static void              pe_ILF_make_a_symbol_reloc  PARAMS ((pe_ILF_vars *, bfd_vma, bfd_reloc_code_real_type,           struct symbol_cache_entry **, unsigned int));
+static void              pe_ILF_make_a_symbol_reloc  PARAMS ((pe_ILF_vars *, bfd_vma, bfd_reloc_code_real_type, struct symbol_cache_entry **, unsigned int));
 static boolean            pe_ILF_build_a_bfd      PARAMS ((bfd *, unsigned short, bfd_byte *, bfd_byte *, unsigned int, unsigned int));
 static const bfd_target * pe_ILF_object_p         PARAMS ((bfd *));
 static const bfd_target * pe_bfd_object_p        PARAMS ((bfd *));
@@ -989,10 +989,10 @@ pe_ILF_build_a_bfd (bfd *           abfd,
       if (magic == MIPS_ARCH_MAGIC_WINCE)
        {
          pe_ILF_make_a_symbol_reloc (& vars, 0, BFD_RELOC_HI16_S,
-                                     (asection **) imp_sym, imp_index);
+                                     (struct symbol_cache_entry **) imp_sym, imp_index);
          pe_ILF_make_a_reloc (& vars, 0, BFD_RELOC_LO16, text);
          pe_ILF_make_a_symbol_reloc (& vars, 4, BFD_RELOC_LO16,
-                                     (asection **) imp_sym, imp_index);
+                                     (struct symbol_cache_entry **) imp_sym, imp_index);
        }
       else
 #endif
@@ -1169,7 +1169,7 @@ pe_ILF_object_p (bfd * abfd)
     case IMAGE_FILE_MACHINE_THUMB:
 #ifdef THUMBPEMAGIC
       {
-       extern bfd_target TARGET_LITTLE_SYM;
+       extern const bfd_target TARGET_LITTLE_SYM;
        
        if (abfd->xvec == & TARGET_LITTLE_SYM)
          magic = THUMBPEMAGIC;
index 2009791..bf17e1d 100644 (file)
@@ -6,7 +6,7 @@
 msgid ""
 msgstr ""
 "Project-Id-Version: PACKAGE VERSION\n"
-"POT-Creation-Date: 2000-12-21 10:12-0800\n"
+"POT-Creation-Date: 2000-12-21 10:38-0800\n"
 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
 "Language-Team: LANGUAGE <LL@li.org>\n"
@@ -326,37 +326,37 @@ msgstr ""
 msgid "Warning: Clearing the interworking flag of %s due to outside request"
 msgstr ""
 
-#: coffcode.h:2134
+#: coffcode.h:2136
 #, c-format
 msgid "Unrecognized TI COFF target id '0x%x'"
 msgstr ""
 
-#: coffcode.h:4192
+#: coffcode.h:4194
 #, c-format
 msgid "%s: warning: illegal symbol index %ld in line numbers"
 msgstr ""
 
-#: coffcode.h:4206
+#: coffcode.h:4208
 #, c-format
 msgid "%s: warning: duplicate line number information for `%s'"
 msgstr ""
 
-#: coffcode.h:4566
+#: coffcode.h:4568
 #, c-format
 msgid "%s: Unrecognized storage class %d for %s symbol `%s'"
 msgstr ""
 
-#: coffcode.h:4697
+#: coffcode.h:4699
 #, c-format
 msgid "warning: %s: local symbol `%s' has no section"
 msgstr ""
 
-#: coff-tic54x.c:376 coffcode.h:4808
+#: coff-tic54x.c:376 coffcode.h:4810
 #, c-format
 msgid "%s: warning: illegal symbol index %ld in relocs"
 msgstr ""
 
-#: coffcode.h:4846
+#: coffcode.h:4848
 #, c-format
 msgid "%s: illegal relocation type %d at address 0x%lx"
 msgstr ""
@@ -1893,7 +1893,7 @@ msgstr ""
 msgid "unknown gsd/egsd subtype %d"
 msgstr ""
 
-#: vms-hdr.c:405
+#: vms-hdr.c:408
 msgid "Object module NOT error-free !\n"
 msgstr ""
 
index 3b36b32..6758be6 100644 (file)
@@ -33,6 +33,9 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
 
 #include "vms.h"
 
+#ifdef HAVE_ALLOCA_H
+#include <alloca.h>
+#endif
 /*---------------------------------------------------------------------------*/