/* BFD backend for MIPS BSD (a.out) binaries.
- Copyright (C) 1993, 1994, 1995, 1997 Free Software Foundation, Inc.
+ Copyright 1993, 1994, 1995, 1997, 1998, 1999, 2000
+ Free Software Foundation, Inc.
Written by Ralph Campbell.
This file is part of BFD, the Binary File Descriptor library.
#include "libaout.h"
#define SET_ARCH_MACH(ABFD, EXEC) \
- MY(set_arch_mach)(ABFD, N_MACHTYPE (EXEC)); \
- MY(choose_reloc_size)(ABFD);
-void MY(set_arch_mach) PARAMS ((bfd *abfd, int machtype));
+ MY(set_arch_mach) (ABFD, N_MACHTYPE (EXEC)); \
+ MY(choose_reloc_size) (ABFD);
+static void MY(set_arch_mach) PARAMS ((bfd *abfd, int machtype));
static void MY(choose_reloc_size) PARAMS ((bfd *abfd));
#define MY_write_object_contents MY(write_object_contents)
#include "aout-target.h"
-void
+static void
MY(set_arch_mach) (abfd, machtype)
bfd *abfd;
int machtype;
enum bfd_architecture arch;
long machine;
- /* Determine the architecture and machine type of the object file. */
+ /* Determine the architecture and machine type of the object file. */
switch (machtype) {
case M_MIPS1:
machine = 0;
break;
}
- bfd_set_arch_mach(abfd, arch, machine);
+ bfd_set_arch_mach(abfd, arch, machine);
}
/* Determine the size of a relocation entry, based on the architecture */
N_SET_MACHTYPE(*execp, M_UNKNOWN);
}
- MY(choose_reloc_size)(abfd);
+ MY(choose_reloc_size) (abfd);
WRITE_HEADERS(abfd, execp);
*/
static bfd_reloc_status_type
mips_fix_jmp_addr (abfd,reloc_entry,symbol,data,input_section,output_bfd)
- bfd *abfd;
+ bfd *abfd ATTRIBUTE_UNUSED;
arelent *reloc_entry;
struct symbol_cache_entry *symbol;
- PTR data;
+ PTR data ATTRIBUTE_UNUSED;
asection *input_section;
bfd *output_bfd;
{
bfd_vma relocation, pc;
-
- /* If this is a partial relocation, just continue. */
+
+ /* If this is a partial relocation, just continue. */
if (output_bfd != (bfd *)NULL)
return bfd_reloc_continue;
&& (symbol->flags & BSF_WEAK) == 0)
return bfd_reloc_undefined;
- /*
+ /*
* Work out which section the relocation is targetted at and the
* initial relocation command value.
*/
static bfd_reloc_status_type
mips_fix_hi16_s (abfd, reloc_entry, symbol, data, input_section,
output_bfd, error_message)
- bfd *abfd;
+ bfd *abfd ATTRIBUTE_UNUSED;
arelent *reloc_entry;
asymbol *symbol;
- PTR data;
- asection *input_section;
+ PTR data ATTRIBUTE_UNUSED;
+ asection *input_section ATTRIBUTE_UNUSED;
bfd *output_bfd;
- char **error_message;
+ char **error_message ATTRIBUTE_UNUSED;
{
bfd_vma relocation;
-
- /* If this is a partial relocation, just continue. */
+
+ /* If this is a partial relocation, just continue. */
if (output_bfd != (bfd *)NULL)
return bfd_reloc_continue;
&& (symbol->flags & BSF_WEAK) == 0)
return bfd_reloc_undefined;
- /*
+ /*
* Work out which section the relocation is targetted at and the
* initial relocation command value.
*/
* own mapping of external reloc type values to howto entries.
*/
long
-MY(canonicalize_reloc)(abfd, section, relptr, symbols)
+MY(canonicalize_reloc) (abfd, section, relptr, symbols)
bfd *abfd;
sec_ptr section;
arelent **relptr;
unsigned int count, c;
extern reloc_howto_type NAME(aout,ext_howto_table)[];
- /* If we have already read in the relocation table, return the values. */
+ /* If we have already read in the relocation table, return the values. */
if (section->flags & SEC_CONSTRUCTOR) {
arelent_chain *chain = section->constructor_chain;
return section->reloc_count;
}
if (tblptr && section->reloc_count) {
- for (count = 0; count++ < section->reloc_count;)
+ for (count = 0; count++ < section->reloc_count;)
*relptr++ = tblptr++;
*relptr = 0;
return section->reloc_count;
}
- if (!NAME(aout,slurp_reloc_table)(abfd, section, symbols))
+ if (!NAME(aout,slurp_reloc_table) (abfd, section, symbols))
return -1;
tblptr = section->relocation;
/* fix up howto entries */
- for (count = 0; count++ < section->reloc_count;)
+ for (count = 0; count++ < section->reloc_count;)
{
c = tblptr->howto - NAME(aout,ext_howto_table);
tblptr->howto = &mips_howto_table_ext[c];
0 /* finish_dynamic_link */
};
+extern const bfd_target aout_mips_big_vec;
+
const bfd_target aout_mips_little_vec =
{
"a.out-mips-little", /* name */
BFD_JUMP_TABLE_LINK (MY),
BFD_JUMP_TABLE_DYNAMIC (_bfd_nodynamic),
- (PTR) MY_backend_data,
+ & aout_mips_big_vec,
+
+ (PTR) MY_backend_data
};
const bfd_target aout_mips_big_vec =
BFD_JUMP_TABLE_LINK (MY),
BFD_JUMP_TABLE_DYNAMIC (_bfd_nodynamic),
- (PTR) MY_backend_data,
+ & aout_mips_little_vec,
+
+ (PTR) MY_backend_data
};