Convert to ISO C90 formatting

This commit is contained in:
Nick Clifton 2005-06-03 10:13:15 +00:00
parent e1fffbe6e9
commit ce71b57665
2 changed files with 108 additions and 116 deletions

View file

@ -1,3 +1,31 @@
2005-06-03 Jan-Benedict Glaw <jbglaw@lug-owl.de>
* elf32-vax.c (rtype_to_howto): Remove PARAMS.
(reloc_type_lookup): Dito.
(elf_vax_discard_copies): Dito.
(elf_vax_instantiate_got_entries): Dito.
(elf_vax_link_hash_traverse): Dito.
(elf_vax_link_hash_newfunc): Dito.
(elf_vax_link_hash_table_create): Dito.
(elf32_vax_set_private_flags): Dito.
(elf32_vax_merge_private_bfd_data): Dito.
(elf32_vax_print_private_bfd_data): Dito.
(elf_vax_check_relocs): Dito.
(elf_vax_gc_mark_hook): Dito.
(elf_vax_gc_sweep_hook): Dito.
(elf_vax_size_dynamic_sections): Dito.
(elf_vax_discard_copies): Dito.
(elf_vax_instantiate_got_entries): Dito.
(elf_vax_relocate_section): Dito.
(elf_vax_finish_dynamic_symbol): Dito.
(elf_vax_finish_dynamic_sections): Dito.
(elf_vax_hash_table): Break-up of line isn't needed.
(elf_vax_check_relocs): Remove leading whitespace
(elf_vax_relocate_section): Remove redundant whitespace
(elf_vax_link_hash_newfunc): Don't cast NULL.
(elf_vax_link_hash_table_create): Dito.
* cpu-vax.c (bfd_vax_arch) Remove a trailing space.
2005-06-03 Alan Modra <amodra@bigpond.net.au> 2005-06-03 Alan Modra <amodra@bigpond.net.au>
PR 568 PR 568

View file

@ -26,42 +26,37 @@
#include "elf-bfd.h" #include "elf-bfd.h"
#include "elf/vax.h" #include "elf/vax.h"
static reloc_howto_type *reloc_type_lookup static reloc_howto_type *reloc_type_lookup (bfd *, bfd_reloc_code_real_type);
PARAMS ((bfd *, bfd_reloc_code_real_type)); static void rtype_to_howto (bfd *, arelent *, Elf_Internal_Rela *);
static void rtype_to_howto static struct bfd_hash_entry *elf_vax_link_hash_newfunc (struct bfd_hash_entry *,
PARAMS ((bfd *, arelent *, Elf_Internal_Rela *)); struct bfd_hash_table *,
static struct bfd_hash_entry *elf_vax_link_hash_newfunc const char *);
PARAMS ((struct bfd_hash_entry *, struct bfd_hash_table *, const char *)); static struct bfd_link_hash_table *elf_vax_link_hash_table_create (bfd *);
static struct bfd_link_hash_table *elf_vax_link_hash_table_create static bfd_boolean elf_vax_check_relocs (bfd *, struct bfd_link_info *,
PARAMS ((bfd *)); asection *, const Elf_Internal_Rela *);
static bfd_boolean elf_vax_check_relocs static asection *elf_vax_gc_mark_hook (asection *, struct bfd_link_info *,
PARAMS ((bfd *, struct bfd_link_info *, asection *, Elf_Internal_Rela *,
const Elf_Internal_Rela *)); struct elf_link_hash_entry *,
static asection *elf_vax_gc_mark_hook Elf_Internal_Sym *);
PARAMS ((asection *, struct bfd_link_info *, Elf_Internal_Rela *, static bfd_boolean elf_vax_gc_sweep_hook (bfd *, struct bfd_link_info *,
struct elf_link_hash_entry *, Elf_Internal_Sym *)); asection *,
static bfd_boolean elf_vax_gc_sweep_hook const Elf_Internal_Rela *);
PARAMS ((bfd *, struct bfd_link_info *, asection *, static bfd_boolean elf_vax_adjust_dynamic_symbol (struct bfd_link_info *,
const Elf_Internal_Rela *)); struct elf_link_hash_entry *);
static bfd_boolean elf_vax_adjust_dynamic_symbol static bfd_boolean elf_vax_size_dynamic_sections (bfd *, struct bfd_link_info *);
PARAMS ((struct bfd_link_info *, struct elf_link_hash_entry *)); static bfd_boolean elf_vax_relocate_section (bfd *, struct bfd_link_info *,
static bfd_boolean elf_vax_size_dynamic_sections bfd *, asection *, bfd_byte *,
PARAMS ((bfd *, struct bfd_link_info *)); Elf_Internal_Rela *,
static bfd_boolean elf_vax_relocate_section Elf_Internal_Sym *, asection **);
PARAMS ((bfd *, struct bfd_link_info *, bfd *, asection *, bfd_byte *, static bfd_boolean elf_vax_finish_dynamic_symbol (bfd *, struct bfd_link_info *,
Elf_Internal_Rela *, Elf_Internal_Sym *, asection **)); struct elf_link_hash_entry *,
static bfd_boolean elf_vax_finish_dynamic_symbol Elf_Internal_Sym *);
PARAMS ((bfd *, struct bfd_link_info *, struct elf_link_hash_entry *, static bfd_boolean elf_vax_finish_dynamic_sections (bfd *,
Elf_Internal_Sym *)); struct bfd_link_info *);
static bfd_boolean elf_vax_finish_dynamic_sections
PARAMS ((bfd *, struct bfd_link_info *));
static bfd_boolean elf32_vax_set_private_flags static bfd_boolean elf32_vax_set_private_flags (bfd *, flagword);
PARAMS ((bfd *, flagword)); static bfd_boolean elf32_vax_merge_private_bfd_data (bfd *, bfd *);
static bfd_boolean elf32_vax_merge_private_bfd_data static bfd_boolean elf32_vax_print_private_bfd_data (bfd *, PTR);
PARAMS ((bfd *, bfd *));
static bfd_boolean elf32_vax_print_private_bfd_data
PARAMS ((bfd *, PTR));
static reloc_howto_type howto_table[] = { static reloc_howto_type howto_table[] = {
HOWTO (R_VAX_NONE, /* type */ HOWTO (R_VAX_NONE, /* type */
@ -290,10 +285,8 @@ static reloc_howto_type howto_table[] = {
}; };
static void static void
rtype_to_howto (abfd, cache_ptr, dst) rtype_to_howto (bfd *abfd ATTRIBUTE_UNUSED, arelent *cache_ptr,
bfd *abfd ATTRIBUTE_UNUSED; Elf_Internal_Rela *dst)
arelent *cache_ptr;
Elf_Internal_Rela *dst;
{ {
BFD_ASSERT (ELF32_R_TYPE(dst->r_info) < (unsigned int) R_VAX_max); BFD_ASSERT (ELF32_R_TYPE(dst->r_info) < (unsigned int) R_VAX_max);
cache_ptr->howto = &howto_table[ELF32_R_TYPE(dst->r_info)]; cache_ptr->howto = &howto_table[ELF32_R_TYPE(dst->r_info)];
@ -325,9 +318,7 @@ static const struct
}; };
static reloc_howto_type * static reloc_howto_type *
reloc_type_lookup (abfd, code) reloc_type_lookup (bfd *abfd ATTRIBUTE_UNUSED, bfd_reloc_code_real_type code)
bfd *abfd ATTRIBUTE_UNUSED;
bfd_reloc_code_real_type code;
{ {
unsigned int i; unsigned int i;
for (i = 0; i < sizeof (reloc_map) / sizeof (reloc_map[0]); i++) for (i = 0; i < sizeof (reloc_map) / sizeof (reloc_map[0]); i++)
@ -414,52 +405,50 @@ struct elf_vax_link_hash_table
/* Declare this now that the above structures are defined. */ /* Declare this now that the above structures are defined. */
static bfd_boolean elf_vax_discard_copies static bfd_boolean elf_vax_discard_copies (struct elf_vax_link_hash_entry *,
PARAMS ((struct elf_vax_link_hash_entry *, PTR)); PTR);
/* Declare this now that the above structures are defined. */ /* Declare this now that the above structures are defined. */
static bfd_boolean elf_vax_instantiate_got_entries static bfd_boolean elf_vax_instantiate_got_entries (struct elf_link_hash_entry *,
PARAMS ((struct elf_link_hash_entry *, PTR)); PTR);
/* Traverse an VAX ELF linker hash table. */ /* Traverse an VAX ELF linker hash table. */
#define elf_vax_link_hash_traverse(table, func, info) \ #define elf_vax_link_hash_traverse(table, func, info) \
(elf_link_hash_traverse \ (elf_link_hash_traverse \
(&(table)->root, \ (&(table)->root, \
(bfd_boolean (*) PARAMS ((struct elf_link_hash_entry *, PTR))) (func), \ (bfd_boolean (*) (struct elf_link_hash_entry *, PTR)) (func), \
(info))) (info)))
/* Get the VAX ELF linker hash table from a link_info structure. */ /* Get the VAX ELF linker hash table from a link_info structure. */
#define elf_vax_hash_table(p) \ #define elf_vax_hash_table(p) ((struct elf_vax_link_hash_table *) (p)->hash)
((struct elf_vax_link_hash_table *) (p)->hash)
/* Create an entry in an VAX ELF linker hash table. */ /* Create an entry in an VAX ELF linker hash table. */
static struct bfd_hash_entry * static struct bfd_hash_entry *
elf_vax_link_hash_newfunc (entry, table, string) elf_vax_link_hash_newfunc (struct bfd_hash_entry *entry,
struct bfd_hash_entry *entry; struct bfd_hash_table *table,
struct bfd_hash_table *table; const char *string)
const char *string;
{ {
struct elf_vax_link_hash_entry *ret = struct elf_vax_link_hash_entry *ret =
(struct elf_vax_link_hash_entry *) entry; (struct elf_vax_link_hash_entry *) entry;
/* Allocate the structure if it has not already been allocated by a /* Allocate the structure if it has not already been allocated by a
subclass. */ subclass. */
if (ret == (struct elf_vax_link_hash_entry *) NULL) if (ret == NULL)
ret = ((struct elf_vax_link_hash_entry *) ret = ((struct elf_vax_link_hash_entry *)
bfd_hash_allocate (table, bfd_hash_allocate (table,
sizeof (struct elf_vax_link_hash_entry))); sizeof (struct elf_vax_link_hash_entry)));
if (ret == (struct elf_vax_link_hash_entry *) NULL) if (ret == NULL)
return (struct bfd_hash_entry *) ret; return (struct bfd_hash_entry *) ret;
/* Call the allocation method of the superclass. */ /* Call the allocation method of the superclass. */
ret = ((struct elf_vax_link_hash_entry *) ret = ((struct elf_vax_link_hash_entry *)
_bfd_elf_link_hash_newfunc ((struct bfd_hash_entry *) ret, _bfd_elf_link_hash_newfunc ((struct bfd_hash_entry *) ret,
table, string)); table, string));
if (ret != (struct elf_vax_link_hash_entry *) NULL) if (ret != NULL)
{ {
ret->pcrel_relocs_copied = NULL; ret->pcrel_relocs_copied = NULL;
} }
@ -470,14 +459,13 @@ elf_vax_link_hash_newfunc (entry, table, string)
/* Create an VAX ELF linker hash table. */ /* Create an VAX ELF linker hash table. */
static struct bfd_link_hash_table * static struct bfd_link_hash_table *
elf_vax_link_hash_table_create (abfd) elf_vax_link_hash_table_create (bfd *abfd)
bfd *abfd;
{ {
struct elf_vax_link_hash_table *ret; struct elf_vax_link_hash_table *ret;
bfd_size_type amt = sizeof (struct elf_vax_link_hash_table); bfd_size_type amt = sizeof (struct elf_vax_link_hash_table);
ret = (struct elf_vax_link_hash_table *) bfd_malloc (amt); ret = bfd_malloc (amt);
if (ret == (struct elf_vax_link_hash_table *) NULL) if (ret == NULL)
return NULL; return NULL;
if (! _bfd_elf_link_hash_table_init (&ret->root, abfd, if (! _bfd_elf_link_hash_table_init (&ret->root, abfd,
@ -492,9 +480,7 @@ elf_vax_link_hash_table_create (abfd)
/* Keep vax-specific flags in the ELF header */ /* Keep vax-specific flags in the ELF header */
static bfd_boolean static bfd_boolean
elf32_vax_set_private_flags (abfd, flags) elf32_vax_set_private_flags (bfd *abfd, flagword flags)
bfd *abfd;
flagword flags;
{ {
elf_elfheader (abfd)->e_flags = flags; elf_elfheader (abfd)->e_flags = flags;
elf_flags_init (abfd) = TRUE; elf_flags_init (abfd) = TRUE;
@ -504,9 +490,7 @@ elf32_vax_set_private_flags (abfd, flags)
/* Merge backend specific data from an object file to the output /* Merge backend specific data from an object file to the output
object file when linking. */ object file when linking. */
static bfd_boolean static bfd_boolean
elf32_vax_merge_private_bfd_data (ibfd, obfd) elf32_vax_merge_private_bfd_data (bfd *ibfd, bfd *obfd)
bfd *ibfd;
bfd *obfd;
{ {
flagword out_flags; flagword out_flags;
flagword in_flags; flagword in_flags;
@ -529,9 +513,7 @@ elf32_vax_merge_private_bfd_data (ibfd, obfd)
/* Display the flags field */ /* Display the flags field */
static bfd_boolean static bfd_boolean
elf32_vax_print_private_bfd_data (abfd, ptr) elf32_vax_print_private_bfd_data (bfd *abfd, PTR ptr)
bfd *abfd;
PTR ptr;
{ {
FILE *file = (FILE *) ptr; FILE *file = (FILE *) ptr;
@ -563,11 +545,8 @@ elf32_vax_print_private_bfd_data (abfd, ptr)
table. */ table. */
static bfd_boolean static bfd_boolean
elf_vax_check_relocs (abfd, info, sec, relocs) elf_vax_check_relocs (bfd *abfd, struct bfd_link_info *info, asection *sec,
bfd *abfd; const Elf_Internal_Rela *relocs)
struct bfd_link_info *info;
asection *sec;
const Elf_Internal_Rela *relocs;
{ {
bfd *dynobj; bfd *dynobj;
Elf_Internal_Shdr *symtab_hdr; Elf_Internal_Shdr *symtab_hdr;
@ -843,12 +822,11 @@ elf_vax_check_relocs (abfd, info, sec, relocs)
relocation. */ relocation. */
static asection * static asection *
elf_vax_gc_mark_hook (sec, info, rel, h, sym) elf_vax_gc_mark_hook (asection *sec,
asection *sec; struct bfd_link_info *info ATTRIBUTE_UNUSED,
struct bfd_link_info *info ATTRIBUTE_UNUSED; Elf_Internal_Rela *rel,
Elf_Internal_Rela *rel; struct elf_link_hash_entry *h,
struct elf_link_hash_entry *h; Elf_Internal_Sym *sym)
Elf_Internal_Sym *sym;
{ {
if (h != NULL) if (h != NULL)
{ {
@ -882,11 +860,8 @@ elf_vax_gc_mark_hook (sec, info, rel, h, sym)
/* Update the got entry reference counts for the section being removed. */ /* Update the got entry reference counts for the section being removed. */
static bfd_boolean static bfd_boolean
elf_vax_gc_sweep_hook (abfd, info, sec, relocs) elf_vax_gc_sweep_hook (bfd *abfd, struct bfd_link_info *info, asection *sec,
bfd *abfd; const Elf_Internal_Rela *relocs)
struct bfd_link_info *info;
asection *sec;
const Elf_Internal_Rela *relocs;
{ {
Elf_Internal_Shdr *symtab_hdr; Elf_Internal_Shdr *symtab_hdr;
struct elf_link_hash_entry **sym_hashes; struct elf_link_hash_entry **sym_hashes;
@ -1128,9 +1103,7 @@ elf_vax_adjust_dynamic_symbol (info, h)
/* Set the sizes of the dynamic sections. */ /* Set the sizes of the dynamic sections. */
static bfd_boolean static bfd_boolean
elf_vax_size_dynamic_sections (output_bfd, info) elf_vax_size_dynamic_sections (bfd *output_bfd, struct bfd_link_info *info)
bfd *output_bfd;
struct bfd_link_info *info;
{ {
bfd *dynobj; bfd *dynobj;
asection *s; asection *s;
@ -1177,7 +1150,7 @@ elf_vax_size_dynamic_sections (output_bfd, info)
if (info->shared && info->symbolic) if (info->shared && info->symbolic)
elf_vax_link_hash_traverse (elf_vax_hash_table (info), elf_vax_link_hash_traverse (elf_vax_hash_table (info),
elf_vax_discard_copies, elf_vax_discard_copies,
(PTR) NULL); NULL);
/* If this is a -Bsymbolic shared link or a static link, we need to /* If this is a -Bsymbolic shared link or a static link, we need to
discard all the got entries we've recorded. Otherwise, we need to discard all the got entries we've recorded. Otherwise, we need to
@ -1334,9 +1307,8 @@ elf_vax_size_dynamic_sections (output_bfd, info)
routine, but we won't fill them in in the relocate_section routine. */ routine, but we won't fill them in in the relocate_section routine. */
static bfd_boolean static bfd_boolean
elf_vax_discard_copies (h, ignore) elf_vax_discard_copies (struct elf_vax_link_hash_entry *h,
struct elf_vax_link_hash_entry *h; PTR ignore ATTRIBUTE_UNUSED)
PTR ignore ATTRIBUTE_UNUSED;
{ {
struct elf_vax_pcrel_relocs_copied *s; struct elf_vax_pcrel_relocs_copied *s;
@ -1361,9 +1333,7 @@ elf_vax_discard_copies (h, ignore)
will be reserved for the symbol. */ will be reserved for the symbol. */
static bfd_boolean static bfd_boolean
elf_vax_instantiate_got_entries (h, infoptr) elf_vax_instantiate_got_entries (struct elf_link_hash_entry *h, PTR infoptr)
struct elf_link_hash_entry *h;
PTR infoptr;
{ {
struct bfd_link_info *info = (struct bfd_link_info *) infoptr; struct bfd_link_info *info = (struct bfd_link_info *) infoptr;
bfd *dynobj; bfd *dynobj;
@ -1409,16 +1379,14 @@ elf_vax_instantiate_got_entries (h, infoptr)
/* Relocate an VAX ELF section. */ /* Relocate an VAX ELF section. */
static bfd_boolean static bfd_boolean
elf_vax_relocate_section (output_bfd, info, input_bfd, input_section, elf_vax_relocate_section (bfd *output_bfd,
contents, relocs, local_syms, local_sections) struct bfd_link_info *info,
bfd *output_bfd; bfd *input_bfd,
struct bfd_link_info *info; asection *input_section,
bfd *input_bfd; bfd_byte *contents,
asection *input_section; Elf_Internal_Rela *relocs,
bfd_byte *contents; Elf_Internal_Sym *local_syms,
Elf_Internal_Rela *relocs; asection **local_sections)
Elf_Internal_Sym *local_syms;
asection **local_sections;
{ {
bfd *dynobj; bfd *dynobj;
Elf_Internal_Shdr *symtab_hdr; Elf_Internal_Shdr *symtab_hdr;
@ -1842,11 +1810,9 @@ elf_vax_relocate_section (output_bfd, info, input_bfd, input_section,
dynamic sections here. */ dynamic sections here. */
static bfd_boolean static bfd_boolean
elf_vax_finish_dynamic_symbol (output_bfd, info, h, sym) elf_vax_finish_dynamic_symbol (bfd *output_bfd, struct bfd_link_info *info,
bfd *output_bfd; struct elf_link_hash_entry *h,
struct bfd_link_info *info; Elf_Internal_Sym *sym)
struct elf_link_hash_entry *h;
Elf_Internal_Sym *sym;
{ {
bfd *dynobj; bfd *dynobj;
@ -1997,9 +1963,7 @@ elf_vax_finish_dynamic_symbol (output_bfd, info, h, sym)
/* Finish up the dynamic sections. */ /* Finish up the dynamic sections. */
static bfd_boolean static bfd_boolean
elf_vax_finish_dynamic_sections (output_bfd, info) elf_vax_finish_dynamic_sections (bfd *output_bfd, struct bfd_link_info *info)
bfd *output_bfd;
struct bfd_link_info *info;
{ {
bfd *dynobj; bfd *dynobj;
asection *sgot; asection *sgot;