summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--bfd/ChangeLog7
-rw-r--r--bfd/coff-h8300.c116
-rw-r--r--bfd/cpu-h8300.c12
-rw-r--r--bfd/elf32-h8300.c156
4 files changed, 116 insertions, 175 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index 65f62c78b9e..acef36dfb47 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -1,3 +1,10 @@
+2003-07-11 Richard Sandiford <rsandifo@redhat.com>
+
+ * elf32-h8300.c: Convert function prototypes and definitions
+ to C90 syntax.
+ * coff-h8300.c: Likewise.
+ * cpu-h8300.c: Likewise.
+
2003-07-11 Alan Modra <amodra@bigpond.net.au>
* po/SRC-POTFILES.in: Regenerate.
diff --git a/bfd/coff-h8300.c b/bfd/coff-h8300.c
index 9ef907b87df..23286f8aac6 100644
--- a/bfd/coff-h8300.c
+++ b/bfd/coff-h8300.c
@@ -61,33 +61,33 @@ struct funcvec_hash_table
static struct bfd_hash_entry *
funcvec_hash_newfunc
- PARAMS ((struct bfd_hash_entry *, struct bfd_hash_table *, const char *));
+ (struct bfd_hash_entry *, struct bfd_hash_table *, const char *);
static bfd_boolean
funcvec_hash_table_init
- PARAMS ((struct funcvec_hash_table *, bfd *,
- struct bfd_hash_entry *(*) (struct bfd_hash_entry *,
- struct bfd_hash_table *,
- const char *)));
+ (struct funcvec_hash_table *, bfd *,
+ struct bfd_hash_entry *(*) (struct bfd_hash_entry *,
+ struct bfd_hash_table *,
+ const char *));
static bfd_reloc_status_type special
- PARAMS ((bfd *, arelent *, asymbol *, PTR, asection *, bfd *, char **));
+ (bfd *, arelent *, asymbol *, PTR, asection *, bfd *, char **);
static int select_reloc
- PARAMS ((reloc_howto_type *));
+ (reloc_howto_type *);
static void rtype2howto
- PARAMS ((arelent *, struct internal_reloc *));
+ (arelent *, struct internal_reloc *);
static void reloc_processing
- PARAMS ((arelent *, struct internal_reloc *, asymbol **, bfd *, asection *));
+ (arelent *, struct internal_reloc *, asymbol **, bfd *, asection *);
static bfd_boolean h8300_symbol_address_p
- PARAMS ((bfd *, asection *, bfd_vma));
+ (bfd *, asection *, bfd_vma);
static int h8300_reloc16_estimate
- PARAMS ((bfd *, asection *, arelent *, unsigned int,
- struct bfd_link_info *));
+ (bfd *, asection *, arelent *, unsigned int,
+ struct bfd_link_info *);
static void h8300_reloc16_extra_cases
- PARAMS ((bfd *, struct bfd_link_info *, struct bfd_link_order *, arelent *,
- bfd_byte *, unsigned int *, unsigned int *));
+ (bfd *, struct bfd_link_info *, struct bfd_link_order *, arelent *,
+ bfd_byte *, unsigned int *, unsigned int *);
static bfd_boolean h8300_bfd_link_add_symbols
- PARAMS ((bfd *, struct bfd_link_info *));
+ (bfd *, struct bfd_link_info *);
/* To lookup a value in the function vector hash table. */
#define funcvec_hash_lookup(table, string, create, copy) \
@@ -111,8 +111,7 @@ struct h8300_coff_link_hash_table {
struct funcvec_hash_table *funcvec_hash_table;
};
-static struct bfd_link_hash_table *h8300_coff_link_hash_table_create
- PARAMS ((bfd *));
+static struct bfd_link_hash_table *h8300_coff_link_hash_table_create (bfd *);
/* Get the H8/300 COFF linker hash table from a link_info structure. */
@@ -123,10 +122,9 @@ static struct bfd_link_hash_table *h8300_coff_link_hash_table_create
a new entry is added to the funcvec hash table. */
static struct bfd_hash_entry *
-funcvec_hash_newfunc (entry, gen_table, string)
- struct bfd_hash_entry *entry;
- struct bfd_hash_table *gen_table;
- const char *string;
+funcvec_hash_newfunc (struct bfd_hash_entry *entry,
+ struct bfd_hash_table *gen_table,
+ const char *string)
{
struct funcvec_hash_entry *ret;
struct funcvec_hash_table *table;
@@ -171,12 +169,12 @@ funcvec_hash_newfunc (entry, gen_table, string)
/* Initialize the function vector hash table. */
static bfd_boolean
-funcvec_hash_table_init (table, abfd, newfunc)
- struct funcvec_hash_table *table;
- bfd *abfd;
- struct bfd_hash_entry *(*newfunc)
- PARAMS ((struct bfd_hash_entry *, struct bfd_hash_table *,
- const char *));
+funcvec_hash_table_init (struct funcvec_hash_table *table,
+ bfd *abfd,
+ struct bfd_hash_entry *(*newfunc)
+ (struct bfd_hash_entry *,
+ struct bfd_hash_table *,
+ const char *))
{
/* Initialize our local fields, then call the generic initialization
routine. */
@@ -190,8 +188,7 @@ funcvec_hash_table_init (table, abfd, newfunc)
without using static variables. */
static struct bfd_link_hash_table *
-h8300_coff_link_hash_table_create (abfd)
- bfd *abfd;
+h8300_coff_link_hash_table_create (bfd *abfd)
{
struct h8300_coff_link_hash_table *ret;
bfd_size_type amt = sizeof (struct h8300_coff_link_hash_table);
@@ -224,15 +221,13 @@ h8300_coff_link_hash_table_create (abfd)
the addend until the final link. */
static bfd_reloc_status_type
-special (abfd, reloc_entry, symbol, data, input_section, output_bfd,
- error_message)
- bfd *abfd ATTRIBUTE_UNUSED;
- arelent *reloc_entry ATTRIBUTE_UNUSED;
- asymbol *symbol ATTRIBUTE_UNUSED;
- PTR data ATTRIBUTE_UNUSED;
- asection *input_section ATTRIBUTE_UNUSED;
- bfd *output_bfd;
- char **error_message ATTRIBUTE_UNUSED;
+special (bfd *abfd ATTRIBUTE_UNUSED,
+ arelent *reloc_entry ATTRIBUTE_UNUSED,
+ asymbol *symbol ATTRIBUTE_UNUSED,
+ PTR data ATTRIBUTE_UNUSED,
+ asection *input_section ATTRIBUTE_UNUSED,
+ bfd *output_bfd,
+ char **error_message ATTRIBUTE_UNUSED)
{
if (output_bfd == (bfd *) NULL)
return bfd_reloc_continue;
@@ -294,8 +289,7 @@ static reloc_howto_type howto_table[] = {
dst->r_stuff[1] = 'C';
static int
-select_reloc (howto)
- reloc_howto_type *howto;
+select_reloc (reloc_howto_type *howto)
{
return howto->type;
}
@@ -303,9 +297,7 @@ select_reloc (howto)
/* Code to turn a r_type into a howto ptr, uses the above howto table. */
static void
-rtype2howto (internal, dst)
- arelent *internal;
- struct internal_reloc *dst;
+rtype2howto (arelent *internal, struct internal_reloc *dst)
{
switch (dst->r_type)
{
@@ -386,12 +378,8 @@ rtype2howto (internal, dst)
reloc_processing (relent, reloc, symbols, abfd, section)
static void
-reloc_processing (relent, reloc, symbols, abfd, section)
- arelent *relent;
- struct internal_reloc *reloc;
- asymbol **symbols;
- bfd *abfd;
- asection *section;
+reloc_processing (arelent *relent, struct internal_reloc *reloc,
+ asymbol **symbols, bfd *abfd, asection *section)
{
relent->address = reloc->r_vaddr;
rtype2howto (relent, reloc);
@@ -410,10 +398,7 @@ reloc_processing (relent, reloc, symbols, abfd, section)
}
static bfd_boolean
-h8300_symbol_address_p (abfd, input_section, address)
- bfd *abfd;
- asection *input_section;
- bfd_vma address;
+h8300_symbol_address_p (bfd *abfd, asection *input_section, bfd_vma address)
{
asymbol **s;
@@ -445,12 +430,8 @@ h8300_symbol_address_p (abfd, input_section, address)
in the howto table. This needs to be fixed. */
static int
-h8300_reloc16_estimate (abfd, input_section, reloc, shrink, link_info)
- bfd *abfd;
- asection *input_section;
- arelent *reloc;
- unsigned int shrink;
- struct bfd_link_info *link_info;
+h8300_reloc16_estimate (bfd *abfd, asection *input_section, arelent *reloc,
+ unsigned int shrink, struct bfd_link_info *link_info)
{
bfd_vma value;
bfd_vma dot;
@@ -676,15 +657,10 @@ h8300_reloc16_estimate (abfd, input_section, reloc, shrink, link_info)
FIXME: Not all relocations check for overflow! */
static void
-h8300_reloc16_extra_cases (abfd, link_info, link_order, reloc, data, src_ptr,
- dst_ptr)
- bfd *abfd;
- struct bfd_link_info *link_info;
- struct bfd_link_order *link_order;
- arelent *reloc;
- bfd_byte *data;
- unsigned int *src_ptr;
- unsigned int *dst_ptr;
+h8300_reloc16_extra_cases (bfd *abfd, struct bfd_link_info *link_info,
+ struct bfd_link_order *link_order, arelent *reloc,
+ bfd_byte *data, unsigned int *src_ptr,
+ unsigned int *dst_ptr)
{
unsigned int src_address = *src_ptr;
unsigned int dst_address = *dst_ptr;
@@ -1221,9 +1197,7 @@ h8300_reloc16_extra_cases (abfd, link_info, link_order, reloc, data, src_ptr,
selected static symbols to the bfd linker hash table. */
static bfd_boolean
-h8300_bfd_link_add_symbols (abfd, info)
- bfd *abfd;
- struct bfd_link_info *info;
+h8300_bfd_link_add_symbols (bfd *abfd, struct bfd_link_info *info)
{
asection *sec;
struct funcvec_hash_table *funcvec_hash_table;
diff --git a/bfd/cpu-h8300.c b/bfd/cpu-h8300.c
index e1c77bfe2e6..6ed0fff3638 100644
--- a/bfd/cpu-h8300.c
+++ b/bfd/cpu-h8300.c
@@ -24,14 +24,12 @@
#include "libbfd.h"
static bfd_boolean h8300_scan
- PARAMS ((const struct bfd_arch_info *, const char *));
+ (const struct bfd_arch_info *, const char *);
static const bfd_arch_info_type * compatible
- PARAMS ((const bfd_arch_info_type *, const bfd_arch_info_type *));
+ (const bfd_arch_info_type *, const bfd_arch_info_type *);
static bfd_boolean
-h8300_scan (info, string)
- const struct bfd_arch_info *info;
- const char *string;
+h8300_scan (const struct bfd_arch_info *info, const char *string)
{
if (*string != 'h' && *string != 'H')
return FALSE;
@@ -101,9 +99,7 @@ h8300_scan (info, string)
info structure. */
static const bfd_arch_info_type *
-compatible (in, out)
- const bfd_arch_info_type *in;
- const bfd_arch_info_type *out;
+compatible (const bfd_arch_info_type *in, const bfd_arch_info_type *out)
{
/* It's really not a good idea to mix and match modes. */
if (in->arch != out->arch || in->mach != out->mach)
diff --git a/bfd/elf32-h8300.c b/bfd/elf32-h8300.c
index 386c92ff241..8d305eb34dd 100644
--- a/bfd/elf32-h8300.c
+++ b/bfd/elf32-h8300.c
@@ -25,38 +25,38 @@
#include "elf/h8.h"
static reloc_howto_type *elf32_h8_reloc_type_lookup
- PARAMS ((bfd *abfd, bfd_reloc_code_real_type code));
+ (bfd *abfd, bfd_reloc_code_real_type code);
static void elf32_h8_info_to_howto
- PARAMS ((bfd *, arelent *, Elf_Internal_Rela *));
+ (bfd *, arelent *, Elf_Internal_Rela *);
static void elf32_h8_info_to_howto_rel
- PARAMS ((bfd *, arelent *, Elf_Internal_Rela *));
+ (bfd *, arelent *, Elf_Internal_Rela *);
static unsigned long elf32_h8_mach
- PARAMS ((flagword));
+ (flagword);
static void elf32_h8_final_write_processing
- PARAMS ((bfd *, bfd_boolean));
+ (bfd *, bfd_boolean);
static bfd_boolean elf32_h8_object_p
- PARAMS ((bfd *));
+ (bfd *);
static bfd_boolean elf32_h8_merge_private_bfd_data
- PARAMS ((bfd *, bfd *));
+ (bfd *, bfd *);
static bfd_boolean elf32_h8_relax_section
- PARAMS ((bfd *, asection *, struct bfd_link_info *, bfd_boolean *));
+ (bfd *, asection *, struct bfd_link_info *, bfd_boolean *);
static bfd_boolean elf32_h8_relax_delete_bytes
- PARAMS ((bfd *, asection *, bfd_vma, int));
+ (bfd *, asection *, bfd_vma, int);
static bfd_boolean elf32_h8_symbol_address_p
- PARAMS ((bfd *, asection *, bfd_vma));
+ (bfd *, asection *, bfd_vma);
static bfd_byte *elf32_h8_get_relocated_section_contents
- PARAMS ((bfd *, struct bfd_link_info *, struct bfd_link_order *,
- bfd_byte *, bfd_boolean, asymbol **));
+ (bfd *, struct bfd_link_info *, struct bfd_link_order *,
+ bfd_byte *, bfd_boolean, asymbol **);
static bfd_reloc_status_type elf32_h8_final_link_relocate
- PARAMS ((unsigned long, bfd *, bfd *, asection *,
- bfd_byte *, bfd_vma, bfd_vma, bfd_vma,
- struct bfd_link_info *, asection *, int));
+ (unsigned long, bfd *, bfd *, asection *,
+ bfd_byte *, bfd_vma, bfd_vma, bfd_vma,
+ struct bfd_link_info *, asection *, int);
static bfd_boolean elf32_h8_relocate_section
- PARAMS ((bfd *, struct bfd_link_info *, bfd *, asection *,
- bfd_byte *, Elf_Internal_Rela *,
- Elf_Internal_Sym *, asection **));
+ (bfd *, struct bfd_link_info *, bfd *, asection *,
+ bfd_byte *, Elf_Internal_Rela *,
+ Elf_Internal_Sym *, asection **);
static bfd_reloc_status_type special
- PARAMS ((bfd *, arelent *, asymbol *, PTR, asection *, bfd *, char **));
+ (bfd *, arelent *, asymbol *, PTR, asection *, bfd *, char **);
/* This does not include any relocation information, but should be
good enough for GDB or objdump to read the file. */
@@ -243,9 +243,8 @@ static const struct elf_reloc_map h8_reloc_map[] = {
static reloc_howto_type *
-elf32_h8_reloc_type_lookup (abfd, code)
- bfd *abfd ATTRIBUTE_UNUSED;
- bfd_reloc_code_real_type code;
+elf32_h8_reloc_type_lookup (bfd *abfd ATTRIBUTE_UNUSED,
+ bfd_reloc_code_real_type code)
{
unsigned int i;
@@ -258,10 +257,8 @@ elf32_h8_reloc_type_lookup (abfd, code)
}
static void
-elf32_h8_info_to_howto (abfd, bfd_reloc, elf_reloc)
- bfd *abfd ATTRIBUTE_UNUSED;
- arelent *bfd_reloc;
- Elf_Internal_Rela *elf_reloc;
+elf32_h8_info_to_howto (bfd *abfd ATTRIBUTE_UNUSED, arelent *bfd_reloc,
+ Elf_Internal_Rela *elf_reloc)
{
unsigned int r;
unsigned int i;
@@ -277,10 +274,8 @@ elf32_h8_info_to_howto (abfd, bfd_reloc, elf_reloc)
}
static void
-elf32_h8_info_to_howto_rel (abfd, bfd_reloc, elf_reloc)
- bfd *abfd ATTRIBUTE_UNUSED;
- arelent *bfd_reloc;
- Elf_Internal_Rela *elf_reloc ATTRIBUTE_UNUSED;
+elf32_h8_info_to_howto_rel (bfd *abfd ATTRIBUTE_UNUSED, arelent *bfd_reloc,
+ Elf_Internal_Rela *elf_reloc ATTRIBUTE_UNUSED)
{
unsigned int r;
@@ -294,15 +289,13 @@ elf32_h8_info_to_howto_rel (abfd, bfd_reloc, elf_reloc)
When doing -r, we can't do any arithmetic for the pcrel stuff, because
we support relaxing on the H8/300 series chips. */
static bfd_reloc_status_type
-special (abfd, reloc_entry, symbol, data, input_section, output_bfd,
- error_message)
- bfd *abfd ATTRIBUTE_UNUSED;
- arelent *reloc_entry ATTRIBUTE_UNUSED;
- asymbol *symbol ATTRIBUTE_UNUSED;
- PTR data ATTRIBUTE_UNUSED;
- asection *input_section ATTRIBUTE_UNUSED;
- bfd *output_bfd;
- char **error_message ATTRIBUTE_UNUSED;
+special (bfd *abfd ATTRIBUTE_UNUSED,
+ arelent *reloc_entry ATTRIBUTE_UNUSED,
+ asymbol *symbol ATTRIBUTE_UNUSED,
+ PTR data ATTRIBUTE_UNUSED,
+ asection *input_section ATTRIBUTE_UNUSED,
+ bfd *output_bfd,
+ char **error_message ATTRIBUTE_UNUSED)
{
if (output_bfd == (bfd *) NULL)
return bfd_reloc_continue;
@@ -314,26 +307,19 @@ special (abfd, reloc_entry, symbol, data, input_section, output_bfd,
/* Perform a relocation as part of a final link. */
static bfd_reloc_status_type
-elf32_h8_final_link_relocate (r_type, input_bfd, output_bfd,
- input_section, contents, offset, value,
- addend, info, sym_sec, is_local)
- unsigned long r_type;
- bfd *input_bfd;
- bfd *output_bfd ATTRIBUTE_UNUSED;
- asection *input_section ATTRIBUTE_UNUSED;
- bfd_byte *contents;
- bfd_vma offset;
- bfd_vma value;
- bfd_vma addend;
- struct bfd_link_info *info ATTRIBUTE_UNUSED;
- asection *sym_sec ATTRIBUTE_UNUSED;
- int is_local ATTRIBUTE_UNUSED;
+elf32_h8_final_link_relocate (unsigned long r_type, bfd *input_bfd,
+ bfd *output_bfd ATTRIBUTE_UNUSED,
+ asection *input_section ATTRIBUTE_UNUSED,
+ bfd_byte *contents, bfd_vma offset,
+ bfd_vma value, bfd_vma addend,
+ struct bfd_link_info *info ATTRIBUTE_UNUSED,
+ asection *sym_sec ATTRIBUTE_UNUSED,
+ int is_local ATTRIBUTE_UNUSED)
{
bfd_byte *hit_data = contents + offset;
switch (r_type)
{
-
case R_H8_NONE:
return bfd_reloc_ok;
@@ -411,16 +397,11 @@ elf32_h8_final_link_relocate (r_type, input_bfd, output_bfd,
/* Relocate an H8 ELF section. */
static bfd_boolean
-elf32_h8_relocate_section (output_bfd, info, input_bfd, input_section,
- contents, relocs, local_syms, local_sections)
- bfd *output_bfd;
- struct bfd_link_info *info;
- bfd *input_bfd;
- asection *input_section;
- bfd_byte *contents;
- Elf_Internal_Rela *relocs;
- Elf_Internal_Sym *local_syms;
- asection **local_sections;
+elf32_h8_relocate_section (bfd *output_bfd, struct bfd_link_info *info,
+ bfd *input_bfd, asection *input_section,
+ bfd_byte *contents, Elf_Internal_Rela *relocs,
+ Elf_Internal_Sym *local_syms,
+ asection **local_sections)
{
Elf_Internal_Shdr *symtab_hdr;
struct elf_link_hash_entry **sym_hashes;
@@ -559,8 +540,7 @@ elf32_h8_relocate_section (output_bfd, info, input_bfd, input_section,
Examine that field and return the proper BFD machine type for
the object file. */
static unsigned long
-elf32_h8_mach (flags)
- flagword flags;
+elf32_h8_mach (flagword flags)
{
switch (flags & EF_H8_MACH)
{
@@ -593,9 +573,8 @@ elf32_h8_mach (flags)
into the flags field in the object file. */
static void
-elf32_h8_final_write_processing (abfd, linker)
- bfd *abfd;
- bfd_boolean linker ATTRIBUTE_UNUSED;
+elf32_h8_final_write_processing (bfd *abfd,
+ bfd_boolean linker ATTRIBUTE_UNUSED)
{
unsigned long val;
@@ -639,8 +618,7 @@ elf32_h8_final_write_processing (abfd, linker)
record the encoded machine type found in the ELF flags. */
static bfd_boolean
-elf32_h8_object_p (abfd)
- bfd *abfd;
+elf32_h8_object_p (bfd *abfd)
{
bfd_default_set_arch_mach (abfd, bfd_arch_h8300,
elf32_h8_mach (elf_elfheader (abfd)->e_flags));
@@ -652,9 +630,7 @@ elf32_h8_object_p (abfd)
time is the architecture/machine information. */
static bfd_boolean
-elf32_h8_merge_private_bfd_data (ibfd, obfd)
- bfd *ibfd;
- bfd *obfd;
+elf32_h8_merge_private_bfd_data (bfd *ibfd, bfd *obfd)
{
if (bfd_get_flavour (ibfd) != bfd_target_elf_flavour
|| bfd_get_flavour (obfd) != bfd_target_elf_flavour)
@@ -689,11 +665,8 @@ elf32_h8_merge_private_bfd_data (ibfd, obfd)
mov.[bwl]:24/32 -> mov.[bwl]:16 2 bytes */
static bfd_boolean
-elf32_h8_relax_section (abfd, sec, link_info, again)
- bfd *abfd;
- asection *sec;
- struct bfd_link_info *link_info;
- bfd_boolean *again;
+elf32_h8_relax_section (bfd *abfd, asection *sec,
+ struct bfd_link_info *link_info, bfd_boolean *again)
{
Elf_Internal_Shdr *symtab_hdr;
Elf_Internal_Rela *internal_relocs;
@@ -1252,11 +1225,7 @@ elf32_h8_relax_section (abfd, sec, link_info, again)
/* Delete some bytes from a section while relaxing. */
static bfd_boolean
-elf32_h8_relax_delete_bytes (abfd, sec, addr, count)
- bfd *abfd;
- asection *sec;
- bfd_vma addr;
- int count;
+elf32_h8_relax_delete_bytes (bfd *abfd, asection *sec, bfd_vma addr, int count)
{
Elf_Internal_Shdr *symtab_hdr;
unsigned int sec_shndx;
@@ -1333,10 +1302,7 @@ elf32_h8_relax_delete_bytes (abfd, sec, addr, count)
/* Return TRUE if a symbol exists at the given address, else return
FALSE. */
static bfd_boolean
-elf32_h8_symbol_address_p (abfd, sec, addr)
- bfd *abfd;
- asection *sec;
- bfd_vma addr;
+elf32_h8_symbol_address_p (bfd *abfd, asection *sec, bfd_vma addr)
{
Elf_Internal_Shdr *symtab_hdr;
unsigned int sec_shndx;
@@ -1380,14 +1346,12 @@ elf32_h8_symbol_address_p (abfd, sec, addr)
which uses elf32_h8_relocate_section. */
static bfd_byte *
-elf32_h8_get_relocated_section_contents (output_bfd, link_info, link_order,
- data, relocatable, symbols)
- bfd *output_bfd;
- struct bfd_link_info *link_info;
- struct bfd_link_order *link_order;
- bfd_byte *data;
- bfd_boolean relocatable;
- asymbol **symbols;
+elf32_h8_get_relocated_section_contents (bfd *output_bfd,
+ struct bfd_link_info *link_info,
+ struct bfd_link_order *link_order,
+ bfd_byte *data,
+ bfd_boolean relocatable,
+ asymbol **symbols)
{
Elf_Internal_Shdr *symtab_hdr;
asection *input_section = link_order->u.indirect.section;