summaryrefslogtreecommitdiff
path: root/bfd
diff options
context:
space:
mode:
authorNick Clifton <nickc@redhat.com>2000-12-21 18:40:21 +0000
committerNick Clifton <nickc@redhat.com>2000-12-21 18:40:21 +0000
commitcc9ed9da96321ceab2f68cb5ea8084bc58519372 (patch)
tree1cf66ef65f5e8f426f2eb3013db93e9adf18da3c /bfd
parent3af5b728ebcfe35309f82e97ee758aef0f7025e4 (diff)
downloadgdb-cc9ed9da96321ceab2f68cb5ea8084bc58519372.tar.gz
Fixes to allow sources to compile under Solaris 2.8
Diffstat (limited to 'bfd')
-rw-r--r--bfd/ChangeLog13
-rw-r--r--bfd/coff-rs6000.c11
-rw-r--r--bfd/coffcode.h4
-rw-r--r--bfd/elf32-fr30.c6
-rw-r--r--bfd/elf32-m32r.c4
-rw-r--r--bfd/peicode.h8
-rw-r--r--bfd/po/bfd.pot18
-rw-r--r--bfd/vms-hdr.c3
8 files changed, 43 insertions, 24 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index 4830e2bc35d..675ef88c04f 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -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
diff --git a/bfd/coff-rs6000.c b/bfd/coff-rs6000.c
index 23a1d9ec17a..da0e1476d60 100644
--- a/bfd/coff-rs6000.c
+++ b/bfd/coff-rs6000.c
@@ -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;
diff --git a/bfd/coffcode.h b/bfd/coffcode.h
index 1dac3c3ac1b..05eba024bf1 100644
--- a/bfd/coffcode.h
+++ b/bfd/coffcode.h
@@ -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. */
+ ;
}
}
diff --git a/bfd/elf32-fr30.c b/bfd/elf32-fr30.c
index f2b4b445cff..526212b9699 100644
--- a/bfd/elf32-fr30.c
+++ b/bfd/elf32-fr30.c
@@ -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;
}
diff --git a/bfd/elf32-m32r.c b/bfd/elf32-m32r.c
index 307bdc7a740..5b2d63f1c66 100644
--- a/bfd/elf32-m32r.c
+++ b/bfd/elf32-m32r.c
@@ -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) | \
diff --git a/bfd/peicode.h b/bfd/peicode.h
index 9071c72b29e..22ddb2a3596 100644
--- a/bfd/peicode.h
+++ b/bfd/peicode.h
@@ -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;
diff --git a/bfd/po/bfd.pot b/bfd/po/bfd.pot
index 200979132aa..bf17e1d718a 100644
--- a/bfd/po/bfd.pot
+++ b/bfd/po/bfd.pot
@@ -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 ""
diff --git a/bfd/vms-hdr.c b/bfd/vms-hdr.c
index 3b36b3278c5..6758be6cf16 100644
--- a/bfd/vms-hdr.c
+++ b/bfd/vms-hdr.c
@@ -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
/*---------------------------------------------------------------------------*/