* archive.c: Likewise.
* cache.c: Likewise.
* cisco-core.c: Likewise.
* coff-alpha.c: Likewise.
* coff-apollo.c: Likewise.
* coff-aux.c: Likewise.
* coff-h8300.c: Likewise.
* coff-h8500.c: Likewise.
* coff-i386.c: Likewise.
* coff-i960.c: Likewise.
* coff-ia64.c: Likewise.
* coff-m68k.c: Likewise.
* coff-m88k.c: Likewise.
* coff-mcore.c: Likewise.
* coff-mips.c: Likewise.
* coff-or32.c: Likewise.
* coff-ppc.c: Likewise.
* coff-rs6000.c: Likewise.
* coff-sh.c: Likewise.
* coff-sparc.c: Likewise.
* coff-stgo32.c: Likewise.
* coff-tic30.c: Likewise.
* coff-tic4x.c: Likewise.
* coff-tic54x.c: Likewise.
* coff-tic80.c: Likewise.
* coff-w65.c: Likewise.
* cofflink.c: Likewise.
* cpu-arc.c: Likewise.
* cpu-cris.c: Likewise.
* cpu-h8500.c: Likewise.
* cpu-i960.c: Likewise.
* cpu-msp430.c: Likewise.
* cpu-ns32k.c: Likewise.
* cpu-powerpc.c: Likewise.
* cpu-rs6000.c: Likewise.
* cpu-tic4x.c: Likewise.
* cpu-w65.c: Likewise.
* ecoff.c: Likewise.
* ecofflink.c: Likewise.
* elf-m10200.c: Likewise.
* elf32-bfin.c: Likewise.
* elf32-cris.c: Likewise.
* elf32-crx.c: Likewise.
* elf32-fr30.c: Likewise.
* elf32-frv.c: Likewise.
* elf32-h8300.c: Likewise.
* elf32-i960.c: Likewise.
* elf32-m32c.c: Likewise.
* elf32-m68hc11.c: Likewise.
* elf32-m68hc12.c: Likewise.
* elf32-m68hc1x.c: Likewise.
* elf32-m68k.c: Likewise.
* elf32-mcore.c: Likewise.
* elf32-rl78.c: Likewise.
* elf32-rx.c: Likewise.
* elf32-s390.c: Likewise.
* elf32-vax.c: Likewise.
* elf64-alpha.c: Likewise.
* elf64-mmix.c: Likewise.
* elf64-s390.c: Likewise.
* elf64-sparc.c: Likewise.
* elfnn-ia64.c: Likewise.
* elfxx-mips.c: Likewise.
* elfxx-sparc.c: Likewise.
* hash.c: Likewise.
* hp300hpux.c: Likewise.
* hppabsd-core.c: Likewise.
* hpux-core.c: Likewise.
* i386dynix.c: Likewise.
* i386linux.c: Likewise.
* i386lynx.c: Likewise.
* i386mach3.c: Likewise.
* i386msdos.c: Likewise.
* i386os9k.c: Likewise.
* irix-core.c: Likewise.
* lynx-core.c: Likewise.
* m68klinux.c: Likewise.
* mach-o.h: Likewise.
* mipsbsd.c: Likewise.
* netbsd-core.c: Likewise.
* nlm32-i386.c: Likewise.
* osf-core.c: Likewise.
* pc532-mach.c: Likewise.
* pef.c: Likewise.
* ppcboot.c: Likewise.
* ptrace-core.c: Likewise.
* reloc16.c: Likewise.
* sco5-core.c: Likewise.
* som.h: Likewise.
* sparclinux.c: Likewise.
* sparclynx.c: Likewise.
* ticoff.h: Likewise.
* trad-core.c: Likewise.
* vms-lib.c: Likewise.
* xsym.h: Likewise.
+2012-07-13 Nick Clifton <nickc@redhat.com>
+
+ * aix386-core.c: Remove use of PTR and PARAMS macros.
+ * archive.c: Likewise.
+ * cache.c: Likewise.
+ * cisco-core.c: Likewise.
+ * coff-alpha.c: Likewise.
+ * coff-apollo.c: Likewise.
+ * coff-aux.c: Likewise.
+ * coff-h8300.c: Likewise.
+ * coff-h8500.c: Likewise.
+ * coff-i386.c: Likewise.
+ * coff-i960.c: Likewise.
+ * coff-ia64.c: Likewise.
+ * coff-m68k.c: Likewise.
+ * coff-m88k.c: Likewise.
+ * coff-mcore.c: Likewise.
+ * coff-mips.c: Likewise.
+ * coff-or32.c: Likewise.
+ * coff-ppc.c: Likewise.
+ * coff-rs6000.c: Likewise.
+ * coff-sh.c: Likewise.
+ * coff-sparc.c: Likewise.
+ * coff-stgo32.c: Likewise.
+ * coff-tic30.c: Likewise.
+ * coff-tic4x.c: Likewise.
+ * coff-tic54x.c: Likewise.
+ * coff-tic80.c: Likewise.
+ * coff-w65.c: Likewise.
+ * cofflink.c: Likewise.
+ * cpu-arc.c: Likewise.
+ * cpu-cris.c: Likewise.
+ * cpu-h8500.c: Likewise.
+ * cpu-i960.c: Likewise.
+ * cpu-msp430.c: Likewise.
+ * cpu-ns32k.c: Likewise.
+ * cpu-powerpc.c: Likewise.
+ * cpu-rs6000.c: Likewise.
+ * cpu-tic4x.c: Likewise.
+ * cpu-w65.c: Likewise.
+ * ecoff.c: Likewise.
+ * ecofflink.c: Likewise.
+ * elf-m10200.c: Likewise.
+ * elf32-bfin.c: Likewise.
+ * elf32-cris.c: Likewise.
+ * elf32-crx.c: Likewise.
+ * elf32-fr30.c: Likewise.
+ * elf32-frv.c: Likewise.
+ * elf32-h8300.c: Likewise.
+ * elf32-i960.c: Likewise.
+ * elf32-m32c.c: Likewise.
+ * elf32-m68hc11.c: Likewise.
+ * elf32-m68hc12.c: Likewise.
+ * elf32-m68hc1x.c: Likewise.
+ * elf32-m68k.c: Likewise.
+ * elf32-mcore.c: Likewise.
+ * elf32-rl78.c: Likewise.
+ * elf32-rx.c: Likewise.
+ * elf32-s390.c: Likewise.
+ * elf32-vax.c: Likewise.
+ * elf64-alpha.c: Likewise.
+ * elf64-mmix.c: Likewise.
+ * elf64-s390.c: Likewise.
+ * elf64-sparc.c: Likewise.
+ * elfnn-ia64.c: Likewise.
+ * elfxx-mips.c: Likewise.
+ * elfxx-sparc.c: Likewise.
+ * hash.c: Likewise.
+ * hp300hpux.c: Likewise.
+ * hppabsd-core.c: Likewise.
+ * hpux-core.c: Likewise.
+ * i386dynix.c: Likewise.
+ * i386linux.c: Likewise.
+ * i386lynx.c: Likewise.
+ * i386mach3.c: Likewise.
+ * i386msdos.c: Likewise.
+ * i386os9k.c: Likewise.
+ * irix-core.c: Likewise.
+ * lynx-core.c: Likewise.
+ * m68klinux.c: Likewise.
+ * mach-o.h: Likewise.
+ * mipsbsd.c: Likewise.
+ * netbsd-core.c: Likewise.
+ * nlm32-i386.c: Likewise.
+ * osf-core.c: Likewise.
+ * pc532-mach.c: Likewise.
+ * pef.c: Likewise.
+ * ppcboot.c: Likewise.
+ * ptrace-core.c: Likewise.
+ * reloc16.c: Likewise.
+ * sco5-core.c: Likewise.
+ * som.h: Likewise.
+ * sparclinux.c: Likewise.
+ * sparclynx.c: Likewise.
+ * ticoff.h: Likewise.
+ * trad-core.c: Likewise.
+ * vms-lib.c: Likewise.
+ * xsym.h: Likewise.
+
2012-07-09 Alan Modra <amodra@gmail.com>
PR ld/14323
This was based on trad-core.c, which was written by John Gilmore of
Cygnus Support.
Copyright 1988, 1989, 1991, 1992, 1993, 1994, 1996, 1998, 1999, 2000,
- 2001, 2002, 2004, 2005, 2006, 2007, 2010, 2011
+ 2001, 2002, 2004, 2005, 2006, 2007, 2010, 2011, 2012
Free Software Foundation, Inc.
Written by Minh Tran-Le <TRANLE@INTELLICORP.COM>.
Converted to back end form by Ian Lance Taylor <ian@cygnus.com>.
(((bfd)->tdata.trad_core_data)->reg2_section)
/* These are stored in the bfd's tdata. */
-struct trad_core_struct {
+struct trad_core_struct
+{
struct corehdr *hdr; /* core file header */
asection *reg_section;
asection *reg2_section;
asection *sections[MAX_CORE_SEGS];
};
-static void swap_abort PARAMS ((void));
-
static const bfd_target *
-aix386_core_file_p (abfd)
- bfd *abfd;
+aix386_core_file_p (bfd *abfd)
{
int i, n;
unsigned char longbuf[4]; /* Raw bytes of various header fields */
bfd_size_type core_size = sizeof (struct corehdr);
bfd_size_type amt;
struct corehdr *core;
- struct mergem {
+ struct mergem
+ {
struct trad_core_struct coredata;
struct corehdr internal_core;
} *mergem;
flagword flags;
amt = sizeof (longbuf);
- if (bfd_bread ((PTR) longbuf, amt, abfd) != amt)
+ if (bfd_bread (longbuf, amt, abfd) != amt)
{
if (bfd_get_error () != bfd_error_system_call)
bfd_set_error (bfd_error_wrong_format);
core = &mergem->internal_core;
- if ((bfd_bread ((PTR) core, core_size, abfd)) != core_size)
+ if ((bfd_bread (core, core_size, abfd)) != core_size)
{
if (bfd_get_error () != bfd_error_system_call)
bfd_set_error (bfd_error_wrong_format);
}
static char *
-aix386_core_file_failing_command (abfd)
- bfd *abfd;
+aix386_core_file_failing_command (bfd *abfd)
{
return core_hdr (abfd)->cd_comm;
}
static int
-aix386_core_file_failing_signal (abfd)
- bfd *abfd;
+aix386_core_file_failing_signal (bfd *abfd)
{
return core_hdr (abfd)->cd_cursig;
}
/* If somebody calls any byte-swapping routines, shoot them. */
static void
-swap_abort ()
+swap_abort (void)
{
/* This way doesn't require any declaration for ANSI to fuck up. */
abort ();
#define NO_PUT64 ((void (*) (bfd_uint64_t, void *)) swap_abort)
#define NO_GETS64 ((bfd_int64_t (*) (const void *)) swap_abort)
-const bfd_target aix386_core_vec = {
+const bfd_target aix386_core_vec =
+{
"aix386-core",
bfd_target_unknown_flavour,
BFD_ENDIAN_BIG, /* target byte order */
NULL,
- (PTR) 0
+ NULL
};
it's generally short enough to search linearly.
Note that the pointers here point to the front of the ar_hdr, not
to the front of the contents! */
-struct ar_cache {
+struct ar_cache
+{
file_ptr ptr;
bfd *arbfd;
};
{
static char buf[20];
size_t len;
+
snprintf (buf, sizeof (buf), fmt, val);
len = strlen (buf);
if (len < n)
{
htab_t hash_table = bfd_ardata (arch_bfd)->cache;
struct ar_cache m;
+
m.ptr = filepos;
if (hash_table)
}
static hashval_t
-hash_file_ptr (const PTR p)
+hash_file_ptr (const void * p)
{
return (hashval_t) (((struct ar_cache *) p)->ptr);
}
/* Returns non-zero if P1 and P2 are equal. */
static int
-eq_file_ptr (const PTR p1, const PTR p2)
+eq_file_ptr (const void * p1, const void * p2)
{
struct ar_cache *arc1 = (struct ar_cache *) p1;
struct ar_cache *arc2 = (struct ar_cache *) p2;
{
case read_direction:
case no_direction:
- abfd->iostream = (PTR) real_fopen (abfd->filename, FOPEN_RB);
+ abfd->iostream = real_fopen (abfd->filename, FOPEN_RB);
break;
case both_direction:
case write_direction:
if (abfd->opened_once)
{
- abfd->iostream = (PTR) real_fopen (abfd->filename, FOPEN_RUB);
+ abfd->iostream = real_fopen (abfd->filename, FOPEN_RUB);
if (abfd->iostream == NULL)
- abfd->iostream = (PTR) real_fopen (abfd->filename, FOPEN_WUB);
+ abfd->iostream = real_fopen (abfd->filename, FOPEN_WUB);
}
else
{
if (stat (abfd->filename, &s) == 0 && s.st_size != 0)
unlink_if_ordinary (abfd->filename);
#endif
- abfd->iostream = (PTR) real_fopen (abfd->filename, FOPEN_WUB);
+ abfd->iostream = real_fopen (abfd->filename, FOPEN_WUB);
abfd->opened_once = TRUE;
}
break;
/* BFD back-end for CISCO crash dumps.
Copyright 1994, 1997, 1999, 2000, 2001, 2002, 2004, 2005, 2006, 2007,
- 2010, 2011
+ 2010, 2011, 2012
Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library.
# define SIGBUS 10
#endif
\f
-int crash_info_locs[] = {
+int crash_info_locs[] =
+{
0x0250, /* mips, ppc, x86, i960 */
0x0400, /* m68k, mips, x86, i960 */
0x0FFC, /* m68k, mips, ppc, x86, i960 */
#define CRASH_MAGIC 0xdead1234
#define MASK_ADDR(x) ((x) & 0x0fffffff) /* Mask crash info address */
-typedef enum {
- CRASH_REASON_NOTCRASHED = 0,
- CRASH_REASON_EXCEPTION = 1,
- CRASH_REASON_CORRUPT = 2,
+typedef enum
+{
+ CRASH_REASON_NOTCRASHED = 0,
+ CRASH_REASON_EXCEPTION = 1,
+ CRASH_REASON_CORRUPT = 2,
} crashreason;
-typedef struct {
+typedef struct
+{
char magic[4]; /* Magic number */
char version[4]; /* Version number */
char reason[4]; /* Crash reason */
int sig;
};
-static const bfd_target *cisco_core_file_validate PARAMS ((bfd *, int));
-static const bfd_target *cisco_core_file_p PARAMS ((bfd *));
-char *cisco_core_file_failing_command PARAMS ((bfd *));
-int cisco_core_file_failing_signal PARAMS ((bfd *));
#define cisco_core_file_matches_executable_p generic_core_file_matches_executable_p
#define cisco_core_file_pid _bfd_nocore_core_file_pid
\f
CRASH_INFO_LOC. */
static const bfd_target *
-cisco_core_file_validate (abfd, crash_info_loc)
- bfd *abfd;
- int crash_info_loc;
+cisco_core_file_validate (bfd *abfd, int crash_info_loc)
{
char buf[4];
unsigned int crashinfo_offset;
}
static const bfd_target *
-cisco_core_file_p (abfd)
- bfd *abfd;
+cisco_core_file_p (bfd *abfd)
{
int *crash_info_locp;
const bfd_target *target = NULL;
}
char *
-cisco_core_file_failing_command (abfd)
- bfd *abfd ATTRIBUTE_UNUSED;
+cisco_core_file_failing_command (bfd *abfd ATTRIBUTE_UNUSED)
{
return NULL;
}
int
-cisco_core_file_failing_signal (abfd)
- bfd *abfd ATTRIBUTE_UNUSED;
+cisco_core_file_failing_signal (bfd *abfd ATTRIBUTE_UNUSED)
{
return abfd->tdata.cisco_core_data->sig;
}
extern const bfd_target cisco_core_little_vec;
const bfd_target cisco_core_big_vec =
- {
+{
"cisco-ios-core-big",
bfd_target_unknown_flavour,
BFD_ENDIAN_BIG, /* target byte order */
& cisco_core_little_vec,
- (PTR) 0 /* backend_data */
+ NULL /* backend_data */
};
const bfd_target cisco_core_little_vec =
- {
+{
"cisco-ios-core-little",
bfd_target_unknown_flavour,
BFD_ENDIAN_LITTLE, /* target byte order */
&cisco_core_big_vec,
- (PTR) 0 /* backend_data */
+ NULL /* backend_data */
};
/* BFD back-end for ALPHA Extended-Coff files.
Copyright 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
- 2003, 2004, 2005, 2007, 2008, 2009, 2010, 2011
+ 2003, 2004, 2005, 2007, 2008, 2009, 2010, 2011, 2012
Free Software Foundation, Inc.
Modified from coff-mips.c by Steve Chamberlain <sac@cygnus.com> and
Ian Lance Taylor <ian@cygnus.com>.
\f
/* Prototypes for static functions. */
-static const bfd_target *alpha_ecoff_object_p
- PARAMS ((bfd *));
-static bfd_boolean alpha_ecoff_bad_format_hook
- PARAMS ((bfd *abfd, PTR filehdr));
-static PTR alpha_ecoff_mkobject_hook
- PARAMS ((bfd *, PTR filehdr, PTR aouthdr));
-static void alpha_ecoff_swap_reloc_in
- PARAMS ((bfd *, PTR, struct internal_reloc *));
-static void alpha_ecoff_swap_reloc_out
- PARAMS ((bfd *, const struct internal_reloc *, PTR));
-static void alpha_adjust_reloc_in
- PARAMS ((bfd *, const struct internal_reloc *, arelent *));
-static void alpha_adjust_reloc_out
- PARAMS ((bfd *, const arelent *, struct internal_reloc *));
-static reloc_howto_type *alpha_bfd_reloc_type_lookup
- PARAMS ((bfd *, bfd_reloc_code_real_type));
-static bfd_byte *alpha_ecoff_get_relocated_section_contents
- PARAMS ((bfd *abfd, struct bfd_link_info *, struct bfd_link_order *,
- bfd_byte *data, bfd_boolean relocatable, asymbol **symbols));
-static bfd_vma alpha_convert_external_reloc
- PARAMS ((bfd *, struct bfd_link_info *, bfd *, struct external_reloc *,
- struct ecoff_link_hash_entry *));
-static bfd_boolean alpha_relocate_section
- PARAMS ((bfd *, struct bfd_link_info *, bfd *, asection *, bfd_byte *, PTR));
-static bfd_boolean alpha_adjust_headers
- PARAMS ((bfd *, struct internal_filehdr *, struct internal_aouthdr *));
-static PTR alpha_ecoff_read_ar_hdr
- PARAMS ((bfd *));
-static bfd *alpha_ecoff_get_elt_at_filepos
- PARAMS ((bfd *, file_ptr));
-static bfd *alpha_ecoff_openr_next_archived_file
- PARAMS ((bfd *, bfd *));
-static bfd *alpha_ecoff_get_elt_at_index
- PARAMS ((bfd *, symindex));
+
\f
/* ECOFF has COFF sections, but the debugging information is stored in
a completely different format. ECOFF targets use some of the
\f
/* How to process the various reloc types. */
-static bfd_reloc_status_type reloc_nil
- PARAMS ((bfd *, arelent *, asymbol *, PTR, asection *, bfd *, char **));
-
static bfd_reloc_status_type
-reloc_nil (abfd, reloc, sym, data, sec, output_bfd, error_message)
- bfd *abfd ATTRIBUTE_UNUSED;
- arelent *reloc ATTRIBUTE_UNUSED;
- asymbol *sym ATTRIBUTE_UNUSED;
- PTR data ATTRIBUTE_UNUSED;
- asection *sec ATTRIBUTE_UNUSED;
- bfd *output_bfd ATTRIBUTE_UNUSED;
- char **error_message ATTRIBUTE_UNUSED;
+reloc_nil (bfd *abfd ATTRIBUTE_UNUSED,
+ arelent *reloc ATTRIBUTE_UNUSED,
+ asymbol *sym ATTRIBUTE_UNUSED,
+ void * data ATTRIBUTE_UNUSED,
+ asection *sec ATTRIBUTE_UNUSED,
+ bfd *output_bfd ATTRIBUTE_UNUSED,
+ char **error_message ATTRIBUTE_UNUSED)
{
return bfd_reloc_ok;
}
/* Recognize an Alpha ECOFF file. */
static const bfd_target *
-alpha_ecoff_object_p (abfd)
- bfd *abfd;
+alpha_ecoff_object_p (bfd *abfd)
{
static const bfd_target *ret;
/* See whether the magic number matches. */
static bfd_boolean
-alpha_ecoff_bad_format_hook (abfd, filehdr)
- bfd *abfd ATTRIBUTE_UNUSED;
- PTR filehdr;
+alpha_ecoff_bad_format_hook (bfd *abfd ATTRIBUTE_UNUSED,
+ void * filehdr)
{
struct internal_filehdr *internal_f = (struct internal_filehdr *) filehdr;
/* This is a hook called by coff_real_object_p to create any backend
specific information. */
-static PTR
-alpha_ecoff_mkobject_hook (abfd, filehdr, aouthdr)
- bfd *abfd;
- PTR filehdr;
- PTR aouthdr;
+static void *
+alpha_ecoff_mkobject_hook (bfd *abfd, void * filehdr, void * aouthdr)
{
- PTR ecoff;
+ void * ecoff;
ecoff = _bfd_ecoff_mkobject_hook (abfd, filehdr, aouthdr);
/* Swap a reloc in. */
static void
-alpha_ecoff_swap_reloc_in (abfd, ext_ptr, intern)
- bfd *abfd;
- PTR ext_ptr;
- struct internal_reloc *intern;
+alpha_ecoff_swap_reloc_in (bfd *abfd,
+ void * ext_ptr,
+ struct internal_reloc *intern)
{
const RELOC *ext = (RELOC *) ext_ptr;
/* Swap a reloc out. */
static void
-alpha_ecoff_swap_reloc_out (abfd, intern, dst)
- bfd *abfd;
- const struct internal_reloc *intern;
- PTR dst;
+alpha_ecoff_swap_reloc_out (bfd *abfd,
+ const struct internal_reloc *intern,
+ void * dst)
{
RELOC *ext = (RELOC *) dst;
long symndx;
this backend routine. It must fill in the howto field. */
static void
-alpha_adjust_reloc_in (abfd, intern, rptr)
- bfd *abfd;
- const struct internal_reloc *intern;
- arelent *rptr;
+alpha_adjust_reloc_in (bfd *abfd,
+ const struct internal_reloc *intern,
+ arelent *rptr)
{
if (intern->r_type > ALPHA_R_GPVALUE)
{
not need to undo. */
static void
-alpha_adjust_reloc_out (abfd, rel, intern)
- bfd *abfd ATTRIBUTE_UNUSED;
- const arelent *rel;
- struct internal_reloc *intern;
+alpha_adjust_reloc_out (bfd *abfd ATTRIBUTE_UNUSED,
+ const arelent *rel,
+ struct internal_reloc *intern)
{
switch (intern->r_type)
{
assembler is going to handle this. */
static bfd_byte *
-alpha_ecoff_get_relocated_section_contents (abfd, link_info, link_order,
- data, relocatable, symbols)
- bfd *abfd;
- struct bfd_link_info *link_info;
- struct bfd_link_order *link_order;
- bfd_byte *data;
- bfd_boolean relocatable;
- asymbol **symbols;
+alpha_ecoff_get_relocated_section_contents (bfd *abfd,
+ struct bfd_link_info *link_info,
+ struct bfd_link_order *link_order,
+ bfd_byte *data,
+ bfd_boolean relocatable,
+ asymbol **symbols)
{
bfd *input_bfd = link_order->u.indirect.section->owner;
asection *input_section = link_order->u.indirect.section;
/* Get the howto structure for a generic reloc type. */
static reloc_howto_type *
-alpha_bfd_reloc_type_lookup (abfd, code)
- bfd *abfd ATTRIBUTE_UNUSED;
- bfd_reloc_code_real_type code;
+alpha_bfd_reloc_type_lookup (bfd *abfd ATTRIBUTE_UNUSED,
+ bfd_reloc_code_real_type code)
{
int alpha_type;
relocation amount. */
static bfd_vma
-alpha_convert_external_reloc (output_bfd, info, input_bfd, ext_rel, h)
- bfd *output_bfd ATTRIBUTE_UNUSED;
- struct bfd_link_info *info;
- bfd *input_bfd;
- struct external_reloc *ext_rel;
- struct ecoff_link_hash_entry *h;
+alpha_convert_external_reloc (bfd *output_bfd ATTRIBUTE_UNUSED,
+ struct bfd_link_info *info,
+ bfd *input_bfd,
+ struct external_reloc *ext_rel,
+ struct ecoff_link_hash_entry *h)
{
unsigned long r_symndx;
bfd_vma relocation;
could be combined somehow. */
static bfd_boolean
-alpha_relocate_section (output_bfd, info, input_bfd, input_section,
- contents, external_relocs)
- bfd *output_bfd;
- struct bfd_link_info *info;
- bfd *input_bfd;
- asection *input_section;
- bfd_byte *contents;
- PTR external_relocs;
+alpha_relocate_section (bfd *output_bfd,
+ struct bfd_link_info *info,
+ bfd *input_bfd,
+ asection *input_section,
+ bfd_byte *contents,
+ void * external_relocs)
{
asection **symndx_to_section, *lita_sec;
struct ecoff_link_hash_entry **sym_hashes;
sets the dynamic bits in the file header. */
static bfd_boolean
-alpha_adjust_headers (abfd, fhdr, ahdr)
- bfd *abfd;
- struct internal_filehdr *fhdr;
- struct internal_aouthdr *ahdr ATTRIBUTE_UNUSED;
+alpha_adjust_headers (bfd *abfd,
+ struct internal_filehdr *fhdr,
+ struct internal_aouthdr *ahdr ATTRIBUTE_UNUSED)
{
if ((abfd->flags & (DYNAMIC | EXEC_P)) == (DYNAMIC | EXEC_P))
fhdr->f_flags |= F_ALPHA_CALL_SHARED;
/* Read an archive header. This is like the standard routine, but it
also accepts ARFZMAG. */
-static PTR
-alpha_ecoff_read_ar_hdr (abfd)
- bfd *abfd;
+static void *
+alpha_ecoff_read_ar_hdr (bfd *abfd)
{
struct areltdata *ret;
struct ar_hdr *h;
ret->parsed_size = H_GET_64 (abfd, ab);
}
- return (PTR) ret;
+ return ret;
}
/* Get an archive element at a specified file position. This is where
we uncompress the archive element if necessary. */
static bfd *
-alpha_ecoff_get_elt_at_filepos (archive, filepos)
- bfd *archive;
- file_ptr filepos;
+alpha_ecoff_get_elt_at_filepos (bfd *archive, file_ptr filepos)
{
bfd *nbfd = NULL;
struct areltdata *tdata;
nbfd->mtime = strtol (hdr->ar_date, (char **) NULL, 10);
nbfd->flags |= BFD_IN_MEMORY;
- nbfd->iostream = (PTR) bim;
+ nbfd->iostream = bim;
nbfd->iovec = &_bfd_memory_iovec;
nbfd->origin = 0;
BFD_ASSERT (! nbfd->cacheable);
/* Open the next archived file. */
static bfd *
-alpha_ecoff_openr_next_archived_file (archive, last_file)
- bfd *archive;
- bfd *last_file;
+alpha_ecoff_openr_next_archived_file (bfd *archive, bfd *last_file)
{
file_ptr filestart;
{
/* COFF backend structure. */
{
- (void (*) PARAMS ((bfd *,PTR,int,int,int,int,PTR))) bfd_void, /* aux_in */
- (void (*) PARAMS ((bfd *,PTR,PTR))) bfd_void, /* sym_in */
- (void (*) PARAMS ((bfd *,PTR,PTR))) bfd_void, /* lineno_in */
- (unsigned (*) PARAMS ((bfd *,PTR,int,int,int,int,PTR)))bfd_void,/*aux_out*/
- (unsigned (*) PARAMS ((bfd *,PTR,PTR))) bfd_void, /* sym_out */
- (unsigned (*) PARAMS ((bfd *,PTR,PTR))) bfd_void, /* lineno_out */
- (unsigned (*) PARAMS ((bfd *,PTR,PTR))) bfd_void, /* reloc_out */
+ (void (*) (bfd *,void *,int,int,int,int,void *)) bfd_void, /* aux_in */
+ (void (*) (bfd *,void *,void *)) bfd_void, /* sym_in */
+ (void (*) (bfd *,void *,void *)) bfd_void, /* lineno_in */
+ (unsigned (*) (bfd *,void *,int,int,int,int,void *)) bfd_void,/*aux_out*/
+ (unsigned (*) (bfd *,void *,void *)) bfd_void, /* sym_out */
+ (unsigned (*) (bfd *,void *,void *)) bfd_void, /* lineno_out */
+ (unsigned (*) (bfd *,void *,void *)) bfd_void, /* reloc_out */
alpha_ecoff_swap_filehdr_out, alpha_ecoff_swap_aouthdr_out,
alpha_ecoff_swap_scnhdr_out,
FILHSZ, AOUTSZ, SCNHSZ, 0, 0, 0, 0, FILNMLEN, TRUE,
NULL,
- (PTR) &alpha_ecoff_backend_data
+ & alpha_ecoff_backend_data
};
/* BFD back-end for Apollo 68000 COFF binaries.
Copyright 1990, 1991, 1992, 1993, 1994, 1999, 2000, 2001, 2002, 2003,
- 2005, 2007, 2008 Free Software Foundation, Inc.
+ 2005, 2007, 2008, 2012 Free Software Foundation, Inc.
By Troy Rollo (troy@cbme.unsw.edu.au)
Based on m68k standard COFF version Written by Cygnus Support.
/* Turn a howto into a reloc number. */
-extern void apollo_rtype2howto PARAMS ((arelent *, int));
-extern int apollo_howto2rtype PARAMS ((reloc_howto_type *));
+extern void apollo_rtype2howto (arelent *, int);
+extern int apollo_howto2rtype (reloc_howto_type *);
#ifndef ONLY_DECLARE_RELOCS
void
-apollo_rtype2howto (internal, relocentry)
- arelent *internal;
- int relocentry;
+apollo_rtype2howto (arelent *internal, int relocentry)
{
switch (relocentry)
{
}
int
-apollo_howto2rtype (internal)
- reloc_howto_type *internal;
+apollo_howto2rtype (reloc_howto_type *internal)
{
if (internal->pc_relative)
{
/* BFD back-end for Apple M68K COFF A/UX 3.x files.
- Copyright 1996, 1997, 2000, 2002, 2005, 2007, 2008, 2011
+ Copyright 1996, 1997, 2000, 2002, 2005, 2007, 2008, 2011, 2012
Free Software Foundation, Inc.
Written by Richard Henderson <rth@tamu.edu>.
#include "sysdep.h"
#include "bfd.h"
-static bfd_boolean coff_m68k_aux_link_add_one_symbol
- PARAMS ((struct bfd_link_info *, bfd *, const char *, flagword,
- asection *, bfd_vma, const char *, bfd_boolean, bfd_boolean,
- struct bfd_link_hash_entry **));
-
#define coff_link_add_one_symbol coff_m68k_aux_link_add_one_symbol
+static bfd_boolean
+coff_m68k_aux_link_add_one_symbol
+ (struct bfd_link_info *, bfd *, const char *, flagword, asection *,
+ bfd_vma, const char *, bfd_boolean, bfd_boolean,
+ struct bfd_link_hash_entry **);
#ifndef bfd_pe_print_pdata
#define bfd_pe_print_pdata NULL
what you include in the shared object. */
static bfd_boolean
-coff_m68k_aux_link_add_one_symbol (info, abfd, name, flags, section, value,
- string, copy, collect, hashp)
- struct bfd_link_info *info;
- bfd *abfd;
- const char *name;
- flagword flags;
- asection *section;
- bfd_vma value;
- const char *string;
- bfd_boolean copy;
- bfd_boolean collect;
- struct bfd_link_hash_entry **hashp;
+coff_m68k_aux_link_add_one_symbol (struct bfd_link_info *info,
+ bfd *abfd,
+ const char *name,
+ flagword flags,
+ asection *section,
+ bfd_vma value,
+ const char *string,
+ bfd_boolean copy,
+ bfd_boolean collect,
+ struct bfd_link_hash_entry **hashp)
{
struct bfd_link_hash_entry *h;
/* BFD back-end for Renesas H8/300 COFF binaries.
Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
- 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008
+ 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2012
Free Software Foundation, Inc.
Written by Steve Chamberlain, <sac@cygnus.com>.
unsigned int offset;
};
-static struct bfd_hash_entry *
-funcvec_hash_newfunc
- (struct bfd_hash_entry *, struct bfd_hash_table *, const char *);
-
-static bfd_reloc_status_type special
- (bfd *, arelent *, asymbol *, PTR, asection *, bfd *, char **);
-static int select_reloc
- (reloc_howto_type *);
-static void rtype2howto
- (arelent *, struct internal_reloc *);
-static void reloc_processing
- (arelent *, struct internal_reloc *, asymbol **, bfd *, asection *);
-static bfd_boolean h8300_symbol_address_p
- (bfd *, asection *, bfd_vma);
-static int h8300_reloc16_estimate
- (bfd *, asection *, arelent *, unsigned int,
- struct bfd_link_info *);
-static void h8300_reloc16_extra_cases
- (bfd *, struct bfd_link_info *, struct bfd_link_order *, arelent *,
- bfd_byte *, unsigned int *, unsigned int *);
-static bfd_boolean h8300_bfd_link_add_symbols
- (bfd *, struct bfd_link_info *);
/* To lookup a value in the function vector hash table. */
#define funcvec_hash_lookup(table, string, create, copy) \
the addend until the final link. */
static bfd_reloc_status_type
-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)
+special (bfd * abfd ATTRIBUTE_UNUSED,
+ arelent * reloc_entry ATTRIBUTE_UNUSED,
+ asymbol * symbol ATTRIBUTE_UNUSED,
+ void * 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;
return bfd_reloc_ok;
}
-static reloc_howto_type howto_table[] = {
+static reloc_howto_type howto_table[] =
+{
HOWTO (R_RELBYTE, 0, 0, 8, FALSE, 0, complain_overflow_bitfield, special, "8", FALSE, 0x000000ff, 0x000000ff, FALSE),
HOWTO (R_RELWORD, 0, 1, 16, FALSE, 0, complain_overflow_bitfield, special, "16", FALSE, 0x0000ffff, 0x0000ffff, FALSE),
HOWTO (R_RELLONG, 0, 2, 32, FALSE, 0, complain_overflow_bitfield, special, "32", FALSE, 0xffffffff, 0xffffffff, FALSE),
/* BFD back-end for Renesas H8/500 COFF binaries.
Copyright 1993, 1994, 1995, 1997, 1999, 2000, 2001, 2002, 2003, 2004,
- 2005, 2007, 2008 Free Software Foundation, Inc.
+ 2005, 2007, 2008, 2012 Free Software Foundation, Inc.
Contributed by Cygnus Support.
Written by Steve Chamberlain, <sac@cygnus.com>.
#include "coff/internal.h"
#include "libcoff.h"
-static int coff_h8500_select_reloc PARAMS ((reloc_howto_type *));
-static void rtype2howto PARAMS ((arelent *, struct internal_reloc *));
-static void reloc_processing PARAMS ((arelent *, struct internal_reloc *, asymbol **, bfd *, asection *));
-static void extra_case PARAMS ((bfd *, struct bfd_link_info *, struct bfd_link_order *, arelent *, bfd_byte *, unsigned int *, unsigned int *));
#define COFF_DEFAULT_SECTION_ALIGNMENT_POWER (1)
/* Turn a howto into a reloc number. */
static int
-coff_h8500_select_reloc (howto)
- reloc_howto_type *howto;
+coff_h8500_select_reloc (reloc_howto_type *howto)
{
return howto->type;
}
/* 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)
{
#define RELOC_PROCESSING(relent,reloc,symbols,abfd,section) \
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;
+static void
+reloc_processing (arelent * relent,
+ struct internal_reloc *reloc,
+ asymbol ** symbols,
+ bfd * abfd,
+ asection * section)
{
relent->address = reloc->r_vaddr;
rtype2howto (relent, reloc);
}
static void
-extra_case (in_abfd, link_info, link_order, reloc, data, src_ptr, dst_ptr)
- bfd *in_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;
+extra_case (bfd *in_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)
{
bfd_byte *d = data+*dst_ptr;
asection *input_section = link_order->u.indirect.section;
/* BFD back-end for Intel 386 COFF files.
Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
- 2000, 2001, 2002, 2003, 2004, 2005, 2007, 2008, 2009, 2010, 2011
+ 2000, 2001, 2002, 2003, 2004, 2005, 2007, 2008, 2009, 2010, 2011, 2012
Free Software Foundation, Inc.
Written by Cygnus Support.
#include "libcoff.h"
-static bfd_reloc_status_type coff_i386_reloc
- (bfd *, arelent *, asymbol *, PTR, asection *, bfd *, char **);
static reloc_howto_type *coff_i386_rtype_to_howto
(bfd *, asection *, struct internal_reloc *,
struct coff_link_hash_entry *, struct internal_syment *,
reloc type to make any required adjustments. */
static bfd_reloc_status_type
-coff_i386_reloc (abfd, reloc_entry, symbol, data, input_section, output_bfd,
- error_message)
- bfd *abfd;
- arelent *reloc_entry;
- asymbol *symbol;
- PTR data;
- asection *input_section ATTRIBUTE_UNUSED;
- bfd *output_bfd;
- char **error_message ATTRIBUTE_UNUSED;
+coff_i386_reloc (bfd *abfd,
+ arelent *reloc_entry,
+ asymbol *symbol,
+ void * data,
+ asection *input_section ATTRIBUTE_UNUSED,
+ bfd *output_bfd,
+ char **error_message ATTRIBUTE_UNUSED)
{
symvalue diff;
/* Return TRUE if this relocation should appear in the output .reloc
section. */
-static bfd_boolean in_reloc_p PARAMS ((bfd *, reloc_howto_type *));
-
-static bfd_boolean in_reloc_p (abfd, howto)
- bfd * abfd ATTRIBUTE_UNUSED;
- reloc_howto_type *howto;
+static bfd_boolean in_reloc_p (bfd * abfd ATTRIBUTE_UNUSED,
+ reloc_howto_type *howto)
{
return ! howto->pc_relative && howto->type != R_IMAGEBASE
&& howto->type != R_SECREL32;
and the regular routine is that we don't want to do anything for a
relocatable link. */
-static bfd_boolean coff_pe_i386_relocate_section
- PARAMS ((bfd *, struct bfd_link_info *, bfd *, asection *, bfd_byte *,
- struct internal_reloc *, struct internal_syment *, asection **));
-
static bfd_boolean
-coff_pe_i386_relocate_section (output_bfd, info, input_bfd,
- input_section, contents, relocs, syms,
- sections)
- bfd *output_bfd;
- struct bfd_link_info *info;
- bfd *input_bfd;
- asection *input_section;
- bfd_byte *contents;
- struct internal_reloc *relocs;
- struct internal_syment *syms;
- asection **sections;
+coff_pe_i386_relocate_section (bfd *output_bfd,
+ struct bfd_link_info *info,
+ bfd *input_bfd,
+ asection *input_section,
+ bfd_byte *contents,
+ struct internal_reloc *relocs,
+ struct internal_syment *syms,
+ asection **sections)
{
if (info->relocatable)
return TRUE;
/* Convert an rtype to howto for the COFF backend linker. */
static reloc_howto_type *
-coff_i386_rtype_to_howto (abfd, sec, rel, h, sym, addendp)
- bfd *abfd ATTRIBUTE_UNUSED;
- asection *sec;
- struct internal_reloc *rel;
- struct coff_link_hash_entry *h;
- struct internal_syment *sym;
- bfd_vma *addendp;
+coff_i386_rtype_to_howto (bfd *abfd ATTRIBUTE_UNUSED,
+ asection *sec,
+ struct internal_reloc *rel,
+ struct coff_link_hash_entry *h,
+ struct internal_syment *sym,
+ bfd_vma *addendp)
{
reloc_howto_type *howto;
#define coff_bfd_reloc_name_lookup coff_i386_reloc_name_lookup
static reloc_howto_type *
-coff_i386_reloc_type_lookup (abfd, code)
- bfd *abfd ATTRIBUTE_UNUSED;
- bfd_reloc_code_real_type code;
+coff_i386_reloc_type_lookup (bfd *abfd ATTRIBUTE_UNUSED,
+ bfd_reloc_code_real_type code)
{
switch (code)
{
a leading dot for local labels, so if TARGET_UNDERSCORE is defined
we treat all symbols starting with L as local. */
-static bfd_boolean coff_i386_is_local_label_name
- PARAMS ((bfd *, const char *));
-
static bfd_boolean
-coff_i386_is_local_label_name (abfd, name)
- bfd *abfd;
- const char *name;
+coff_i386_is_local_label_name (bfd *abfd, const char *name)
{
if (name[0] == 'L')
return TRUE;
/* BFD back-end for Intel 960 COFF files.
Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1997, 1999, 2000, 2001,
- 2002, 2003, 2004, 2005, 2007, 2008, 2009, 2011
+ 2002, 2003, 2004, 2005, 2007, 2008, 2009, 2011, 2012
Free Software Foundation, Inc.
Written by Cygnus Support.
#include "libcoff.h" /* To allow easier abstraction-breaking. */
-static bfd_boolean coff_i960_is_local_label_name
- PARAMS ((bfd *, const char *));
-static bfd_reloc_status_type optcall_callback
- PARAMS ((bfd *, arelent *, asymbol *, PTR, asection *, bfd *, char **));
-static bfd_reloc_status_type coff_i960_relocate
- PARAMS ((bfd *, arelent *, asymbol *, PTR, asection *, bfd *, char **));
-static reloc_howto_type *coff_i960_reloc_type_lookup
- PARAMS ((bfd *, bfd_reloc_code_real_type));
-static bfd_boolean coff_i960_start_final_link
- PARAMS ((bfd *, struct bfd_link_info *));
-static bfd_boolean coff_i960_relocate_section
- PARAMS ((bfd *, struct bfd_link_info *, bfd *, asection *, bfd_byte *,
- struct internal_reloc *, struct internal_syment *, asection **));
-static bfd_boolean coff_i960_adjust_symndx
- PARAMS ((bfd *, struct bfd_link_info *, bfd *, asection *,
- struct internal_reloc *, bfd_boolean *));
#define COFF_DEFAULT_SECTION_ALIGNMENT_POWER (3)
#define COFF_ALIGN_IN_SECTION_HEADER 1
/* This set of local label names is taken from gas. */
static bfd_boolean
-coff_i960_is_local_label_name (abfd, name)
- bfd *abfd ATTRIBUTE_UNUSED;
- const char *name;
+coff_i960_is_local_label_name (bfd *abfd ATTRIBUTE_UNUSED, const char *name)
{
return (name[0] == 'L'
|| (name[0] == '.'
#define BAL_MASK 0x00ffffff
static bfd_reloc_status_type
-optcall_callback (abfd, reloc_entry, symbol_in, data,
- input_section, ignore_bfd, error_message)
- bfd *abfd;
- arelent *reloc_entry;
- asymbol *symbol_in;
- PTR data;
- asection *input_section;
- bfd *ignore_bfd ATTRIBUTE_UNUSED;
- char **error_message;
+optcall_callback (bfd *abfd,
+ arelent *reloc_entry,
+ asymbol *symbol_in,
+ void * data,
+ asection *input_section,
+ bfd *ignore_bfd ATTRIBUTE_UNUSED,
+ char **error_message)
{
/* This item has already been relocated correctly, but we may be
* able to patch in yet better code - done by digging out the
COFF specific backend linker. */
static bfd_reloc_status_type
-coff_i960_relocate (abfd, reloc_entry, symbol, data, input_section,
- output_bfd, error_message)
- bfd *abfd;
- arelent *reloc_entry;
- asymbol *symbol;
- PTR data ATTRIBUTE_UNUSED;
- asection *input_section ATTRIBUTE_UNUSED;
- bfd *output_bfd;
- char **error_message ATTRIBUTE_UNUSED;
+coff_i960_relocate (bfd *abfd,
+ arelent *reloc_entry,
+ asymbol *symbol,
+ void * data ATTRIBUTE_UNUSED,
+ asection *input_section ATTRIBUTE_UNUSED,
+ bfd *output_bfd,
+ char **error_message ATTRIBUTE_UNUSED)
{
asection *osec;
if (coff_section_data (output_bfd, osec) == NULL)
{
bfd_size_type amt = sizeof (struct coff_section_tdata);
- osec->used_by_bfd = (PTR) bfd_zalloc (abfd, amt);
+ osec->used_by_bfd = bfd_zalloc (abfd, amt);
if (osec->used_by_bfd == NULL)
return bfd_reloc_overflow;
}
- coff_section_data (output_bfd, osec)->tdata = (PTR) syms;
+ coff_section_data (output_bfd, osec)->tdata = syms;
}
/* Let bfd_perform_relocation do its thing, which will include
optcall_callback, "optcall", TRUE, 0x00ffffff, 0x00ffffff, 0);
static reloc_howto_type *
-coff_i960_reloc_type_lookup (abfd, code)
- bfd *abfd ATTRIBUTE_UNUSED;
- bfd_reloc_code_real_type code;
+coff_i960_reloc_type_lookup (bfd *abfd ATTRIBUTE_UNUSED,
+ bfd_reloc_code_real_type code)
{
switch (code)
{
necessary symbols. */
static bfd_boolean
-coff_i960_start_final_link (abfd, info)
- bfd *abfd;
- struct bfd_link_info *info;
+coff_i960_start_final_link (bfd *abfd, struct bfd_link_info *info)
{
bfd_size_type symesz = bfd_coff_symesz (abfd);
asection *o;
isym.n_sclass = C_STAT;
isym.n_numaux = 0;
- bfd_coff_swap_sym_out (abfd, (PTR) &isym, (PTR) esym);
+ bfd_coff_swap_sym_out (abfd, &isym, esym);
if (bfd_bwrite (esym, symesz, abfd) != symesz)
{
/* The reloc processing routine for the optimized COFF linker. */
static bfd_boolean
-coff_i960_relocate_section (output_bfd, info, input_bfd, input_section,
- contents, relocs, syms, sections)
- bfd *output_bfd ATTRIBUTE_UNUSED;
- struct bfd_link_info *info;
- bfd *input_bfd;
- asection *input_section;
- bfd_byte *contents;
- struct internal_reloc *relocs;
- struct internal_syment *syms;
- asection **sections;
+coff_i960_relocate_section (bfd *output_bfd ATTRIBUTE_UNUSED,
+ struct bfd_link_info *info,
+ bfd *input_bfd,
+ asection *input_section,
+ bfd_byte *contents,
+ struct internal_reloc *relocs,
+ struct internal_syment *syms,
+ asection **sections)
{
struct internal_reloc *rel;
struct internal_reloc *relend;
BFD_ASSERT (sym->n_numaux == 2);
esyms = (bfd_byte *) obj_coff_external_syms (input_bfd);
esyms += (symndx + 2) * bfd_coff_symesz (input_bfd);
- bfd_coff_swap_aux_in (input_bfd, (PTR) esyms, sym->n_type,
+ bfd_coff_swap_aux_in (input_bfd, esyms, sym->n_type,
sym->n_sclass, 1, sym->n_numaux,
- (PTR) &aux);
+ &aux);
olf = aux.x_bal.x_balntry;
}
for the section. */
static bfd_boolean
-coff_i960_adjust_symndx (obfd, info, ibfd, sec, irel, adjustedp)
- bfd *obfd ATTRIBUTE_UNUSED;
- struct bfd_link_info *info ATTRIBUTE_UNUSED;
- bfd *ibfd;
- asection *sec ATTRIBUTE_UNUSED;
- struct internal_reloc *irel;
- bfd_boolean *adjustedp;
+coff_i960_adjust_symndx (bfd *obfd ATTRIBUTE_UNUSED,
+ struct bfd_link_info *info ATTRIBUTE_UNUSED,
+ bfd *ibfd,
+ asection *sec ATTRIBUTE_UNUSED,
+ struct internal_reloc *irel,
+ bfd_boolean *adjustedp)
{
struct coff_link_hash_entry *h;
/* BFD back-end for HP/Intel IA-64 COFF files.
- Copyright 1999, 2000, 2001, 2002, 2005, 2007, 2008, 2009, 2011
+ Copyright 1999, 2000, 2001, 2002, 2005, 2007, 2008, 2009, 2011, 2012
Free Software Foundation, Inc.
Contributed by David Mosberger <davidm@hpl.hp.com>
/* Return TRUE if this relocation should
appear in the output .reloc section. */
-static bfd_boolean in_reloc_p PARAMS ((bfd *, reloc_howto_type *));
-
static bfd_boolean
-in_reloc_p(abfd, howto)
- bfd * abfd ATTRIBUTE_UNUSED;
- reloc_howto_type *howto ATTRIBUTE_UNUSED;
+in_reloc_p (bfd * abfd ATTRIBUTE_UNUSED,
+ reloc_howto_type *howto ATTRIBUTE_UNUSED)
{
return FALSE; /* We don't do relocs for now... */
}
#include "coffcode.h"
-static const bfd_target *ia64coff_object_p PARAMS ((bfd *));
-
static const bfd_target *
-ia64coff_object_p (abfd)
- bfd *abfd;
+ia64coff_object_p (bfd *abfd)
{
#ifdef COFF_IMAGE_WITH_PE
{
/* BFD back-end for Motorola 68000 COFF binaries.
Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1999,
- 2000, 2001, 2002, 2003, 2005, 2007, 2008
+ 2000, 2001, 2002, 2003, 2005, 2007, 2008, 2012
Free Software Foundation, Inc.
Written by Cygnus Support.
#define RELOC_SPECIAL_FN 0
#else
static bfd_reloc_status_type m68kcoff_common_addend_special_fn
- PARAMS ((bfd *, arelent *, asymbol *, PTR, asection *, bfd *, char **));
-static reloc_howto_type *m68kcoff_common_addend_rtype_to_howto
- PARAMS ((bfd *, asection *, struct internal_reloc *,
- struct coff_link_hash_entry *, struct internal_syment *,
- bfd_vma *));
+ (bfd *, arelent *, asymbol *, void *, asection *, bfd *, char **);
+
#define RELOC_SPECIAL_FN m68kcoff_common_addend_special_fn
#endif
-static bfd_boolean m68k_coff_is_local_label_name
- PARAMS ((bfd *, const char *));
+static bfd_boolean m68k_coff_is_local_label_name (bfd *, const char *);
/* On the delta, a symbol starting with L% is local. We won't see
such a symbol on other platforms, so it should be safe to always
consider it local here. */
static bfd_boolean
-m68k_coff_is_local_label_name (abfd, name)
- bfd *abfd;
- const char *name;
+m68k_coff_is_local_label_name (bfd *abfd, const char *name)
{
if (name[0] == 'L' && name[1] == '%')
return TRUE;
/* Turn a howto into a reloc number */
#ifdef ONLY_DECLARE_RELOCS
-extern void m68k_rtype2howto PARAMS ((arelent *internal, int relocentry));
-extern int m68k_howto2rtype PARAMS ((reloc_howto_type *));
-extern reloc_howto_type *m68k_reloc_type_lookup
- PARAMS ((bfd *, bfd_reloc_code_real_type));
-extern reloc_howto_type *m68k_reloc_name_lookup
- PARAMS ((bfd *, const char *));
+extern void m68k_rtype2howto (arelent *internal, int relocentry);
+extern int m68k_howto2rtype (reloc_howto_type *);
+extern reloc_howto_type * m68k_reloc_type_lookup
+ (bfd *, bfd_reloc_code_real_type);
+extern reloc_howto_type * m68k_reloc_name_lookup (bfd *, const char *);
#else
#ifdef STATIC_RELOCS
#define STAT_REL
#endif
-STAT_REL reloc_howto_type * m68k_reloc_type_lookup PARAMS ((bfd *, bfd_reloc_code_real_type));
-STAT_REL reloc_howto_type * m68k_reloc_name_lookup PARAMS ((bfd *, const char *));
-STAT_REL int m68k_howto2rtype PARAMS ((reloc_howto_type *));
-STAT_REL void m68k_rtype2howto PARAMS ((arelent *, int));
-
+STAT_REL void m68k_rtype2howto (arelent *, int);
+STAT_REL int m68k_howto2rtype (reloc_howto_type *);
+STAT_REL reloc_howto_type * m68k_reloc_type_lookup (bfd *, bfd_reloc_code_real_type);
+STAT_REL reloc_howto_type * m68k_reloc_name_lookup (bfd *, const char *);
STAT_REL void
-m68k_rtype2howto(internal, relocentry)
- arelent *internal;
- int relocentry;
+m68k_rtype2howto (arelent *internal, int relocentry)
{
switch (relocentry)
{
}
STAT_REL int
-m68k_howto2rtype (internal)
- reloc_howto_type *internal;
+m68k_howto2rtype (reloc_howto_type * internal)
{
if (internal->pc_relative)
{
}
STAT_REL reloc_howto_type *
-m68k_reloc_type_lookup (abfd, code)
- bfd *abfd ATTRIBUTE_UNUSED;
- bfd_reloc_code_real_type code;
+m68k_reloc_type_lookup (bfd *abfd ATTRIBUTE_UNUSED,
+ bfd_reloc_code_real_type code)
{
switch (code)
{
#define coff_rtype_to_howto m68kcoff_rtype_to_howto
-static reloc_howto_type *m68kcoff_rtype_to_howto
- PARAMS ((bfd *, asection *, struct internal_reloc *,
- struct coff_link_hash_entry *, struct internal_syment *,
- bfd_vma *));
-
static reloc_howto_type *
-m68kcoff_rtype_to_howto (abfd, sec, rel, h, sym, addendp)
- bfd *abfd ATTRIBUTE_UNUSED;
- asection *sec;
- struct internal_reloc *rel;
- struct coff_link_hash_entry *h ATTRIBUTE_UNUSED;
- struct internal_syment *sym ATTRIBUTE_UNUSED;
- bfd_vma *addendp;
+m68kcoff_rtype_to_howto (bfd *abfd ATTRIBUTE_UNUSED,
+ asection *sec,
+ struct internal_reloc *rel,
+ struct coff_link_hash_entry *h ATTRIBUTE_UNUSED,
+ struct internal_syment *sym ATTRIBUTE_UNUSED,
+ bfd_vma *addendp)
{
arelent relent;
reloc_howto_type *howto;
reloc type to make any required adjustments. */
static bfd_reloc_status_type
-m68kcoff_common_addend_special_fn (abfd, reloc_entry, symbol, data,
- input_section, output_bfd, error_message)
- bfd *abfd;
- arelent *reloc_entry;
- asymbol *symbol;
- PTR data;
- asection *input_section ATTRIBUTE_UNUSED;
- bfd *output_bfd;
- char **error_message ATTRIBUTE_UNUSED;
+m68kcoff_common_addend_special_fn (bfd *abfd,
+ arelent *reloc_entry,
+ asymbol *symbol,
+ void * data,
+ asection *input_section ATTRIBUTE_UNUSED,
+ bfd *output_bfd,
+ char **error_message ATTRIBUTE_UNUSED)
{
symvalue diff;
adjust common symbols. */
static reloc_howto_type *
-m68kcoff_common_addend_rtype_to_howto (abfd, sec, rel, h, sym, addendp)
- bfd *abfd ATTRIBUTE_UNUSED;
- asection *sec;
- struct internal_reloc *rel;
- struct coff_link_hash_entry *h;
- struct internal_syment *sym;
- bfd_vma *addendp;
+m68kcoff_common_addend_rtype_to_howto (bfd *abfd ATTRIBUTE_UNUSED,
+ asection *sec,
+ struct internal_reloc *rel,
+ struct coff_link_hash_entry *h,
+ struct internal_syment *sym,
+ bfd_vma *addendp)
{
arelent relent;
reloc_howto_type *howto;
objects, and before the final_link entry point is called. */
bfd_boolean
-bfd_m68k_coff_create_embedded_relocs (abfd, info, datasec, relsec, errmsg)
- bfd *abfd;
- struct bfd_link_info *info;
- asection *datasec;
- asection *relsec;
- char **errmsg;
+bfd_m68k_coff_create_embedded_relocs (bfd *abfd,
+ struct bfd_link_info *info,
+ asection *datasec,
+ asection *relsec,
+ char **errmsg)
{
char *extsyms;
bfd_size_type symesz;
/* BFD back-end for Motorola 88000 COFF "Binary Compatibility Standard" files.
Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1997, 1998, 1999, 2000,
- 2001, 2002, 2003, 2005, 2007, 2008 Free Software Foundation, Inc.
+ 2001, 2002, 2003, 2005, 2007, 2008, 2012 Free Software Foundation, Inc.
Written by Cygnus Support.
This file is part of BFD, the Binary File Descriptor library.
#include "coff/internal.h"
#include "libcoff.h"
-static bfd_boolean m88k_is_local_label_name PARAMS ((bfd *, const char *));
static bfd_reloc_status_type m88k_special_reloc
- PARAMS ((bfd *, arelent *, asymbol *, PTR, asection *, bfd *, char **));
-static void rtype2howto PARAMS ((arelent *, struct internal_reloc *));
-static void reloc_processing
- PARAMS ((arelent *, struct internal_reloc *, asymbol **, bfd *, asection *));
+ (bfd *, arelent *, asymbol *, void *, asection *, bfd *, char **);
#define COFF_DEFAULT_SECTION_ALIGNMENT_POWER (3)
#define coff_bfd_is_local_label_name m88k_is_local_label_name
static bfd_boolean
-m88k_is_local_label_name (abfd, name)
- bfd *abfd ATTRIBUTE_UNUSED;
- const char *name;
+m88k_is_local_label_name (bfd *abfd ATTRIBUTE_UNUSED, const char *name)
{
return name[0] == '@';
}
static bfd_reloc_status_type
-m88k_special_reloc (abfd, reloc_entry, symbol, data,
- input_section, output_bfd, error_message)
- bfd *abfd;
- arelent *reloc_entry;
- asymbol *symbol;
- PTR data;
- asection *input_section;
- bfd *output_bfd;
- char **error_message ATTRIBUTE_UNUSED;
+m88k_special_reloc (bfd *abfd,
+ arelent *reloc_entry,
+ asymbol *symbol,
+ void * data,
+ asection *input_section,
+ bfd *output_bfd,
+ char **error_message ATTRIBUTE_UNUSED)
{
reloc_howto_type *howto = reloc_entry->howto;
/* Code to turn an external r_type into a pointer to an entry in the
above howto table. */
static void
-rtype2howto (cache_ptr, dst)
- arelent *cache_ptr;
- struct internal_reloc *dst;
+rtype2howto (arelent *cache_ptr, struct internal_reloc *dst)
{
if (dst->r_type >= R_PCR16L && dst->r_type <= R_VRT32)
{
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);
/* BFD back-end for Motorola MCore COFF/PE
- Copyright 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2007, 2010, 2011
+ Copyright 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2007, 2010, 2011, 2012
Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library.
/* This file is compiled more than once, but we only compile the
final_link routine once. */
extern bfd_boolean mcore_bfd_coff_final_link
- PARAMS ((bfd *, struct bfd_link_info *));
+ (bfd *, struct bfd_link_info *);
static bfd_reloc_status_type mcore_coff_unsupported_reloc
- PARAMS ((bfd *, arelent *, asymbol *, PTR, asection *, bfd *, char **));
-static bfd_boolean coff_mcore_relocate_section
- PARAMS ((bfd *, struct bfd_link_info *, bfd *, asection *, bfd_byte *,
- struct internal_reloc *, struct internal_syment *, asection **));
-static reloc_howto_type *mcore_coff_reloc_type_lookup
- PARAMS ((bfd *, bfd_reloc_code_real_type));
-static reloc_howto_type *coff_mcore_rtype_to_howto
- PARAMS ((bfd *, asection *, struct internal_reloc *,
- struct coff_link_hash_entry *, struct internal_syment *,
- bfd_vma *));
-static bfd_boolean in_reloc_p PARAMS ((bfd *, reloc_howto_type *));
+ (bfd *, arelent *, asymbol *, void *, asection *, bfd *, char **);
+
\f
/* The NT loader points the toc register to &toc + 32768, in order to
use the complete range of a 16-bit displacement. We have to adjust
}
\f
static bfd_reloc_status_type
-mcore_coff_unsupported_reloc (abfd, reloc_entry, symbol, data, input_section,
- output_bfd, error_message)
- bfd * abfd;
- arelent * reloc_entry;
- asymbol * symbol ATTRIBUTE_UNUSED;
- PTR data ATTRIBUTE_UNUSED;
- asection * input_section ATTRIBUTE_UNUSED;
- bfd * output_bfd ATTRIBUTE_UNUSED;
- char ** error_message ATTRIBUTE_UNUSED;
+mcore_coff_unsupported_reloc (bfd * abfd,
+ arelent * reloc_entry,
+ asymbol * symbol ATTRIBUTE_UNUSED,
+ void * data ATTRIBUTE_UNUSED,
+ asection * input_section ATTRIBUTE_UNUSED,
+ bfd * output_bfd ATTRIBUTE_UNUSED,
+ char ** error_message ATTRIBUTE_UNUSED)
{
BFD_ASSERT (reloc_entry->howto != (reloc_howto_type *)0);
case bfd_rtype: return & mcore_coff_howto_table [mcore_rtype]
static reloc_howto_type *
-mcore_coff_reloc_type_lookup (abfd, code)
- bfd * abfd ATTRIBUTE_UNUSED;
- bfd_reloc_code_real_type code;
+mcore_coff_reloc_type_lookup (bfd * abfd ATTRIBUTE_UNUSED,
+ bfd_reloc_code_real_type code)
{
switch (code)
{
(cache_ptr)->howto = mcore_coff_howto_table + (dst)->r_type;
static reloc_howto_type *
-coff_mcore_rtype_to_howto (abfd, sec, rel, h, sym, addendp)
- bfd * abfd ATTRIBUTE_UNUSED;
- asection * sec;
- struct internal_reloc * rel;
- struct coff_link_hash_entry * h ATTRIBUTE_UNUSED;
- struct internal_syment * sym;
- bfd_vma * addendp;
+coff_mcore_rtype_to_howto (bfd * abfd ATTRIBUTE_UNUSED,
+ asection * sec,
+ struct internal_reloc * rel,
+ struct coff_link_hash_entry * h ATTRIBUTE_UNUSED,
+ struct internal_syment * sym,
+ bfd_vma * addendp)
{
reloc_howto_type * howto;
This function is referenced in pe_mkobject in peicode.h. */
static bfd_boolean
-in_reloc_p (abfd, howto)
- bfd * abfd ATTRIBUTE_UNUSED;
- reloc_howto_type * howto;
+in_reloc_p (bfd * abfd ATTRIBUTE_UNUSED, reloc_howto_type * howto)
{
return ! howto->pc_relative && howto->type != IMAGE_REL_MCORE_RVA;
}
\f
/* The reloc processing routine for the optimized COFF linker. */
static bfd_boolean
-coff_mcore_relocate_section (output_bfd, info, input_bfd, input_section,
- contents, relocs, syms, sections)
- bfd * output_bfd;
- struct bfd_link_info * info;
- bfd * input_bfd;
- asection * input_section;
- bfd_byte * contents;
- struct internal_reloc * relocs;
- struct internal_syment * syms;
- asection ** sections;
+coff_mcore_relocate_section (bfd * output_bfd,
+ struct bfd_link_info * info,
+ bfd * input_bfd,
+ asection * input_section,
+ bfd_byte * contents,
+ struct internal_reloc * relocs,
+ struct internal_syment * syms,
+ asection ** sections)
{
struct internal_reloc * rel;
struct internal_reloc * relend;
/* BFD back-end for MIPS Extended-Coff files.
Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
- 2000, 2001, 2002, 2003, 2004, 2005, 2007, 2008, 2009, 2011
+ 2000, 2001, 2002, 2003, 2004, 2005, 2007, 2008, 2009, 2011, 2012
Free Software Foundation, Inc.
Original version by Per Bothner.
Full support added by Ian Lance Taylor, ian@cygnus.com.
#include "libecoff.h"
\f
/* Prototypes for static functions. */
+static bfd_reloc_status_type
+mips_generic_reloc
+ (bfd *, arelent *, asymbol *, void *, asection *, bfd *, char **);
+static bfd_reloc_status_type
+mips_refhi_reloc
+ (bfd *, arelent *, asymbol *, void *, asection *, bfd *, char **);
+static bfd_reloc_status_type
+mips_reflo_reloc
+ (bfd *, arelent *, asymbol *, void *, asection *, bfd *, char **);
+static bfd_reloc_status_type
+mips_gprel_reloc
+ (bfd *, arelent *, asymbol *, void *, asection *, bfd *, char **);
-static bfd_boolean mips_ecoff_bad_format_hook
- PARAMS ((bfd *abfd, PTR filehdr));
-static void mips_ecoff_swap_reloc_in
- PARAMS ((bfd *, PTR, struct internal_reloc *));
-static void mips_ecoff_swap_reloc_out
- PARAMS ((bfd *, const struct internal_reloc *, PTR));
-static void mips_adjust_reloc_in
- PARAMS ((bfd *, const struct internal_reloc *, arelent *));
-static void mips_adjust_reloc_out
- PARAMS ((bfd *, const arelent *, struct internal_reloc *));
-static bfd_reloc_status_type mips_generic_reloc
- PARAMS ((bfd *abfd, arelent *reloc, asymbol *symbol, PTR data,
- asection *section, bfd *output_bfd, char **error));
-static bfd_reloc_status_type mips_refhi_reloc
- PARAMS ((bfd *abfd, arelent *reloc, asymbol *symbol, PTR data,
- asection *section, bfd *output_bfd, char **error));
-static bfd_reloc_status_type mips_reflo_reloc
- PARAMS ((bfd *abfd, arelent *reloc, asymbol *symbol, PTR data,
- asection *section, bfd *output_bfd, char **error));
-static bfd_reloc_status_type mips_gprel_reloc
- PARAMS ((bfd *abfd, arelent *reloc, asymbol *symbol, PTR data,
- asection *section, bfd *output_bfd, char **error));
-static void mips_relocate_hi
- PARAMS ((struct internal_reloc *refhi, struct internal_reloc *reflo,
- bfd *input_bfd, asection *input_section, bfd_byte *contents,
- bfd_vma relocation));
-static bfd_boolean mips_relocate_section
- PARAMS ((bfd *, struct bfd_link_info *, bfd *, asection *, bfd_byte *, PTR));
-static reloc_howto_type *mips_bfd_reloc_type_lookup
- PARAMS ((bfd *, bfd_reloc_code_real_type));
\f
/* ECOFF has COFF sections, but the debugging information is stored in
a completely different format. ECOFF targets use some of the
#define NO_COFF_RELOCS
#define NO_COFF_SYMBOLS
#define NO_COFF_LINENOS
-#define coff_swap_filehdr_in mips_ecoff_swap_filehdr_in
+#define coff_swap_filehdr_in mips_ecoff_swap_filehdr_in
#define coff_swap_filehdr_out mips_ecoff_swap_filehdr_out
-#define coff_swap_aouthdr_in mips_ecoff_swap_aouthdr_in
+#define coff_swap_aouthdr_in mips_ecoff_swap_aouthdr_in
#define coff_swap_aouthdr_out mips_ecoff_swap_aouthdr_out
-#define coff_swap_scnhdr_in mips_ecoff_swap_scnhdr_in
-#define coff_swap_scnhdr_out mips_ecoff_swap_scnhdr_out
+#define coff_swap_scnhdr_in mips_ecoff_swap_scnhdr_in
+#define coff_swap_scnhdr_out mips_ecoff_swap_scnhdr_out
#include "coffswap.h"
/* See whether the magic number matches. */
static bfd_boolean
-mips_ecoff_bad_format_hook (abfd, filehdr)
- bfd *abfd;
- PTR filehdr;
+mips_ecoff_bad_format_hook (bfd * abfd, void * filehdr)
{
struct internal_filehdr *internal_f = (struct internal_filehdr *) filehdr;
/* Swap a reloc in. */
static void
-mips_ecoff_swap_reloc_in (abfd, ext_ptr, intern)
- bfd *abfd;
- PTR ext_ptr;
- struct internal_reloc *intern;
+mips_ecoff_swap_reloc_in (bfd * abfd,
+ void * ext_ptr,
+ struct internal_reloc *intern)
{
const RELOC *ext = (RELOC *) ext_ptr;
/* Swap a reloc out. */
static void
-mips_ecoff_swap_reloc_out (abfd, intern, dst)
- bfd *abfd;
- const struct internal_reloc *intern;
- PTR dst;
+mips_ecoff_swap_reloc_out (bfd * abfd,
+ const struct internal_reloc * intern,
+ void * dst)
{
RELOC *ext = (RELOC *) dst;
long r_symndx;
this backend routine. It must fill in the howto field. */
static void
-mips_adjust_reloc_in (abfd, intern, rptr)
- bfd *abfd;
- const struct internal_reloc *intern;
- arelent *rptr;
+mips_adjust_reloc_in (bfd *abfd,
+ const struct internal_reloc *intern,
+ arelent *rptr)
{
if (intern->r_type > MIPS_R_PCREL16)
abort ();
are needed for MIPS. */
static void
-mips_adjust_reloc_out (abfd, rel, intern)
- bfd *abfd ATTRIBUTE_UNUSED;
- const arelent *rel ATTRIBUTE_UNUSED;
- struct internal_reloc *intern ATTRIBUTE_UNUSED;
+mips_adjust_reloc_out (bfd *abfd ATTRIBUTE_UNUSED,
+ const arelent *rel ATTRIBUTE_UNUSED,
+ struct internal_reloc *intern ATTRIBUTE_UNUSED)
{
}
relocatable output against an external symbol. */
static bfd_reloc_status_type
-mips_generic_reloc (abfd,
- reloc_entry,
- symbol,
- data,
- input_section,
- output_bfd,
- error_message)
- bfd *abfd ATTRIBUTE_UNUSED;
- arelent *reloc_entry;
- asymbol *symbol;
- PTR data ATTRIBUTE_UNUSED;
- asection *input_section;
- bfd *output_bfd;
- char **error_message ATTRIBUTE_UNUSED;
+mips_generic_reloc (bfd *abfd ATTRIBUTE_UNUSED,
+ arelent *reloc_entry,
+ asymbol *symbol,
+ void * data ATTRIBUTE_UNUSED,
+ asection *input_section,
+ bfd *output_bfd,
+ char **error_message ATTRIBUTE_UNUSED)
{
if (output_bfd != (bfd *) NULL
&& (symbol->flags & BSF_SECTION_SYM) == 0
static struct mips_hi *mips_refhi_list;
static bfd_reloc_status_type
-mips_refhi_reloc (abfd,
- reloc_entry,
- symbol,
- data,
- input_section,
- output_bfd,
- error_message)
- bfd *abfd ATTRIBUTE_UNUSED;
- arelent *reloc_entry;
- asymbol *symbol;
- PTR data;
- asection *input_section;
- bfd *output_bfd;
- char **error_message ATTRIBUTE_UNUSED;
+mips_refhi_reloc (bfd *abfd ATTRIBUTE_UNUSED,
+ arelent *reloc_entry,
+ asymbol *symbol,
+ void * data,
+ asection *input_section,
+ bfd *output_bfd,
+ char **error_message ATTRIBUTE_UNUSED)
{
bfd_reloc_status_type ret;
bfd_vma relocation;
relocation described above. */
static bfd_reloc_status_type
-mips_reflo_reloc (abfd,
- reloc_entry,
- symbol,
- data,
- input_section,
- output_bfd,
- error_message)
- bfd *abfd;
- arelent *reloc_entry;
- asymbol *symbol;
- PTR data;
- asection *input_section;
- bfd *output_bfd;
- char **error_message;
+mips_reflo_reloc (bfd *abfd ATTRIBUTE_UNUSED,
+ arelent *reloc_entry,
+ asymbol *symbol,
+ void * data,
+ asection *input_section,
+ bfd *output_bfd,
+ char **error_message ATTRIBUTE_UNUSED)
{
if (mips_refhi_list != NULL)
{
the offset from the gp register. */
static bfd_reloc_status_type
-mips_gprel_reloc (abfd,
- reloc_entry,
- symbol,
- data,
- input_section,
- output_bfd,
- error_message)
- bfd *abfd;
- arelent *reloc_entry;
- asymbol *symbol;
- PTR data;
- asection *input_section;
- bfd *output_bfd;
- char **error_message;
+mips_gprel_reloc (bfd *abfd ATTRIBUTE_UNUSED,
+ arelent *reloc_entry,
+ asymbol *symbol,
+ void * data,
+ asection *input_section,
+ bfd *output_bfd,
+ char **error_message ATTRIBUTE_UNUSED)
{
bfd_boolean relocatable;
bfd_vma gp;
/* Get the howto structure for a generic reloc type. */
static reloc_howto_type *
-mips_bfd_reloc_type_lookup (abfd, code)
- bfd *abfd ATTRIBUTE_UNUSED;
- bfd_reloc_code_real_type code;
+mips_bfd_reloc_type_lookup (bfd *abfd ATTRIBUTE_UNUSED,
+ bfd_reloc_code_real_type code)
{
int mips_type;
instructions. */
static void
-mips_relocate_hi (refhi, reflo, input_bfd, input_section, contents,
- relocation)
- struct internal_reloc *refhi;
- struct internal_reloc *reflo;
- bfd *input_bfd;
- asection *input_section;
- bfd_byte *contents;
- bfd_vma relocation;
+mips_relocate_hi (struct internal_reloc *refhi,
+ struct internal_reloc *reflo,
+ bfd *input_bfd,
+ asection *input_section,
+ bfd_byte *contents,
+ bfd_vma relocation)
{
unsigned long insn;
unsigned long val;
/* Relocate a section while linking a MIPS ECOFF file. */
static bfd_boolean
-mips_relocate_section (output_bfd, info, input_bfd, input_section,
- contents, external_relocs)
- bfd *output_bfd;
- struct bfd_link_info *info;
- bfd *input_bfd;
- asection *input_section;
- bfd_byte *contents;
- PTR external_relocs;
+mips_relocate_section (bfd *output_bfd,
+ struct bfd_link_info *info,
+ bfd *input_bfd,
+ asection *input_section,
+ bfd_byte *contents,
+ void * external_relocs)
{
asection **symndx_to_section;
struct ecoff_link_hash_entry **sym_hashes;
bfd_reloc_status_type r;
if (! got_lo)
- mips_ecoff_swap_reloc_in (input_bfd, (PTR) ext_rel, &int_rel);
+ mips_ecoff_swap_reloc_in (input_bfd, ext_rel, &int_rel);
else
{
int_rel = lo_int_rel;
lo_ext_rel < ext_rel_end;
lo_ext_rel++)
{
- mips_ecoff_swap_reloc_in (input_bfd, (PTR) lo_ext_rel,
+ mips_ecoff_swap_reloc_in (input_bfd, lo_ext_rel,
&lo_int_rel);
if (lo_int_rel.r_type != int_rel.r_type)
break;
- input_section->vma);
/* Save the changed reloc information. */
- mips_ecoff_swap_reloc_out (input_bfd, &int_rel, (PTR) ext_rel);
+ mips_ecoff_swap_reloc_out (input_bfd, &int_rel, ext_rel);
}
else
{
{
/* COFF backend structure. */
{
- (void (*) PARAMS ((bfd *,PTR,int,int,int,int,PTR))) bfd_void, /* aux_in */
- (void (*) PARAMS ((bfd *,PTR,PTR))) bfd_void, /* sym_in */
- (void (*) PARAMS ((bfd *,PTR,PTR))) bfd_void, /* lineno_in */
- (unsigned (*) PARAMS ((bfd *,PTR,int,int,int,int,PTR)))bfd_void,/*aux_out*/
- (unsigned (*) PARAMS ((bfd *,PTR,PTR))) bfd_void, /* sym_out */
- (unsigned (*) PARAMS ((bfd *,PTR,PTR))) bfd_void, /* lineno_out */
- (unsigned (*) PARAMS ((bfd *,PTR,PTR))) bfd_void, /* reloc_out */
+ (void (*) (bfd *,void *,int,int,int,int,void *)) bfd_void, /* aux_in */
+ (void (*) (bfd *,void *,void *)) bfd_void, /* sym_in */
+ (void (*) (bfd *,void *,void *)) bfd_void, /* lineno_in */
+ (unsigned (*) (bfd *,void *,int,int,int,int,void *)) bfd_void,/*aux_out*/
+ (unsigned (*) (bfd *,void *,void *)) bfd_void, /* sym_out */
+ (unsigned (*) (bfd *,void *,void *)) bfd_void, /* lineno_out */
+ (unsigned (*) (bfd *,void *,void *)) bfd_void, /* reloc_out */
mips_ecoff_swap_filehdr_out, mips_ecoff_swap_aouthdr_out,
mips_ecoff_swap_scnhdr_out,
FILHSZ, AOUTSZ, SCNHSZ, 0, 0, 0, 0, FILNMLEN, TRUE,
& ecoff_big_vec,
- (PTR) &mips_ecoff_backend_data
+ & mips_ecoff_backend_data
};
const bfd_target ecoff_big_vec =
& ecoff_little_vec,
- (PTR) &mips_ecoff_backend_data
+ & mips_ecoff_backend_data
};
const bfd_target ecoff_biglittle_vec =
NULL,
- (PTR) &mips_ecoff_backend_data
+ & mips_ecoff_backend_data
};
/* BFD back-end for OpenRISC 1000 COFF binaries.
- Copyright 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2011
+ Copyright 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2011, 2012
Free Software Foundation, Inc.
Contributed by Ivan Guzvinec <ivang@opencores.org>
#include "coff/internal.h"
#include "libcoff.h"
-static long get_symbol_value
- PARAMS ((asymbol *));
static bfd_reloc_status_type or32_reloc
- PARAMS ((bfd *, arelent *, asymbol *, PTR, asection *, bfd *, char **));
-static bfd_boolean coff_or32_relocate_section
- PARAMS ((bfd *, struct bfd_link_info *, bfd *, asection *, bfd_byte *,
- struct internal_reloc *, struct internal_syment *, asection **));
-static bfd_boolean coff_or32_adjust_symndx
- PARAMS ((bfd *, struct bfd_link_info *, bfd *, asection *,
- struct internal_reloc *, bfd_boolean *));
-static void reloc_processing
- PARAMS ((arelent *, struct internal_reloc *, asymbol **, bfd *, asection *));
+ (bfd *, arelent *, asymbol *, void *, asection *, bfd *, char **);
#define COFF_DEFAULT_SECTION_ALIGNMENT_POWER (2)
/* Provided the symbol, returns the value reffed. */
static long
-get_symbol_value (symbol)
- asymbol *symbol;
+get_symbol_value (asymbol *symbol)
{
long relocation = 0;
/* This function is in charge of performing all the or32 relocations. */
static bfd_reloc_status_type
-or32_reloc (abfd, reloc_entry, symbol_in, data, input_section, output_bfd,
- error_message)
- bfd *abfd;
- arelent *reloc_entry;
- asymbol *symbol_in;
- PTR data;
- asection *input_section;
- bfd *output_bfd;
- char **error_message;
+or32_reloc (bfd *abfd,
+ arelent *reloc_entry,
+ asymbol *symbol_in,
+ void * data,
+ asection *input_section,
+ bfd *output_bfd,
+ char **error_message)
{
/* The consth relocation comes in two parts, we have to remember
the state between calls, in these variables. */
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)
{
static bfd_vma ihihalf_vaddr = (bfd_vma) -1;
/* The reloc processing routine for the optimized COFF linker. */
static bfd_boolean
-coff_or32_relocate_section (output_bfd, info, input_bfd, input_section,
- contents, relocs, syms, sections)
- bfd *output_bfd ATTRIBUTE_UNUSED;
- struct bfd_link_info *info;
- bfd *input_bfd;
- asection *input_section;
- bfd_byte *contents;
- struct internal_reloc *relocs;
- struct internal_syment *syms;
- asection **sections;
+coff_or32_relocate_section (bfd *output_bfd ATTRIBUTE_UNUSED,
+ struct bfd_link_info *info,
+ bfd *input_bfd,
+ asection *input_section,
+ bfd_byte *contents,
+ struct internal_reloc *relocs,
+ struct internal_syment *syms,
+ asection **sections)
{
struct internal_reloc *rel;
struct internal_reloc *relend;
is actually an addend, not a symbol index at all. */
static bfd_boolean
-coff_or32_adjust_symndx (obfd, info, ibfd, sec, irel, adjustedp)
- bfd *obfd ATTRIBUTE_UNUSED;
- struct bfd_link_info *info ATTRIBUTE_UNUSED;
- bfd *ibfd ATTRIBUTE_UNUSED;
- asection *sec ATTRIBUTE_UNUSED;
- struct internal_reloc *irel;
- bfd_boolean *adjustedp;
+coff_or32_adjust_symndx (bfd *obfd ATTRIBUTE_UNUSED,
+ struct bfd_link_info *info ATTRIBUTE_UNUSED,
+ bfd *ibfd ATTRIBUTE_UNUSED,
+ asection *sec ATTRIBUTE_UNUSED,
+ struct internal_reloc *irel,
+ bfd_boolean *adjustedp)
{
if (irel->r_type == R_IHCONST)
*adjustedp = TRUE;
/* BFD back-end for PowerPC Microsoft Portable Executable files.
Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
- 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011
- Free Software Foundation, Inc.
+ 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011,
+ 2012 Free Software Foundation, Inc.
Original version pieced together by Kim Knuttila (krk@cygnus.com)
/* This file is compiled more than once, but we only compile the
final_link routine once. */
-extern bfd_boolean ppc_bfd_coff_final_link
- PARAMS ((bfd *, struct bfd_link_info *));
-extern void dump_toc PARAMS ((PTR));
+extern bfd_boolean ppc_bfd_coff_final_link (bfd *, struct bfd_link_info *);
+extern void dump_toc (void *);
/* The toc is a set of bfd_vma fields. We use the fact that valid
addresses are even (i.e. the bit representing "1" is off) to allow
struct coff_link_hash_table root; /* First entry, as required. */
};
-static struct bfd_hash_entry *ppc_coff_link_hash_newfunc
- PARAMS ((struct bfd_hash_entry *, struct bfd_hash_table *,
- const char *));
-static struct bfd_link_hash_table *ppc_coff_link_hash_table_create
- PARAMS ((bfd *));
-static bfd_boolean coff_ppc_relocate_section
- PARAMS ((bfd *, struct bfd_link_info *, bfd *, asection *, bfd_byte *,
- struct internal_reloc *, struct internal_syment *, asection **));
-static reloc_howto_type *coff_ppc_rtype_to_howto
- PARAMS ((bfd *, asection *, struct internal_reloc *,
- struct coff_link_hash_entry *, struct internal_syment *,
- bfd_vma *));
-
/* Routine to create an entry in the link hash table. */
static struct bfd_hash_entry *
-ppc_coff_link_hash_newfunc (entry, table, string)
- struct bfd_hash_entry *entry;
- struct bfd_hash_table *table;
- const char *string;
+ppc_coff_link_hash_newfunc (struct bfd_hash_entry * entry,
+ struct bfd_hash_table * table,
+ const char * string)
{
struct ppc_coff_link_hash_entry *ret =
(struct ppc_coff_link_hash_entry *) entry;
static bfd_boolean
ppc_coff_link_hash_table_init (struct ppc_coff_link_hash_table *table,
bfd *abfd,
- struct bfd_hash_entry *(*newfunc) (struct bfd_hash_entry *,
- struct bfd_hash_table *,
- const char *),
+ struct bfd_hash_entry *(*newfunc)
+ (struct bfd_hash_entry *,
+ struct bfd_hash_table *,
+ const char *),
unsigned int entsize)
{
return _bfd_coff_link_hash_table_init (&table->root, abfd, newfunc, entsize);
/* Create a PE linker hash table. */
static struct bfd_link_hash_table *
-ppc_coff_link_hash_table_create (abfd)
- bfd *abfd;
+ppc_coff_link_hash_table_create (bfd *abfd)
{
struct ppc_coff_link_hash_table *ret;
bfd_size_type amt = sizeof (struct ppc_coff_link_hash_table);
/* Static helper functions to make relocation work. */
/* (Work In Progress) */
-static bfd_reloc_status_type ppc_refhi_reloc PARAMS ((bfd *abfd,
- arelent *reloc,
- asymbol *symbol,
- PTR data,
- asection *section,
- bfd *output_bfd,
- char **error));
-static bfd_reloc_status_type ppc_pair_reloc PARAMS ((bfd *abfd,
- arelent *reloc,
- asymbol *symbol,
- PTR data,
- asection *section,
- bfd *output_bfd,
- char **error));
-\f
-static bfd_reloc_status_type ppc_toc16_reloc PARAMS ((bfd *abfd,
- arelent *reloc,
- asymbol *symbol,
- PTR data,
- asection *section,
- bfd *output_bfd,
- char **error));
-
-static bfd_reloc_status_type ppc_section_reloc PARAMS ((bfd *abfd,
- arelent *reloc,
- asymbol *symbol,
- PTR data,
- asection *section,
- bfd *output_bfd,
- char **error));
-
-static bfd_reloc_status_type ppc_secrel_reloc PARAMS ((bfd *abfd,
- arelent *reloc,
- asymbol *symbol,
- PTR data,
- asection *section,
- bfd *output_bfd,
- char **error));
-
-static bfd_reloc_status_type ppc_imglue_reloc PARAMS ((bfd *abfd,
- arelent *reloc,
- asymbol *symbol,
- PTR data,
- asection *section,
- bfd *output_bfd,
- char **error));
-
-static bfd_boolean in_reloc_p PARAMS((bfd *abfd, reloc_howto_type *howto));
-\f
+static bfd_reloc_status_type ppc_refhi_reloc
+ (bfd *, arelent *, asymbol *, void *, asection *, bfd *, char **);
+static bfd_reloc_status_type ppc_pair_reloc
+ (bfd *, arelent *, asymbol *, void *, asection *, bfd *, char **);
+static bfd_reloc_status_type ppc_toc16_reloc
+ (bfd *, arelent *, asymbol *, void *, asection *, bfd *, char **);
+static bfd_reloc_status_type ppc_section_reloc
+ (bfd *, arelent *, asymbol *, void *, asection *, bfd *, char **);
+static bfd_reloc_status_type ppc_secrel_reloc
+ (bfd *, arelent *, asymbol *, void *, asection *, bfd *, char **);
+static bfd_reloc_status_type ppc_imglue_reloc
+ (bfd *, arelent *, asymbol *, void *, asection *, bfd *, char **);
+
/* FIXME: It'll take a while to get through all of these. I only need a few to
get us started, so those I'll make sure work. Those marked FIXME are either
completely unverified or have a specific unknown marked in the comment. */
extern struct list_ele *head;
extern struct list_ele *tail;
-static void record_toc
- PARAMS ((asection *, bfd_signed_vma, enum ref_category, const char *));
-
static void
-record_toc (toc_section, our_toc_offset, cat, name)
- asection *toc_section;
- bfd_signed_vma our_toc_offset;
- enum ref_category cat;
- const char *name;
+record_toc (asection *toc_section,
+ bfd_signed_vma our_toc_offset,
+ enum ref_category cat,
+ const char *name)
{
/* Add this entry to our toc addr-offset-name list. */
bfd_size_type amt = sizeof (struct list_ele);
#ifdef COFF_IMAGE_WITH_PE
-static bfd_boolean ppc_record_toc_entry
- PARAMS ((bfd *, struct bfd_link_info *, asection *, int, enum toc_type));
-static void ppc_mark_symbol_as_glue
- PARAMS ((bfd *, int, struct internal_reloc *));
-
/* Record a toc offset against a symbol. */
static bfd_boolean
-ppc_record_toc_entry(abfd, info, sec, sym, toc_kind)
- bfd *abfd;
- struct bfd_link_info *info ATTRIBUTE_UNUSED;
- asection *sec ATTRIBUTE_UNUSED;
- int sym;
- enum toc_type toc_kind ATTRIBUTE_UNUSED;
+ppc_record_toc_entry (bfd *abfd,
+ struct bfd_link_info *info ATTRIBUTE_UNUSED,
+ asection *sec ATTRIBUTE_UNUSED,
+ int sym,
+ enum toc_type toc_kind ATTRIBUTE_UNUSED)
{
struct ppc_coff_link_hash_entry *h;
int *local_syms;
/* Record a toc offset against a symbol. */
static void
-ppc_mark_symbol_as_glue(abfd, sym, rel)
- bfd *abfd;
- int sym;
- struct internal_reloc *rel;
+ppc_mark_symbol_as_glue (bfd *abfd,
+ int sym,
+ struct internal_reloc *rel)
{
struct ppc_coff_link_hash_entry *h;
/* Return TRUE if this relocation should
appear in the output .reloc section. */
-static bfd_boolean in_reloc_p(abfd, howto)
- bfd * abfd ATTRIBUTE_UNUSED;
- reloc_howto_type *howto;
+static bfd_boolean
+in_reloc_p (bfd * abfd ATTRIBUTE_UNUSED,
+ reloc_howto_type *howto)
{
return
(! howto->pc_relative)
/* The reloc processing routine for the optimized COFF linker. */
static bfd_boolean
-coff_ppc_relocate_section (output_bfd, info, input_bfd, input_section,
- contents, relocs, syms, sections)
- bfd *output_bfd;
- struct bfd_link_info *info;
- bfd *input_bfd;
- asection *input_section;
- bfd_byte *contents;
- struct internal_reloc *relocs;
- struct internal_syment *syms;
- asection **sections;
+coff_ppc_relocate_section (bfd *output_bfd,
+ struct bfd_link_info *info,
+ bfd *input_bfd,
+ asection *input_section,
+ bfd_byte *contents,
+ struct internal_reloc *relocs,
+ struct internal_syment *syms,
+ asection **sections)
{
struct internal_reloc *rel;
struct internal_reloc *relend;
h3 = N_(" Offset spelling (if present)\n");
void
-dump_toc (vfile)
- PTR vfile;
+dump_toc (void * vfile)
{
FILE *file = (FILE *) vfile;
struct list_ele *t;
}
bfd_boolean
-ppc_allocate_toc_section (info)
- struct bfd_link_info *info ATTRIBUTE_UNUSED;
+ppc_allocate_toc_section (struct bfd_link_info *info ATTRIBUTE_UNUSED)
{
asection *s;
bfd_byte *foo;
}
bfd_boolean
-ppc_process_before_allocation (abfd, info)
- bfd *abfd;
- struct bfd_link_info *info;
+ppc_process_before_allocation (bfd *abfd,
+ struct bfd_link_info *info)
{
asection *sec;
struct internal_reloc *i, *rel;
#endif
static bfd_reloc_status_type
-ppc_refhi_reloc (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;
+ppc_refhi_reloc (bfd *abfd ATTRIBUTE_UNUSED,
+ arelent *reloc_entry ATTRIBUTE_UNUSED,
+ asymbol *symbol ATTRIBUTE_UNUSED,
+ void * data ATTRIBUTE_UNUSED,
+ asection *input_section ATTRIBUTE_UNUSED,
+ bfd *output_bfd,
+ char **error_message ATTRIBUTE_UNUSED)
{
UN_IMPL("REFHI");
DUMP_RELOC("REFHI",reloc_entry);
}
static bfd_reloc_status_type
-ppc_pair_reloc (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;
+ppc_pair_reloc (bfd *abfd ATTRIBUTE_UNUSED,
+ arelent *reloc_entry ATTRIBUTE_UNUSED,
+ asymbol *symbol ATTRIBUTE_UNUSED,
+ void * data ATTRIBUTE_UNUSED,
+ asection *input_section ATTRIBUTE_UNUSED,
+ bfd *output_bfd,
+ char **error_message ATTRIBUTE_UNUSED)
{
UN_IMPL("PAIR");
DUMP_RELOC("PAIR",reloc_entry);
return bfd_reloc_undefined;
}
-\f
+
static bfd_reloc_status_type
-ppc_toc16_reloc (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;
+ppc_toc16_reloc (bfd *abfd ATTRIBUTE_UNUSED,
+ arelent *reloc_entry ATTRIBUTE_UNUSED,
+ asymbol *symbol ATTRIBUTE_UNUSED,
+ void * data ATTRIBUTE_UNUSED,
+ asection *input_section ATTRIBUTE_UNUSED,
+ bfd *output_bfd,
+ char **error_message ATTRIBUTE_UNUSED)
{
UN_IMPL ("TOCREL16");
DUMP_RELOC ("TOCREL16",reloc_entry);
}
static bfd_reloc_status_type
-ppc_secrel_reloc (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;
+ppc_secrel_reloc (bfd *abfd ATTRIBUTE_UNUSED,
+ arelent *reloc_entry ATTRIBUTE_UNUSED,
+ asymbol *symbol ATTRIBUTE_UNUSED,
+ void * data ATTRIBUTE_UNUSED,
+ asection *input_section ATTRIBUTE_UNUSED,
+ bfd *output_bfd,
+ char **error_message ATTRIBUTE_UNUSED)
{
UN_IMPL("SECREL");
DUMP_RELOC("SECREL",reloc_entry);
}
static bfd_reloc_status_type
-ppc_section_reloc (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;
+ppc_section_reloc (bfd *abfd ATTRIBUTE_UNUSED,
+ arelent *reloc_entry ATTRIBUTE_UNUSED,
+ asymbol *symbol ATTRIBUTE_UNUSED,
+ void * data ATTRIBUTE_UNUSED,
+ asection *input_section ATTRIBUTE_UNUSED,
+ bfd *output_bfd,
+ char **error_message ATTRIBUTE_UNUSED)
{
UN_IMPL("SECTION");
DUMP_RELOC("SECTION",reloc_entry);
}
static bfd_reloc_status_type
-ppc_imglue_reloc (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;
+ppc_imglue_reloc (bfd *abfd ATTRIBUTE_UNUSED,
+ arelent *reloc_entry ATTRIBUTE_UNUSED,
+ asymbol *symbol ATTRIBUTE_UNUSED,
+ void * data ATTRIBUTE_UNUSED,
+ asection *input_section ATTRIBUTE_UNUSED,
+ bfd *output_bfd,
+ char **error_message ATTRIBUTE_UNUSED)
+
{
UN_IMPL("IMGLUE");
DUMP_RELOC("IMGLUE",reloc_entry);
/* FIXME: There is a possibility that when we read in a reloc from a file,
that there are some bits encoded in the upper portion of the
type field. Not yet implemented. */
-static void ppc_coff_rtype2howto PARAMS ((arelent *, struct internal_reloc *));
static void
-ppc_coff_rtype2howto (relent, internal)
- arelent *relent;
- struct internal_reloc *internal;
+ppc_coff_rtype2howto (arelent *relent, struct internal_reloc *internal)
{
/* We can encode one of three things in the type field, aside from the
type:
}
static reloc_howto_type *
-coff_ppc_rtype_to_howto (abfd, sec, rel, h, sym, addendp)
- bfd *abfd ATTRIBUTE_UNUSED;
- asection *sec;
- struct internal_reloc *rel;
- struct coff_link_hash_entry *h ATTRIBUTE_UNUSED;
- struct internal_syment *sym ATTRIBUTE_UNUSED;
- bfd_vma *addendp;
+coff_ppc_rtype_to_howto (bfd *abfd ATTRIBUTE_UNUSED,
+ asection *sec,
+ struct internal_reloc *rel,
+ struct coff_link_hash_entry *h ATTRIBUTE_UNUSED,
+ struct internal_syment *sym ATTRIBUTE_UNUSED,
+ bfd_vma *addendp)
{
reloc_howto_type *howto;
#define HOW2MAP(bfd_rtype,ppc_rtype) \
case bfd_rtype: return &ppc_coff_howto_table[ppc_rtype]
-static reloc_howto_type *ppc_coff_reloc_type_lookup
-PARAMS ((bfd *, bfd_reloc_code_real_type));
-
static reloc_howto_type *
-ppc_coff_reloc_type_lookup (abfd, code)
- bfd *abfd ATTRIBUTE_UNUSED;
- bfd_reloc_code_real_type code;
+ppc_coff_reloc_type_lookup (bfd *abfd ATTRIBUTE_UNUSED,
+ bfd_reloc_code_real_type code)
{
switch (code)
{
\f
#ifndef COFF_IMAGE_WITH_PE
-static bfd_boolean ppc_do_last PARAMS ((bfd *));
-static bfd *ppc_get_last PARAMS ((void));
-
static bfd_boolean
-ppc_do_last (abfd)
- bfd *abfd;
+ppc_do_last (bfd *abfd)
{
if (abfd == bfd_of_toc_owner)
return TRUE;
}
static bfd *
-ppc_get_last()
+ppc_get_last (void)
{
return bfd_of_toc_owner;
}
/* Do the final link step. */
bfd_boolean
-ppc_bfd_coff_final_link (abfd, info)
- bfd *abfd;
- struct bfd_link_info *info;
+ppc_bfd_coff_final_link (bfd *abfd, struct bfd_link_info *info)
{
bfd_size_type symesz;
struct coff_final_link_info flaginfo;
file_ptr pos;
flaginfo.last_file.n_value = obj_raw_syment_count (abfd);
- bfd_coff_swap_sym_out (abfd, (PTR) &flaginfo.last_file,
- (PTR) flaginfo.outsyms);
+ bfd_coff_swap_sym_out (abfd, &flaginfo.last_file,
+ flaginfo.outsyms);
pos = obj_sym_filepos (abfd) + flaginfo.last_file_index * symesz;
if (bfd_seek (abfd, pos, SEEK_SET) != 0
|| bfd_bwrite (flaginfo.outsyms, symesz, abfd) != symesz)
BFD_ASSERT ((*rel_hash)->indx >= 0);
irel->r_symndx = (*rel_hash)->indx;
}
- bfd_coff_swap_reloc_out (abfd, (PTR) irel, (PTR) erel);
+ bfd_coff_swap_reloc_out (abfd, irel, erel);
}
amt = relsz * o->reloc_count;
if (bfd_seek (abfd, o->rel_filepos, SEEK_SET) != 0
- || bfd_bwrite ((PTR) external_relocs, amt, abfd) != amt)
+ || bfd_bwrite (external_relocs, amt, abfd) != amt)
goto error_return;
}
/* BFD back-end for IBM RS/6000 "XCOFF" files.
Copyright 1990-1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007,
- 2008, 2009, 2010, 2011
+ 2008, 2009, 2010, 2011, 2012
Free Software Foundation, Inc.
Written by Metin G. Ozisik, Mimi Phuong-Thao Vo, and John Gilmore.
Archive support from Damon A. Permezel.
(bfd *, bfd_reloc_code_real_type);
extern bfd_boolean _bfd_xcoff_slurp_armap (bfd *);
extern const bfd_target *_bfd_xcoff_archive_p (bfd *);
-extern PTR _bfd_xcoff_read_ar_hdr (bfd *);
+extern void * _bfd_xcoff_read_ar_hdr (bfd *);
extern bfd *_bfd_xcoff_openr_next_archived_file (bfd *, bfd *);
extern int _bfd_xcoff_stat_arch_elt (bfd *, struct stat *);
extern bfd_boolean _bfd_xcoff_write_armap
(bfd *, unsigned int, struct orl *, unsigned int, int);
extern bfd_boolean _bfd_xcoff_write_archive_contents (bfd *);
extern int _bfd_xcoff_sizeof_headers (bfd *, struct bfd_link_info *);
-extern void _bfd_xcoff_swap_sym_in (bfd *, PTR, PTR);
-extern unsigned int _bfd_xcoff_swap_sym_out (bfd *, PTR, PTR);
-extern void _bfd_xcoff_swap_aux_in (bfd *, PTR, int, int, int, int, PTR);
+extern void _bfd_xcoff_swap_sym_in (bfd *, void *, void *);
+extern unsigned int _bfd_xcoff_swap_sym_out (bfd *, void *, void *);
+extern void _bfd_xcoff_swap_aux_in (bfd *, void *, int, int, int, int, void *);
extern unsigned int _bfd_xcoff_swap_aux_out
- (bfd *, PTR, int, int, int, int, PTR);
-static void xcoff_swap_reloc_in (bfd *, PTR, PTR);
-static unsigned int xcoff_swap_reloc_out (bfd *, PTR, PTR);
+ (bfd *, void *, int, int, int, int, void *);
+static void xcoff_swap_reloc_in (bfd *, void *, void *);
+static unsigned int xcoff_swap_reloc_out (bfd *, void *, void *);
/* Forward declare xcoff_rtype2howto for coffcode.h macro. */
void xcoff_rtype2howto (arelent *, struct internal_reloc *);
(bfd *, unsigned int, struct orl *, unsigned int, int);
static bfd_boolean xcoff_write_archive_contents_old (bfd *);
static bfd_boolean xcoff_write_archive_contents_big (bfd *);
-static void xcoff_swap_ldhdr_in (bfd *, const PTR, struct internal_ldhdr *);
-static void xcoff_swap_ldhdr_out (bfd *, const struct internal_ldhdr *, PTR);
-static void xcoff_swap_ldsym_in (bfd *, const PTR, struct internal_ldsym *);
-static void xcoff_swap_ldsym_out (bfd *, const struct internal_ldsym *, PTR);
-static void xcoff_swap_ldrel_in (bfd *, const PTR, struct internal_ldrel *);
-static void xcoff_swap_ldrel_out (bfd *, const struct internal_ldrel *, PTR);
+static void xcoff_swap_ldhdr_in (bfd *, const void *, struct internal_ldhdr *);
+static void xcoff_swap_ldhdr_out (bfd *, const struct internal_ldhdr *, void *);
+static void xcoff_swap_ldsym_in (bfd *, const void *, struct internal_ldsym *);
+static void xcoff_swap_ldsym_out (bfd *, const struct internal_ldsym *, void *);
+static void xcoff_swap_ldrel_in (bfd *, const void *, struct internal_ldrel *);
+static void xcoff_swap_ldrel_out (bfd *, const struct internal_ldrel *, void *);
static bfd_boolean xcoff_ppc_relocate_section
(bfd *, struct bfd_link_info *, bfd *, asection *, bfd_byte *,
struct internal_reloc *, struct internal_syment *, asection **);
\f
void
-_bfd_xcoff_swap_sym_in (bfd *abfd, PTR ext1, PTR in1)
+_bfd_xcoff_swap_sym_in (bfd *abfd, void * ext1, void * in1)
{
SYMENT *ext = (SYMENT *)ext1;
struct internal_syment * in = (struct internal_syment *)in1;
}
unsigned int
-_bfd_xcoff_swap_sym_out (bfd *abfd, PTR inp, PTR extp)
+_bfd_xcoff_swap_sym_out (bfd *abfd, void * inp, void * extp)
{
struct internal_syment *in = (struct internal_syment *)inp;
SYMENT *ext =(SYMENT *)extp;
}
void
-_bfd_xcoff_swap_aux_in (bfd *abfd, PTR ext1, int type, int in_class,
- int indx, int numaux, PTR in1)
+_bfd_xcoff_swap_aux_in (bfd *abfd, void * ext1, int type, int in_class,
+ int indx, int numaux, void * in1)
{
AUXENT * ext = (AUXENT *)ext1;
union internal_auxent *in = (union internal_auxent *)in1;
}
unsigned int
-_bfd_xcoff_swap_aux_out (bfd *abfd, PTR inp, int type, int in_class,
+_bfd_xcoff_swap_aux_out (bfd *abfd, void * inp, int type, int in_class,
int indx ATTRIBUTE_UNUSED,
int numaux ATTRIBUTE_UNUSED,
- PTR extp)
+ void * extp)
{
union internal_auxent *in = (union internal_auxent *)inp;
AUXENT *ext = (AUXENT *)extp;
- memset ((PTR)ext, 0, bfd_coff_auxesz (abfd));
+ memset (ext, 0, bfd_coff_auxesz (abfd));
switch (in_class)
{
case C_FILE:
return FALSE;
/* The symbol table starts with a normal archive header. */
- if (bfd_bread ((PTR) &hdr, (bfd_size_type) SIZEOF_AR_HDR, abfd)
+ if (bfd_bread (&hdr, (bfd_size_type) SIZEOF_AR_HDR, abfd)
!= SIZEOF_AR_HDR)
return FALSE;
contents = (bfd_byte *) bfd_alloc (abfd, sz);
if (contents == NULL)
return FALSE;
- if (bfd_bread ((PTR) contents, sz, abfd) != sz)
+ if (bfd_bread (contents, sz, abfd) != sz)
return FALSE;
/* The symbol table starts with a four byte count. */
return FALSE;
/* The symbol table starts with a normal archive header. */
- if (bfd_bread ((PTR) &hdr, (bfd_size_type) SIZEOF_AR_HDR_BIG, abfd)
+ if (bfd_bread (&hdr, (bfd_size_type) SIZEOF_AR_HDR_BIG, abfd)
!= SIZEOF_AR_HDR_BIG)
return FALSE;
contents = (bfd_byte *) bfd_alloc (abfd, sz);
if (contents == NULL)
return FALSE;
- if (bfd_bread ((PTR) contents, sz, abfd) != sz)
+ if (bfd_bread (contents, sz, abfd) != sz)
return FALSE;
/* The symbol table starts with an eight byte count. */
char magic[SXCOFFARMAG];
bfd_size_type amt = SXCOFFARMAG;
- if (bfd_bread ((PTR) magic, amt, abfd) != amt)
+ if (bfd_bread (magic, amt, abfd) != amt)
{
if (bfd_get_error () != bfd_error_system_call)
bfd_set_error (bfd_error_wrong_format);
/* Now read the rest of the file header. */
amt = SIZEOF_AR_FILE_HDR - SXCOFFARMAG;
- if (bfd_bread ((PTR) &hdr.memoff, amt, abfd) != amt)
+ if (bfd_bread (&hdr.memoff, amt, abfd) != amt)
{
if (bfd_get_error () != bfd_error_system_call)
bfd_set_error (bfd_error_wrong_format);
/* Now read the rest of the file header. */
amt = SIZEOF_AR_FILE_HDR_BIG - SXCOFFARMAG;
- if (bfd_bread ((PTR) &hdr.memoff, amt, abfd) != amt)
+ if (bfd_bread (&hdr.memoff, amt, abfd) != amt)
{
if (bfd_get_error () != bfd_error_system_call)
bfd_set_error (bfd_error_wrong_format);
/* Read the archive header in an XCOFF archive. */
-PTR
+void *
_bfd_xcoff_read_ar_hdr (bfd *abfd)
{
bfd_size_type namlen;
struct xcoff_ar_hdr hdr;
struct xcoff_ar_hdr *hdrp;
- if (bfd_bread ((PTR) &hdr, (bfd_size_type) SIZEOF_AR_HDR, abfd)
+ if (bfd_bread (&hdr, (bfd_size_type) SIZEOF_AR_HDR, abfd)
!= SIZEOF_AR_HDR)
{
free (ret);
struct xcoff_ar_hdr_big hdr;
struct xcoff_ar_hdr_big *hdrp;
- if (bfd_bread ((PTR) &hdr, (bfd_size_type) SIZEOF_AR_HDR_BIG, abfd)
+ if (bfd_bread (&hdr, (bfd_size_type) SIZEOF_AR_HDR_BIG, abfd)
!= SIZEOF_AR_HDR_BIG)
{
free (ret);
if (bfd_seek (abfd, (file_ptr) ((namlen & 1) + SXCOFFARFMAG), SEEK_CUR) != 0)
return NULL;
- return (PTR) ret;
+ return ret;
}
/* Open the next element in an XCOFF archive. */
if (*p == '\0')
*p = ' ';
- if (bfd_bwrite ((PTR) &hdr, (bfd_size_type) SIZEOF_AR_HDR, abfd)
+ if (bfd_bwrite (&hdr, (bfd_size_type) SIZEOF_AR_HDR, abfd)
!= SIZEOF_AR_HDR
|| (bfd_bwrite (XCOFFARFMAG, (bfd_size_type) SXCOFFARFMAG, abfd)
!= SXCOFFARFMAG))
if (*p == '\0')
*p = ' ';
- if ((bfd_bwrite ((PTR) &ahdr, (bfd_size_type) SIZEOF_AR_HDR, abfd)
+ if ((bfd_bwrite (&ahdr, (bfd_size_type) SIZEOF_AR_HDR, abfd)
!= SIZEOF_AR_HDR)
- || (bfd_bwrite ((PTR) XCOFFARFMAG, (bfd_size_type) SXCOFFARFMAG, abfd)
+ || (bfd_bwrite (XCOFFARFMAG, (bfd_size_type) SXCOFFARFMAG, abfd)
!= SXCOFFARFMAG))
return FALSE;
sprintf (decbuf, "%-12ld", (long) count);
- if (bfd_bwrite ((PTR) decbuf, (bfd_size_type) XCOFFARMAG_ELEMENT_SIZE, abfd)
+ if (bfd_bwrite (decbuf, (bfd_size_type) XCOFFARMAG_ELEMENT_SIZE, abfd)
!= XCOFFARMAG_ELEMENT_SIZE)
return FALSE;
for (i = 0; i < (size_t) count; i++)
{
sprintf (decbuf, "%-12ld", (long) offsets[i]);
- if (bfd_bwrite ((PTR) decbuf, (bfd_size_type) XCOFFARMAG_ELEMENT_SIZE,
+ if (bfd_bwrite (decbuf, (bfd_size_type) XCOFFARMAG_ELEMENT_SIZE,
abfd) != XCOFFARMAG_ELEMENT_SIZE)
return FALSE;
}
name = normalize_filename (sub);
namlen = strlen (name);
- if (bfd_bwrite ((PTR) name, namlen + 1, abfd) != namlen + 1)
+ if (bfd_bwrite (name, namlen + 1, abfd) != namlen + 1)
return FALSE;
}
{
BFD_ASSERT (nextoff == bfd_tell (abfd));
sprintf (fhdr.symoff, "%ld", (long) nextoff);
- bfd_ardata (abfd)->tdata = (PTR) &fhdr;
+ bfd_ardata (abfd)->tdata = &fhdr;
if (! _bfd_compute_and_write_armap (abfd, 0))
return FALSE;
}
*p = ' ';
if (bfd_seek (abfd, (file_ptr) 0, SEEK_SET) != 0
- || (bfd_bwrite ((PTR) &fhdr, (bfd_size_type) SIZEOF_AR_FILE_HDR, abfd)
+ || (bfd_bwrite (&fhdr, (bfd_size_type) SIZEOF_AR_FILE_HDR, abfd)
!= SIZEOF_AR_FILE_HDR))
return FALSE;
/* Save nextoff in fhdr.symoff so the armap routine can use it. */
PRINT20 (fhdr.symoff, nextoff);
- bfd_ardata (abfd)->tdata = (PTR) &fhdr;
+ bfd_ardata (abfd)->tdata = &fhdr;
if (! _bfd_compute_and_write_armap (abfd, 0))
return FALSE;
}
/* Write out the archive file header. */
if (bfd_seek (abfd, (file_ptr) 0, SEEK_SET) != 0
- || (bfd_bwrite ((PTR) &fhdr, (bfd_size_type) SIZEOF_AR_FILE_HDR_BIG,
+ || (bfd_bwrite (&fhdr, (bfd_size_type) SIZEOF_AR_FILE_HDR_BIG,
abfd) != SIZEOF_AR_FILE_HDR_BIG))
return FALSE;
/* Swap in the ldhdr structure. */
static void
-xcoff_swap_ldhdr_in (bfd *abfd, const PTR s, struct internal_ldhdr *dst)
+xcoff_swap_ldhdr_in (bfd *abfd, const void * s, struct internal_ldhdr *dst)
{
const struct external_ldhdr *src = (const struct external_ldhdr *) s;
/* Swap out the ldhdr structure. */
static void
-xcoff_swap_ldhdr_out (bfd *abfd, const struct internal_ldhdr *src, PTR d)
+xcoff_swap_ldhdr_out (bfd *abfd, const struct internal_ldhdr *src, void * d)
{
struct external_ldhdr *dst = (struct external_ldhdr *) d;
/* Swap in the ldsym structure. */
static void
-xcoff_swap_ldsym_in (bfd *abfd, const PTR s, struct internal_ldsym *dst)
+xcoff_swap_ldsym_in (bfd *abfd, const void * s, struct internal_ldsym *dst)
{
const struct external_ldsym *src = (const struct external_ldsym *) s;
/* Swap out the ldsym structure. */
static void
-xcoff_swap_ldsym_out (bfd *abfd, const struct internal_ldsym *src, PTR d)
+xcoff_swap_ldsym_out (bfd *abfd, const struct internal_ldsym *src, void * d)
{
struct external_ldsym *dst = (struct external_ldsym *) d;
}
static void
-xcoff_swap_reloc_in (bfd *abfd, PTR s, PTR d)
+xcoff_swap_reloc_in (bfd *abfd, void * s, void * d)
{
struct external_reloc *src = (struct external_reloc *) s;
struct internal_reloc *dst = (struct internal_reloc *) d;
}
static unsigned int
-xcoff_swap_reloc_out (bfd *abfd, PTR s, PTR d)
+xcoff_swap_reloc_out (bfd *abfd, void * s, void * d)
{
struct internal_reloc *src = (struct internal_reloc *) s;
struct external_reloc *dst = (struct external_reloc *) d;
/* Swap in the ldrel structure. */
static void
-xcoff_swap_ldrel_in (bfd *abfd, const PTR s, struct internal_ldrel *dst)
+xcoff_swap_ldrel_in (bfd *abfd, const void * s, struct internal_ldrel *dst)
{
const struct external_ldrel *src = (const struct external_ldrel *) s;
/* Swap out the ldrel structure. */
static void
-xcoff_swap_ldrel_out (bfd *abfd, const struct internal_ldrel *src, PTR d)
+xcoff_swap_ldrel_out (bfd *abfd, const struct internal_ldrel *src, void * d)
{
struct external_ldrel *dst = (struct external_ldrel *) d;
/* Opposite endian version, none exists */
NULL,
- (void *) &bfd_xcoff_backend_data,
+ & bfd_xcoff_backend_data,
};
/* xcoff-powermac target
/* Opposite endian version, none exists */
NULL,
- (void *) &bfd_pmac_xcoff_backend_data,
+ & bfd_pmac_xcoff_backend_data,
};
/* BFD back-end for Renesas Super-H COFF binaries.
Copyright 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
- 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2011
+ 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2011, 2012
Free Software Foundation, Inc.
Contributed by Cygnus Support.
Written by Steve Chamberlain, <sac@cygnus.com>.
#ifndef COFF_IMAGE_WITH_PE
static bfd_boolean sh_align_load_span
- PARAMS ((bfd *, asection *, bfd_byte *,
- bfd_boolean (*) (bfd *, asection *, PTR, bfd_byte *, bfd_vma),
- PTR, bfd_vma **, bfd_vma *, bfd_vma, bfd_vma, bfd_boolean *));
+ (bfd *, asection *, bfd_byte *,
+ bfd_boolean (*) (bfd *, asection *, void *, bfd_byte *, bfd_vma),
+ void *, bfd_vma **, bfd_vma *, bfd_vma, bfd_vma, bfd_boolean *);
#define _bfd_sh_align_load_span sh_align_load_span
#endif
#include "libcoff.h"
/* Internal functions. */
-static bfd_reloc_status_type sh_reloc
- PARAMS ((bfd *, arelent *, asymbol *, PTR, asection *, bfd *, char **));
-static long get_symbol_value PARAMS ((asymbol *));
-static bfd_boolean sh_relax_section
- PARAMS ((bfd *, asection *, struct bfd_link_info *, bfd_boolean *));
-static bfd_boolean sh_relax_delete_bytes
- PARAMS ((bfd *, asection *, bfd_vma, int));
-#ifndef COFF_IMAGE_WITH_PE
-static const struct sh_opcode *sh_insn_info PARAMS ((unsigned int));
-#endif
-static bfd_boolean sh_align_loads
- PARAMS ((bfd *, asection *, struct internal_reloc *, bfd_byte *,
- bfd_boolean *));
-static bfd_boolean sh_swap_insns
- PARAMS ((bfd *, asection *, PTR, bfd_byte *, bfd_vma));
-static bfd_boolean sh_relocate_section
- PARAMS ((bfd *, struct bfd_link_info *, bfd *, asection *, bfd_byte *,
- struct internal_reloc *, struct internal_syment *, asection **));
-static bfd_byte *sh_coff_get_relocated_section_contents
- PARAMS ((bfd *, struct bfd_link_info *, struct bfd_link_order *,
- bfd_byte *, bfd_boolean, asymbol **));
-static reloc_howto_type * sh_coff_reloc_type_lookup PARAMS ((bfd *, bfd_reloc_code_real_type));
#ifdef COFF_WITH_PE
/* Can't build import tables with 2**4 alignment. */
#define COFF_LONG_FILENAMES
#ifdef COFF_WITH_PE
-static bfd_boolean in_reloc_p PARAMS ((bfd *, reloc_howto_type *));
/* Return TRUE if this relocation should
appear in the output .reloc section. */
-static bfd_boolean in_reloc_p (abfd, howto)
- bfd * abfd ATTRIBUTE_UNUSED;
- reloc_howto_type * howto;
+
+static bfd_boolean
+in_reloc_p (bfd * abfd ATTRIBUTE_UNUSED,
+ reloc_howto_type * howto)
{
return ! howto->pc_relative && howto->type != R_SH_IMAGEBASE;
}
#endif
+static bfd_reloc_status_type
+sh_reloc (bfd *, arelent *, asymbol *, void *, asection *, bfd *, char **);
+static bfd_boolean
+sh_relocate_section (bfd *, struct bfd_link_info *, bfd *, asection *,
+ bfd_byte *, struct internal_reloc *,
+ struct internal_syment *, asection **);
+static bfd_boolean
+sh_align_loads (bfd *, asection *, struct internal_reloc *,
+ bfd_byte *, bfd_boolean *);
+
/* The supported relocations. There are a lot of relocations defined
in coff/internal.h which we do not expect to ever see. */
static reloc_howto_type sh_coff_howtos[] =
/* Get the value of a symbol, when performing a relocation. */
static long
-get_symbol_value (symbol)
- asymbol *symbol;
+get_symbol_value (asymbol *symbol)
{
bfd_vma relocation;
/* Convert an rtype to howto for the COFF backend linker.
Copied from coff-i386. */
#define coff_rtype_to_howto coff_sh_rtype_to_howto
-static reloc_howto_type * coff_sh_rtype_to_howto PARAMS ((bfd *, asection *, struct internal_reloc *, struct coff_link_hash_entry *, struct internal_syment *, bfd_vma *));
+
static reloc_howto_type *
-coff_sh_rtype_to_howto (abfd, sec, rel, h, sym, addendp)
- bfd * abfd ATTRIBUTE_UNUSED;
- asection * sec;
- struct internal_reloc * rel;
- struct coff_link_hash_entry * h;
- struct internal_syment * sym;
- bfd_vma * addendp;
+coff_sh_rtype_to_howto (bfd * abfd ATTRIBUTE_UNUSED,
+ asection * sec,
+ struct internal_reloc * rel,
+ struct coff_link_hash_entry * h,
+ struct internal_syment * sym,
+ bfd_vma * addendp)
{
reloc_howto_type * howto;
#define coff_bfd_reloc_name_lookup sh_coff_reloc_name_lookup
static reloc_howto_type *
-sh_coff_reloc_type_lookup (abfd, code)
- bfd * abfd ATTRIBUTE_UNUSED;
- bfd_reloc_code_real_type code;
+sh_coff_reloc_type_lookup (bfd * abfd ATTRIBUTE_UNUSED,
+ bfd_reloc_code_real_type code)
{
unsigned int i;
/* This is the howto function for the SH relocations. */
static bfd_reloc_status_type
-sh_reloc (abfd, reloc_entry, symbol_in, data, input_section, output_bfd,
- error_message)
- bfd *abfd;
- arelent *reloc_entry;
- asymbol *symbol_in;
- PTR data;
- asection *input_section;
- bfd *output_bfd;
- char **error_message ATTRIBUTE_UNUSED;
+sh_reloc (bfd * abfd,
+ arelent * reloc_entry,
+ asymbol * symbol_in,
+ void * data,
+ asection * input_section,
+ bfd * output_bfd,
+ char ** error_message ATTRIBUTE_UNUSED)
{
unsigned long insn;
bfd_vma sym_value;
#include "coffcode.h"
\f
+static bfd_boolean
+sh_relax_delete_bytes (bfd *, asection *, bfd_vma, int);
+
/* This function handles relaxing on the SH.
Function calls on the SH look like this:
can, by swapping them with one of the adjacent instructions. */
static bfd_boolean
-sh_relax_section (abfd, sec, link_info, again)
- bfd *abfd;
- asection *sec;
- struct bfd_link_info *link_info;
- bfd_boolean *again;
+sh_relax_section (bfd *abfd,
+ asection *sec,
+ struct bfd_link_info *link_info,
+ bfd_boolean *again)
{
struct internal_reloc *internal_relocs;
bfd_boolean have_code;
if (coff_section_data (abfd, sec) == NULL)
{
bfd_size_type amt = sizeof (struct coff_section_tdata);
- sec->used_by_bfd = (PTR) bfd_zalloc (abfd, amt);
+ sec->used_by_bfd = bfd_zalloc (abfd, amt);
if (sec->used_by_bfd == NULL)
return FALSE;
}
/* Delete some bytes from a section while relaxing. */
static bfd_boolean
-sh_relax_delete_bytes (abfd, sec, addr, count)
- bfd *abfd;
- asection *sec;
- bfd_vma addr;
- int count;
+sh_relax_delete_bytes (bfd *abfd,
+ asection *sec,
+ bfd_vma addr,
+ int count)
{
bfd_byte *contents;
struct internal_reloc *irel, *irelend;
{
struct internal_syment isym;
- bfd_coff_swap_sym_in (abfd, (PTR) esym, (PTR) &isym);
+ bfd_coff_swap_sym_in (abfd, esym, &isym);
if (isym.n_scnum == sec->target_index
&& (bfd_vma) isym.n_value > addr
{
isym.n_value -= count;
- bfd_coff_swap_sym_out (abfd, (PTR) &isym, (PTR) esym);
+ bfd_coff_swap_sym_out (abfd, &isym, esym);
if (*sym_hash != NULL)
{
#define MAP(a) a, sizeof a / sizeof a[0]
#ifndef COFF_IMAGE_WITH_PE
-static bfd_boolean sh_insn_uses_reg
- PARAMS ((unsigned int, const struct sh_opcode *, unsigned int));
-static bfd_boolean sh_insn_sets_reg
- PARAMS ((unsigned int, const struct sh_opcode *, unsigned int));
-static bfd_boolean sh_insn_uses_or_sets_reg
- PARAMS ((unsigned int, const struct sh_opcode *, unsigned int));
-static bfd_boolean sh_insn_uses_freg
- PARAMS ((unsigned int, const struct sh_opcode *, unsigned int));
-static bfd_boolean sh_insn_sets_freg
- PARAMS ((unsigned int, const struct sh_opcode *, unsigned int));
-static bfd_boolean sh_insn_uses_or_sets_freg
- PARAMS ((unsigned int, const struct sh_opcode *, unsigned int));
-static bfd_boolean sh_insns_conflict
- PARAMS ((unsigned int, const struct sh_opcode *, unsigned int,
- const struct sh_opcode *));
-static bfd_boolean sh_load_use
- PARAMS ((unsigned int, const struct sh_opcode *, unsigned int,
- const struct sh_opcode *));
/* The opcode maps. */
recognized. */
static const struct sh_opcode *
-sh_insn_info (insn)
- unsigned int insn;
+sh_insn_info (unsigned int insn)
{
const struct sh_major_opcode *maj;
const struct sh_minor_opcode *min, *minend;
return NULL;
}
-/* See whether an instruction uses or sets a general purpose register */
-
-static bfd_boolean
-sh_insn_uses_or_sets_reg (insn, op, reg)
- unsigned int insn;
- const struct sh_opcode *op;
- unsigned int reg;
-{
- if (sh_insn_uses_reg (insn, op, reg))
- return TRUE;
-
- return sh_insn_sets_reg (insn, op, reg);
-}
-
/* See whether an instruction uses a general purpose register. */
static bfd_boolean
-sh_insn_uses_reg (insn, op, reg)
- unsigned int insn;
- const struct sh_opcode *op;
- unsigned int reg;
+sh_insn_uses_reg (unsigned int insn,
+ const struct sh_opcode *op,
+ unsigned int reg)
{
unsigned int f;
/* See whether an instruction sets a general purpose register. */
static bfd_boolean
-sh_insn_sets_reg (insn, op, reg)
- unsigned int insn;
- const struct sh_opcode *op;
- unsigned int reg;
+sh_insn_sets_reg (unsigned int insn,
+ const struct sh_opcode *op,
+ unsigned int reg)
{
unsigned int f;
return FALSE;
}
-/* See whether an instruction uses or sets a floating point register */
+/* See whether an instruction uses or sets a general purpose register */
static bfd_boolean
-sh_insn_uses_or_sets_freg (insn, op, reg)
- unsigned int insn;
- const struct sh_opcode *op;
- unsigned int reg;
+sh_insn_uses_or_sets_reg (unsigned int insn,
+ const struct sh_opcode *op,
+ unsigned int reg)
{
- if (sh_insn_uses_freg (insn, op, reg))
+ if (sh_insn_uses_reg (insn, op, reg))
return TRUE;
- return sh_insn_sets_freg (insn, op, reg);
+ return sh_insn_sets_reg (insn, op, reg);
}
/* See whether an instruction uses a floating point register. */
static bfd_boolean
-sh_insn_uses_freg (insn, op, freg)
- unsigned int insn;
- const struct sh_opcode *op;
- unsigned int freg;
+sh_insn_uses_freg (unsigned int insn,
+ const struct sh_opcode *op,
+ unsigned int freg)
{
unsigned int f;
/* See whether an instruction sets a floating point register. */
static bfd_boolean
-sh_insn_sets_freg (insn, op, freg)
- unsigned int insn;
- const struct sh_opcode *op;
- unsigned int freg;
+sh_insn_sets_freg (unsigned int insn,
+ const struct sh_opcode *op,
+ unsigned int freg)
{
unsigned int f;
return FALSE;
}
+/* See whether an instruction uses or sets a floating point register */
+
+static bfd_boolean
+sh_insn_uses_or_sets_freg (unsigned int insn,
+ const struct sh_opcode *op,
+ unsigned int reg)
+{
+ if (sh_insn_uses_freg (insn, op, reg))
+ return TRUE;
+
+ return sh_insn_sets_freg (insn, op, reg);
+}
+
/* See whether instructions I1 and I2 conflict, assuming I1 comes
before I2. OP1 and OP2 are the corresponding sh_opcode structures.
This should return TRUE if there is a conflict, or FALSE if the
instructions can be swapped safely. */
static bfd_boolean
-sh_insns_conflict (i1, op1, i2, op2)
- unsigned int i1;
- const struct sh_opcode *op1;
- unsigned int i2;
- const struct sh_opcode *op2;
+sh_insns_conflict (unsigned int i1,
+ const struct sh_opcode *op1,
+ unsigned int i2,
+ const struct sh_opcode *op2)
{
unsigned int f1, f2;
TRUE if I1 loads a register which I2 uses. */
static bfd_boolean
-sh_load_use (i1, op1, i2, op2)
- unsigned int i1;
- const struct sh_opcode *op1;
- unsigned int i2;
- const struct sh_opcode *op2;
+sh_load_use (unsigned int i1,
+ const struct sh_opcode *op1,
+ unsigned int i2,
+ const struct sh_opcode *op2)
{
unsigned int f1;
static
#endif
bfd_boolean
-_bfd_sh_align_load_span (abfd, sec, contents, swap, relocs,
- plabel, label_end, start, stop, pswapped)
- bfd *abfd;
- asection *sec;
- bfd_byte *contents;
- bfd_boolean (*swap) PARAMS ((bfd *, asection *, PTR, bfd_byte *, bfd_vma));
- PTR relocs;
- bfd_vma **plabel;
- bfd_vma *label_end;
- bfd_vma start;
- bfd_vma stop;
- bfd_boolean *pswapped;
+_bfd_sh_align_load_span (bfd *abfd,
+ asection *sec,
+ bfd_byte *contents,
+ bfd_boolean (*swap) (bfd *, asection *, void *, bfd_byte *, bfd_vma),
+ void * relocs,
+ bfd_vma **plabel,
+ bfd_vma *label_end,
+ bfd_vma start,
+ bfd_vma stop,
+ bfd_boolean *pswapped)
{
int dsp = (abfd->arch_info->mach == bfd_mach_sh_dsp
|| abfd->arch_info->mach == bfd_mach_sh3_dsp);
}
#endif /* not COFF_IMAGE_WITH_PE */
-/* Look for loads and stores which we can align to four byte
- boundaries. See the longer comment above sh_relax_section for why
- this is desirable. This sets *PSWAPPED if some instruction was
- swapped. */
-
-static bfd_boolean
-sh_align_loads (abfd, sec, internal_relocs, contents, pswapped)
- bfd *abfd;
- asection *sec;
- struct internal_reloc *internal_relocs;
- bfd_byte *contents;
- bfd_boolean *pswapped;
-{
- struct internal_reloc *irel, *irelend;
- bfd_vma *labels = NULL;
- bfd_vma *label, *label_end;
- bfd_size_type amt;
-
- *pswapped = FALSE;
-
- irelend = internal_relocs + sec->reloc_count;
-
- /* Get all the addresses with labels on them. */
- amt = (bfd_size_type) sec->reloc_count * sizeof (bfd_vma);
- labels = (bfd_vma *) bfd_malloc (amt);
- if (labels == NULL)
- goto error_return;
- label_end = labels;
- for (irel = internal_relocs; irel < irelend; irel++)
- {
- if (irel->r_type == R_SH_LABEL)
- {
- *label_end = irel->r_vaddr - sec->vma;
- ++label_end;
- }
- }
-
- /* Note that the assembler currently always outputs relocs in
- address order. If that ever changes, this code will need to sort
- the label values and the relocs. */
-
- label = labels;
-
- for (irel = internal_relocs; irel < irelend; irel++)
- {
- bfd_vma start, stop;
-
- if (irel->r_type != R_SH_CODE)
- continue;
-
- start = irel->r_vaddr - sec->vma;
-
- for (irel++; irel < irelend; irel++)
- if (irel->r_type == R_SH_DATA)
- break;
- if (irel < irelend)
- stop = irel->r_vaddr - sec->vma;
- else
- stop = sec->size;
-
- if (! _bfd_sh_align_load_span (abfd, sec, contents, sh_swap_insns,
- (PTR) internal_relocs, &label,
- label_end, start, stop, pswapped))
- goto error_return;
- }
-
- free (labels);
-
- return TRUE;
-
- error_return:
- if (labels != NULL)
- free (labels);
- return FALSE;
-}
-
/* Swap two SH instructions. */
static bfd_boolean
-sh_swap_insns (abfd, sec, relocs, contents, addr)
- bfd *abfd;
- asection *sec;
- PTR relocs;
- bfd_byte *contents;
- bfd_vma addr;
+sh_swap_insns (bfd * abfd,
+ asection * sec,
+ void * relocs,
+ bfd_byte * contents,
+ bfd_vma addr)
{
struct internal_reloc *internal_relocs = (struct internal_reloc *) relocs;
unsigned short i1, i2;
return TRUE;
}
+
+/* Look for loads and stores which we can align to four byte
+ boundaries. See the longer comment above sh_relax_section for why
+ this is desirable. This sets *PSWAPPED if some instruction was
+ swapped. */
+
+static bfd_boolean
+sh_align_loads (bfd *abfd,
+ asection *sec,
+ struct internal_reloc *internal_relocs,
+ bfd_byte *contents,
+ bfd_boolean *pswapped)
+{
+ struct internal_reloc *irel, *irelend;
+ bfd_vma *labels = NULL;
+ bfd_vma *label, *label_end;
+ bfd_size_type amt;
+
+ *pswapped = FALSE;
+
+ irelend = internal_relocs + sec->reloc_count;
+
+ /* Get all the addresses with labels on them. */
+ amt = (bfd_size_type) sec->reloc_count * sizeof (bfd_vma);
+ labels = (bfd_vma *) bfd_malloc (amt);
+ if (labels == NULL)
+ goto error_return;
+ label_end = labels;
+ for (irel = internal_relocs; irel < irelend; irel++)
+ {
+ if (irel->r_type == R_SH_LABEL)
+ {
+ *label_end = irel->r_vaddr - sec->vma;
+ ++label_end;
+ }
+ }
+
+ /* Note that the assembler currently always outputs relocs in
+ address order. If that ever changes, this code will need to sort
+ the label values and the relocs. */
+
+ label = labels;
+
+ for (irel = internal_relocs; irel < irelend; irel++)
+ {
+ bfd_vma start, stop;
+
+ if (irel->r_type != R_SH_CODE)
+ continue;
+
+ start = irel->r_vaddr - sec->vma;
+
+ for (irel++; irel < irelend; irel++)
+ if (irel->r_type == R_SH_DATA)
+ break;
+ if (irel < irelend)
+ stop = irel->r_vaddr - sec->vma;
+ else
+ stop = sec->size;
+
+ if (! _bfd_sh_align_load_span (abfd, sec, contents, sh_swap_insns,
+ internal_relocs, &label,
+ label_end, start, stop, pswapped))
+ goto error_return;
+ }
+
+ free (labels);
+
+ return TRUE;
+
+ error_return:
+ if (labels != NULL)
+ free (labels);
+ return FALSE;
+}
\f
/* This is a modification of _bfd_coff_generic_relocate_section, which
will handle SH relaxing. */
static bfd_boolean
-sh_relocate_section (output_bfd, info, input_bfd, input_section, contents,
- relocs, syms, sections)
- bfd *output_bfd ATTRIBUTE_UNUSED;
- struct bfd_link_info *info;
- bfd *input_bfd;
- asection *input_section;
- bfd_byte *contents;
- struct internal_reloc *relocs;
- struct internal_syment *syms;
- asection **sections;
+sh_relocate_section (bfd *output_bfd ATTRIBUTE_UNUSED,
+ struct bfd_link_info *info,
+ bfd *input_bfd,
+ asection *input_section,
+ bfd_byte *contents,
+ struct internal_reloc *relocs,
+ struct internal_syment *syms,
+ asection **sections)
{
struct internal_reloc *rel;
struct internal_reloc *relend;
which uses sh_relocate_section. */
static bfd_byte *
-sh_coff_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;
+sh_coff_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)
{
asection *input_section = link_order->u.indirect.section;
bfd *input_bfd = input_section->owner;
esymend = esym + obj_raw_syment_count (input_bfd) * symesz;
while (esym < esymend)
{
- bfd_coff_swap_sym_in (input_bfd, (PTR) esym, (PTR) isymp);
+ bfd_coff_swap_sym_in (input_bfd, esym, isymp);
if (isymp->n_scnum != 0)
*secpp = coff_section_from_bfd_index (input_bfd, isymp->n_scnum);
#endif
#ifndef TARGET_SHL_SYM
-static const bfd_target * coff_small_object_p PARAMS ((bfd *));
-static bfd_boolean coff_small_new_section_hook PARAMS ((bfd *, asection *));
+
/* Some people want versions of the SH COFF target which do not align
to 16 byte boundaries. We implement that by adding a couple of new
target vectors. These are just like the ones above, but they
Otherwise we won't recognize the non default endianness. */
static const bfd_target *
-coff_small_object_p (abfd)
- bfd *abfd;
+coff_small_object_p (bfd *abfd)
{
if (abfd->target_defaulted)
{
/* Set the section alignment for the small versions. */
static bfd_boolean
-coff_small_new_section_hook (abfd, section)
- bfd *abfd;
- asection *section;
+coff_small_new_section_hook (bfd *abfd, asection *section)
{
if (! coff_new_section_hook (abfd, section))
return FALSE;
& shlcoff_small_vec,
- (PTR) &bfd_coff_small_swap_table
+ & bfd_coff_small_swap_table
};
const bfd_target shlcoff_small_vec =
& shcoff_small_vec,
- (PTR) &bfd_coff_small_swap_table
+ & bfd_coff_small_swap_table
};
#endif
/* BFD back-end for Sparc COFF files.
Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1999, 2000, 2001,
- 2002, 2003, 2005, 2007, 2008 Free Software Foundation, Inc.
+ 2002, 2003, 2005, 2007, 2008, 2012 Free Software Foundation, Inc.
Written by Cygnus Support.
This file is part of BFD, the Binary File Descriptor library.
/* The page size is a guess based on ELF. */
#define COFF_PAGE_SIZE 0x10000
-
-static reloc_howto_type *coff_sparc_reloc_type_lookup
- PARAMS ((bfd *, bfd_reloc_code_real_type));
-static void rtype2howto PARAMS ((arelent *, struct internal_reloc *));
-
enum reloc_type
{
R_SPARC_NONE = 0,
};
/* This is stolen pretty directly from elf.c. */
-static bfd_reloc_status_type
-bfd_coff_generic_reloc PARAMS ((bfd *, arelent *, asymbol *, PTR,
- asection *, bfd *, char **));
static bfd_reloc_status_type
-bfd_coff_generic_reloc (abfd, reloc_entry, symbol, data, input_section,
- output_bfd, error_message)
- bfd *abfd ATTRIBUTE_UNUSED;
- arelent *reloc_entry;
- asymbol *symbol;
- PTR data ATTRIBUTE_UNUSED;
- asection *input_section;
- bfd *output_bfd;
- char **error_message ATTRIBUTE_UNUSED;
+bfd_coff_generic_reloc (bfd *abfd ATTRIBUTE_UNUSED,
+ arelent *reloc_entry,
+ asymbol *symbol,
+ void * data ATTRIBUTE_UNUSED,
+ asection *input_section,
+ bfd *output_bfd,
+ char **error_message ATTRIBUTE_UNUSED)
{
if (output_bfd != (bfd *) NULL
&& (symbol->flags & BSF_SECTION_SYM) == 0)
HOWTO(R_SPARC_UA32, 0,0,00,FALSE,0,complain_overflow_dont, bfd_coff_generic_reloc,"R_SPARC_UA32", FALSE,0,0x00000000,TRUE),
};
-struct coff_reloc_map {
+struct coff_reloc_map
+{
bfd_reloc_code_real_type bfd_reloc_val;
unsigned char coff_reloc_val;
};
};
static reloc_howto_type *
-coff_sparc_reloc_type_lookup (abfd, code)
- bfd *abfd ATTRIBUTE_UNUSED;
- bfd_reloc_code_real_type code;
+coff_sparc_reloc_type_lookup (bfd *abfd ATTRIBUTE_UNUSED,
+ bfd_reloc_code_real_type code)
{
unsigned int i;
for (i = 0; i < sizeof (sparc_reloc_map) / sizeof (struct coff_reloc_map); i++)
#define coff_bfd_reloc_name_lookup coff_sparc_reloc_name_lookup
static void
-rtype2howto (cache_ptr, dst)
- arelent *cache_ptr;
- struct internal_reloc *dst;
+rtype2howto (arelent *cache_ptr, struct internal_reloc *dst)
{
BFD_ASSERT (dst->r_type < (unsigned int) R_SPARC_max);
cache_ptr->howto = &coff_sparc_howto_table[dst->r_type];
#include "sysdep.h"
#include "bfd.h"
-/* At first the prototypes. */
+/* All that ..._PRE and ...POST functions are called from the corresponding
+ coff_swap... functions. The ...PRE functions are called at the beginning
+ of the function and the ...POST functions at the end of the swap routines. */
static void
-adjust_filehdr_in_post PARAMS ((bfd *, PTR, PTR));
+adjust_filehdr_in_post (bfd *, void *, void *);
static void
-adjust_filehdr_out_pre PARAMS ((bfd *, PTR, PTR));
+adjust_filehdr_out_pre (bfd *, void *, void *);
static void
-adjust_filehdr_out_post PARAMS ((bfd *, PTR, PTR));
+adjust_filehdr_out_post (bfd *, void *, void *);
static void
-adjust_scnhdr_in_post PARAMS ((bfd *, PTR, PTR));
+adjust_scnhdr_in_post (bfd *, void *, void *);
static void
-adjust_scnhdr_out_pre PARAMS ((bfd *, PTR, PTR));
+adjust_scnhdr_out_pre (bfd *, void *, void *);
static void
-adjust_scnhdr_out_post PARAMS ((bfd *, PTR, PTR));
+adjust_scnhdr_out_post (bfd *, void *, void *);
static void
-adjust_aux_in_post PARAMS ((bfd *, PTR, int, int, int, int, PTR));
+adjust_aux_in_post (bfd *, void *, int, int, int, int, void *);
static void
-adjust_aux_out_pre PARAMS ((bfd *, PTR, int, int, int, int, PTR));
+adjust_aux_out_pre (bfd *, void *, int, int, int, int, void *);
static void
-adjust_aux_out_post PARAMS ((bfd *, PTR, int, int, int, int, PTR));
+adjust_aux_out_post (bfd *, void *, int, int, int, int, void *);
static void
-create_go32_stub PARAMS ((bfd *));
-
-/* All that ..._PRE and ...POST functions are called from the corresponding
- coff_swap... functions. The ...PRE functions are called at the beginning
- of the function and the ...POST functions at the end of the swap routines. */
+create_go32_stub (bfd *);
#define COFF_ADJUST_FILEHDR_IN_POST adjust_filehdr_in_post
#define COFF_ADJUST_FILEHDR_OUT_PRE adjust_filehdr_out_pre
#define COFF_ADJUST_AUX_OUT_PRE adjust_aux_out_pre
#define COFF_ADJUST_AUX_OUT_POST adjust_aux_out_post
-static const bfd_target *go32_check_format (bfd *abfd);
+static const bfd_target *go32_check_format (bfd *);
#define COFF_CHECK_FORMAT go32_check_format
static bfd_boolean
- go32_stubbed_coff_bfd_copy_private_bfd_data PARAMS ((bfd *, bfd *));
+ go32_stubbed_coff_bfd_copy_private_bfd_data (bfd *, bfd *);
#define coff_bfd_copy_private_bfd_data go32_stubbed_coff_bfd_copy_private_bfd_data
if (val != 0) val += diff
static void
-adjust_filehdr_in_post (abfd, src, dst)
- bfd *abfd ATTRIBUTE_UNUSED;
- PTR src;
- PTR dst;
+adjust_filehdr_in_post (bfd * abfd ATTRIBUTE_UNUSED,
+ void * src,
+ void * dst)
{
FILHDR *filehdr_src = (FILHDR *) src;
struct internal_filehdr *filehdr_dst = (struct internal_filehdr *) dst;
}
static void
-adjust_filehdr_out_pre (abfd, in, out)
- bfd *abfd;
- PTR in;
- PTR out;
+adjust_filehdr_out_pre (bfd * abfd, void * in, void * out)
{
struct internal_filehdr *filehdr_in = (struct internal_filehdr *) in;
FILHDR *filehdr_out = (FILHDR *) out;
}
static void
-adjust_filehdr_out_post (abfd, in, out)
- bfd *abfd ATTRIBUTE_UNUSED;
- PTR in;
- PTR out ATTRIBUTE_UNUSED;
+adjust_filehdr_out_post (bfd * abfd ATTRIBUTE_UNUSED,
+ void * in,
+ void * out ATTRIBUTE_UNUSED)
{
struct internal_filehdr *filehdr_in = (struct internal_filehdr *) in;
/* Undo the above change. */
}
static void
-adjust_scnhdr_in_post (abfd, ext, in)
- bfd *abfd ATTRIBUTE_UNUSED;
- PTR ext ATTRIBUTE_UNUSED;
- PTR in;
+adjust_scnhdr_in_post (bfd * abfd ATTRIBUTE_UNUSED,
+ void * ext ATTRIBUTE_UNUSED,
+ void * in)
{
struct internal_scnhdr *scnhdr_int = (struct internal_scnhdr *) in;
}
static void
-adjust_scnhdr_out_pre (abfd, in, out)
- bfd *abfd ATTRIBUTE_UNUSED;
- PTR in;
- PTR out ATTRIBUTE_UNUSED;
+adjust_scnhdr_out_pre (bfd * abfd ATTRIBUTE_UNUSED,
+ void * in,
+ void * out ATTRIBUTE_UNUSED)
{
struct internal_scnhdr *scnhdr_int = (struct internal_scnhdr *) in;
}
static void
-adjust_scnhdr_out_post (abfd, in, out)
- bfd *abfd ATTRIBUTE_UNUSED;
- PTR in;
- PTR out ATTRIBUTE_UNUSED;
+adjust_scnhdr_out_post (bfd * abfd ATTRIBUTE_UNUSED,
+ void * in,
+ void * out ATTRIBUTE_UNUSED)
{
struct internal_scnhdr *scnhdr_int = (struct internal_scnhdr *) in;
}
static void
-adjust_aux_in_post (abfd, ext1, type, in_class, indx, numaux, in1)
- bfd *abfd ATTRIBUTE_UNUSED;
- PTR ext1 ATTRIBUTE_UNUSED;
- int type;
- int in_class;
- int indx ATTRIBUTE_UNUSED;
- int numaux ATTRIBUTE_UNUSED;
- PTR in1;
+adjust_aux_in_post (bfd * abfd ATTRIBUTE_UNUSED,
+ void * ext1 ATTRIBUTE_UNUSED,
+ int type,
+ int in_class,
+ int indx ATTRIBUTE_UNUSED,
+ int numaux ATTRIBUTE_UNUSED,
+ void * in1)
{
union internal_auxent *in = (union internal_auxent *) in1;
}
static void
-adjust_aux_out_pre (abfd, inp, type, in_class, indx, numaux, extp)
- bfd *abfd ATTRIBUTE_UNUSED;
- PTR inp;
- int type;
- int in_class;
- int indx ATTRIBUTE_UNUSED;
- int numaux ATTRIBUTE_UNUSED;
- PTR extp ATTRIBUTE_UNUSED;
+adjust_aux_out_pre (bfd *abfd ATTRIBUTE_UNUSED,
+ void * inp,
+ int type,
+ int in_class,
+ int indx ATTRIBUTE_UNUSED,
+ int numaux ATTRIBUTE_UNUSED,
+ void * extp ATTRIBUTE_UNUSED)
{
union internal_auxent *in = (union internal_auxent *) inp;
}
static void
-adjust_aux_out_post (abfd, inp, type, in_class, indx, numaux, extp)
- bfd *abfd ATTRIBUTE_UNUSED;
- PTR inp;
- int type;
- int in_class;
- int indx ATTRIBUTE_UNUSED;
- int numaux ATTRIBUTE_UNUSED;
- PTR extp ATTRIBUTE_UNUSED;
+adjust_aux_out_post (bfd *abfd ATTRIBUTE_UNUSED,
+ void * inp,
+ int type,
+ int in_class,
+ int indx ATTRIBUTE_UNUSED,
+ int numaux ATTRIBUTE_UNUSED,
+ void * extp ATTRIBUTE_UNUSED)
{
union internal_auxent *in = (union internal_auxent *) inp;
is taken. */
static void
-create_go32_stub (abfd)
- bfd *abfd;
+create_go32_stub (bfd *abfd)
{
/* Do it only once. */
if (coff_data (abfd)->go32stub == NULL)
to the new obfd. */
static bfd_boolean
-go32_stubbed_coff_bfd_copy_private_bfd_data (ibfd, obfd)
- bfd *ibfd;
- bfd *obfd;
+go32_stubbed_coff_bfd_copy_private_bfd_data (bfd *ibfd, bfd *obfd)
{
/* Check if both are the same targets. */
if (ibfd->xvec != obfd->xvec)
/* BFD back-end for TMS320C30 coff binaries.
- Copyright 1998, 1999, 2000, 2001, 2002, 2005, 2007, 2008, 2011
+ Copyright 1998, 1999, 2000, 2001, 2002, 2005, 2007, 2008, 2011, 2012
Free Software Foundation, Inc.
Contributed by Steven Haworth (steve@pm.cse.rmit.edu.au)
#include "coff/internal.h"
#include "libcoff.h"
-static int coff_tic30_select_reloc PARAMS ((reloc_howto_type *));
-static void rtype2howto PARAMS ((arelent *, struct internal_reloc *));
-static void reloc_processing PARAMS ((arelent *, struct internal_reloc *, asymbol **, bfd *, asection *));
-
-reloc_howto_type * tic30_coff_reloc_type_lookup PARAMS ((bfd *, bfd_reloc_code_real_type));
-
#define COFF_DEFAULT_SECTION_ALIGNMENT_POWER (1)
reloc_howto_type tic30_coff_howto_table[] =
map to the howto table entries that match those in both the aout
and coff implementations. */
-reloc_howto_type *
-tic30_coff_reloc_type_lookup (abfd, code)
- bfd *abfd ATTRIBUTE_UNUSED;
- bfd_reloc_code_real_type code;
+static reloc_howto_type *
+tic30_coff_reloc_type_lookup (bfd *abfd ATTRIBUTE_UNUSED,
+ bfd_reloc_code_real_type code)
{
switch (code)
{
/* Turn a howto into a reloc number. */
static int
-coff_tic30_select_reloc (howto)
- reloc_howto_type *howto;
+coff_tic30_select_reloc (reloc_howto_type *howto)
{
return howto->type;
}
/* 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)
{
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);
/* BFD back-end for TMS320C4X coff binaries.
Copyright 1996, 1997, 1998, 1999, 2000, 2002, 2003, 2005, 2007,
- 2008 Free Software Foundation, Inc.
+ 2008, 2012 Free Software Foundation, Inc.
Contributed by Michael Hayes (m.hayes@elec.canterbury.ac.nz)
#undef F_LSYMS
#define F_LSYMS F_LSYMS_TICOFF
-static bfd_boolean ticoff_bfd_is_local_label_name
- PARAMS ((bfd *, const char *));
-static bfd_reloc_status_type tic4x_relocation
- PARAMS ((bfd *, arelent *, asymbol *, PTR, asection *, bfd *, char ** ));
-static reloc_howto_type *tic4x_coff_reloc_type_lookup
- PARAMS ((bfd *, bfd_reloc_code_real_type ));
-static void tic4x_lookup_howto
- PARAMS ((arelent *, struct internal_reloc * ));
-static reloc_howto_type *coff_tic4x_rtype_to_howto
- PARAMS ((bfd *, asection *, struct internal_reloc *, struct coff_link_hash_entry *, struct internal_syment *, bfd_vma * ));
-static void tic4x_reloc_processing
- PARAMS ((arelent *, struct internal_reloc *, asymbol **, bfd *, asection * ));
-
+static reloc_howto_type *
+coff_tic4x_rtype_to_howto (bfd *, asection *, struct internal_reloc *,
+ struct coff_link_hash_entry *,
+ struct internal_syment *, bfd_vma *);
+static void
+tic4x_reloc_processing (arelent *, struct internal_reloc *,
+ asymbol **, bfd *, asection *);
/* Replace the stock _bfd_coff_is_local_label_name to recognize TI COFF local
labels. */
static bfd_boolean
-ticoff_bfd_is_local_label_name (abfd, name)
- bfd *abfd ATTRIBUTE_UNUSED;
- const char *name;
+ticoff_bfd_is_local_label_name (bfd *abfd ATTRIBUTE_UNUSED,
+ const char *name)
{
if (TICOFF_LOCAL_LABEL_P(name))
return TRUE;
#include "coffcode.h"
static bfd_reloc_status_type
-tic4x_relocation (abfd, reloc_entry, symbol, data, input_section,
- output_bfd, error_message)
- bfd *abfd ATTRIBUTE_UNUSED;
- arelent *reloc_entry;
- asymbol *symbol ATTRIBUTE_UNUSED;
- PTR data ATTRIBUTE_UNUSED;
- asection *input_section;
- bfd *output_bfd;
- char **error_message ATTRIBUTE_UNUSED;
+tic4x_relocation (bfd *abfd ATTRIBUTE_UNUSED,
+ arelent *reloc_entry,
+ asymbol *symbol ATTRIBUTE_UNUSED,
+ void * data ATTRIBUTE_UNUSED,
+ asection *input_section,
+ bfd *output_bfd,
+ char **error_message ATTRIBUTE_UNUSED)
{
if (output_bfd != (bfd *) NULL)
{
bfd/reloc.c) to map to the howto table entries. */
static reloc_howto_type *
-tic4x_coff_reloc_type_lookup (abfd, code)
- bfd *abfd ATTRIBUTE_UNUSED;
- bfd_reloc_code_real_type code;
+tic4x_coff_reloc_type_lookup (bfd *abfd ATTRIBUTE_UNUSED,
+ bfd_reloc_code_real_type code)
{
unsigned int type;
unsigned int i;
Called after some initial checking by the tic4x_rtype_to_howto fn
below. */
static void
-tic4x_lookup_howto (internal, dst)
- arelent *internal;
- struct internal_reloc *dst;
+tic4x_lookup_howto (arelent *internal,
+ struct internal_reloc *dst)
{
unsigned int i;
int bank = (dst->r_symndx == -1) ? HOWTO_BANK : 0;
}
static reloc_howto_type *
-coff_tic4x_rtype_to_howto (abfd, sec, rel, h, sym, addendp)
- bfd *abfd ATTRIBUTE_UNUSED;
- asection *sec;
- struct internal_reloc *rel;
- struct coff_link_hash_entry *h ATTRIBUTE_UNUSED;
- struct internal_syment *sym ATTRIBUTE_UNUSED;
- bfd_vma *addendp;
+coff_tic4x_rtype_to_howto (bfd *abfd ATTRIBUTE_UNUSED,
+ asection *sec,
+ struct internal_reloc *rel,
+ struct coff_link_hash_entry *h ATTRIBUTE_UNUSED,
+ struct internal_syment *sym ATTRIBUTE_UNUSED,
+ bfd_vma *addendp)
{
arelent genrel;
static void
-tic4x_reloc_processing (relent, reloc, symbols, abfd, section)
- arelent *relent;
- struct internal_reloc *reloc;
- asymbol **symbols;
- bfd *abfd;
- asection *section;
+tic4x_reloc_processing (arelent *relent,
+ struct internal_reloc *reloc,
+ asymbol **symbols,
+ bfd *abfd,
+ asection *section)
{
asymbol *ptr;
/* TI COFF v0, DOS tools (little-endian headers). */
-CREATE_LITTLE_COFF_TARGET_VEC(tic4x_coff0_vec, "coff0-tic4x", HAS_LOAD_PAGE, 0, '_', NULL, (PTR)&ticoff0_swap_table);
+CREATE_LITTLE_COFF_TARGET_VEC(tic4x_coff0_vec, "coff0-tic4x", HAS_LOAD_PAGE, 0, '_', NULL, & ticoff0_swap_table);
/* TI COFF v0, SPARC tools (big-endian headers). */
-CREATE_BIGHDR_COFF_TARGET_VEC(tic4x_coff0_beh_vec, "coff0-beh-tic4x", HAS_LOAD_PAGE, 0, '_', &tic4x_coff0_vec, (PTR)&ticoff0_swap_table);
+CREATE_BIGHDR_COFF_TARGET_VEC(tic4x_coff0_beh_vec, "coff0-beh-tic4x", HAS_LOAD_PAGE, 0, '_', &tic4x_coff0_vec, & ticoff0_swap_table);
/* TI COFF v1, DOS tools (little-endian headers). */
-CREATE_LITTLE_COFF_TARGET_VEC(tic4x_coff1_vec, "coff1-tic4x", HAS_LOAD_PAGE, 0, '_', &tic4x_coff0_beh_vec, (PTR)&ticoff1_swap_table);
+CREATE_LITTLE_COFF_TARGET_VEC(tic4x_coff1_vec, "coff1-tic4x", HAS_LOAD_PAGE, 0, '_', &tic4x_coff0_beh_vec, & ticoff1_swap_table);
/* TI COFF v1, SPARC tools (big-endian headers). */
-CREATE_BIGHDR_COFF_TARGET_VEC(tic4x_coff1_beh_vec, "coff1-beh-tic4x", HAS_LOAD_PAGE, 0, '_', &tic4x_coff1_vec, (PTR)&ticoff1_swap_table);
+CREATE_BIGHDR_COFF_TARGET_VEC(tic4x_coff1_beh_vec, "coff1-beh-tic4x", HAS_LOAD_PAGE, 0, '_', &tic4x_coff1_vec, & ticoff1_swap_table);
/* TI COFF v2, TI DOS tools output (little-endian headers). */
CREATE_LITTLE_COFF_TARGET_VEC(tic4x_coff2_vec, "coff2-tic4x", HAS_LOAD_PAGE, 0, '_', &tic4x_coff1_beh_vec, COFF_SWAP_TABLE);
#undef F_LSYMS
#define F_LSYMS F_LSYMS_TICOFF
-static void tic54x_reloc_processing
- PARAMS ((arelent *, struct internal_reloc *, asymbol **, bfd *, asection *));
-static bfd_reloc_status_type tic54x_relocation
- PARAMS ((bfd *, arelent *, asymbol *, PTR, asection *, bfd *, char **));
-static bfd_boolean tic54x_set_section_contents
- PARAMS ((bfd *, sec_ptr, const PTR, file_ptr, bfd_size_type));
-static reloc_howto_type *coff_tic54x_rtype_to_howto
- PARAMS ((bfd *, asection *, struct internal_reloc *, struct coff_link_hash_entry *, struct internal_syment *, bfd_vma *));
-static bfd_boolean tic54x_set_arch_mach
- PARAMS ((bfd *, enum bfd_architecture, unsigned long));
-static reloc_howto_type * tic54x_coff_reloc_type_lookup
- PARAMS ((bfd *, bfd_reloc_code_real_type));
-static void tic54x_lookup_howto
- PARAMS ((arelent *, struct internal_reloc *));
-static bfd_boolean ticoff_bfd_is_local_label_name
- PARAMS ((bfd *, const char *));
+static void
+tic54x_reloc_processing (arelent *, struct internal_reloc *,
+ asymbol **, bfd *, asection *);
/* 32-bit operations
The octet order is screwy. words are LSB first (LS octet, actually), but
#define coff_set_section_load_page bfd_ticoff_set_section_load_page
void
-bfd_ticoff_set_section_load_page (sect, page)
- asection *sect;
- int page;
+bfd_ticoff_set_section_load_page (asection *sect,
+ int page)
{
sect->lma = (sect->lma & ADDR_MASK) | PG_TO_FLAG(page);
}
int
-bfd_ticoff_get_section_load_page (sect)
- asection *sect;
+bfd_ticoff_get_section_load_page (asection *sect)
{
int page;
(e.g. binary). */
static bfd_boolean
-tic54x_set_arch_mach (abfd, arch, machine)
- bfd *abfd;
- enum bfd_architecture arch;
- unsigned long machine;
+tic54x_set_arch_mach (bfd *abfd,
+ enum bfd_architecture arch,
+ unsigned long machine)
{
if (arch == bfd_arch_unknown)
arch = bfd_arch_tic54x;
}
static bfd_reloc_status_type
-tic54x_relocation (abfd, reloc_entry, symbol, data, input_section,
- output_bfd, error_message)
- bfd *abfd ATTRIBUTE_UNUSED;
- arelent *reloc_entry;
- asymbol *symbol ATTRIBUTE_UNUSED;
- PTR data ATTRIBUTE_UNUSED;
- asection *input_section;
- bfd *output_bfd;
- char **error_message ATTRIBUTE_UNUSED;
+tic54x_relocation (bfd *abfd ATTRIBUTE_UNUSED,
+ arelent *reloc_entry,
+ asymbol *symbol ATTRIBUTE_UNUSED,
+ void * data ATTRIBUTE_UNUSED,
+ asection *input_section,
+ bfd *output_bfd,
+ char **error_message ATTRIBUTE_UNUSED)
{
if (output_bfd != (bfd *) NULL)
{
/* For the case statement use the code values used tc_gen_reloc (defined in
bfd/reloc.c) to map to the howto table entries. */
-reloc_howto_type *
-tic54x_coff_reloc_type_lookup (abfd, code)
- bfd *abfd ATTRIBUTE_UNUSED;
- bfd_reloc_code_real_type code;
+static reloc_howto_type *
+tic54x_coff_reloc_type_lookup (bfd *abfd ATTRIBUTE_UNUSED,
+ bfd_reloc_code_real_type code)
{
switch (code)
{
Called after some initial checking by the tic54x_rtype_to_howto fn below. */
static void
-tic54x_lookup_howto (internal, dst)
- arelent *internal;
- struct internal_reloc *dst;
+tic54x_lookup_howto (arelent *internal,
+ struct internal_reloc *dst)
{
unsigned i;
int bank = (dst->r_symndx == -1) ? HOWTO_BANK : 0;
#define coff_rtype_to_howto coff_tic54x_rtype_to_howto
static reloc_howto_type *
-coff_tic54x_rtype_to_howto (abfd, sec, rel, h, sym, addendp)
- bfd *abfd ATTRIBUTE_UNUSED;
- asection *sec;
- struct internal_reloc *rel;
- struct coff_link_hash_entry *h ATTRIBUTE_UNUSED;
- struct internal_syment *sym ATTRIBUTE_UNUSED;
- bfd_vma *addendp;
+coff_tic54x_rtype_to_howto (bfd *abfd ATTRIBUTE_UNUSED,
+ asection *sec,
+ struct internal_reloc *rel,
+ struct coff_link_hash_entry *h ATTRIBUTE_UNUSED,
+ struct internal_syment *sym ATTRIBUTE_UNUSED,
+ bfd_vma *addendp)
{
arelent genrel;
labels. */
static bfd_boolean
-ticoff_bfd_is_local_label_name (abfd, name)
- bfd *abfd ATTRIBUTE_UNUSED;
- const char *name;
+ticoff_bfd_is_local_label_name (bfd *abfd ATTRIBUTE_UNUSED,
+ const char *name)
{
if (TICOFF_LOCAL_LABEL_P(name))
return TRUE;
#include "coffcode.h"
static bfd_boolean
-tic54x_set_section_contents (abfd, section, location, offset, bytes_to_do)
- bfd *abfd;
- sec_ptr section;
- const PTR location;
- file_ptr offset;
- bfd_size_type bytes_to_do;
+tic54x_set_section_contents (bfd *abfd,
+ sec_ptr section,
+ const void * location,
+ file_ptr offset,
+ bfd_size_type bytes_to_do)
{
return coff_set_section_contents (abfd, section, location,
offset, bytes_to_do);
}
static void
-tic54x_reloc_processing (relent, reloc, symbols, abfd, section)
- arelent *relent;
- struct internal_reloc *reloc;
- asymbol **symbols;
- bfd *abfd;
- asection *section;
+tic54x_reloc_processing (arelent *relent,
+ struct internal_reloc *reloc,
+ asymbol **symbols,
+ bfd *abfd,
+ asection *section)
{
asymbol *ptr;
BFD_JUMP_TABLE_DYNAMIC (_bfd_nodynamic),
NULL,
- (PTR) & ticoff0_swap_table
+ & ticoff0_swap_table
};
/* TI COFF v0, SPARC tools (big-endian headers). */
& tic54x_coff0_vec,
- (PTR) & ticoff0_swap_table
+ & ticoff0_swap_table
};
/* TI COFF v1, DOS tools (little-endian headers). */
& tic54x_coff0_beh_vec,
- (PTR) & ticoff1_swap_table
+ & ticoff1_swap_table
};
/* TI COFF v1, SPARC tools (big-endian headers). */
& tic54x_coff1_vec,
- (PTR) & ticoff1_swap_table
+ & ticoff1_swap_table
};
/* TI COFF v2, TI DOS tools output (little-endian headers). */
/* BFD back-end for Texas Instruments TMS320C80 Multimedia Video Processor (MVP).
- Copyright 1996, 1997, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2007, 2008
- Free Software Foundation, Inc.
+ Copyright 1996, 1997, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2007, 2008,
+ 2012 Free Software Foundation, Inc.
Written by Fred Fish (fnf@cygnus.com)
#define GET_SCNHDR_FLAGS H_GET_16
#define PUT_SCNHDR_FLAGS H_PUT_16
-static void rtype2howto
- PARAMS ((arelent *cache_ptr, struct internal_reloc *dst));
static bfd_reloc_status_type ppbase_reloc
- PARAMS ((bfd *, arelent *, asymbol *, PTR, asection *, bfd *, char **));
+ (bfd *, arelent *, asymbol *, void *, asection *, bfd *, char **);
static bfd_reloc_status_type glob15_reloc
- PARAMS ((bfd *, arelent *, asymbol *, PTR, asection *, bfd *, char **));
+ (bfd *, arelent *, asymbol *, void *, asection *, bfd *, char **);
static bfd_reloc_status_type glob16_reloc
- PARAMS ((bfd *, arelent *, asymbol *, PTR, asection *, bfd *, char **));
+ (bfd *, arelent *, asymbol *, void *, asection *, bfd *, char **);
static bfd_reloc_status_type local16_reloc
- PARAMS ((bfd *, arelent *, asymbol *, PTR, asection *, bfd *, char **));
-static bfd_boolean coff_tic80_relocate_section
- PARAMS ((bfd *, struct bfd_link_info *, bfd *, asection *, bfd_byte *,
- struct internal_reloc *, struct internal_syment *, asection **));
-static reloc_howto_type * coff_tic80_rtype_to_howto
- PARAMS ((bfd *, asection *, struct internal_reloc *,
- struct coff_link_hash_entry *, struct internal_syment *,
- bfd_vma *));
+ (bfd *, arelent *, asymbol *, void *, asection *, bfd *, char **);
+
static reloc_howto_type tic80_howto_table[] =
{
relocations. */
static bfd_reloc_status_type
-ppbase_reloc (abfd, reloc_entry, symbol_in, data, input_section, output_bfd,
- error_message)
- bfd *abfd ATTRIBUTE_UNUSED;
- arelent *reloc_entry ATTRIBUTE_UNUSED;
- asymbol *symbol_in ATTRIBUTE_UNUSED;
- PTR data ATTRIBUTE_UNUSED;
- asection *input_section ATTRIBUTE_UNUSED;
- bfd *output_bfd ATTRIBUTE_UNUSED;
- char **error_message ATTRIBUTE_UNUSED;
+ppbase_reloc (bfd *abfd ATTRIBUTE_UNUSED,
+ arelent *reloc_entry ATTRIBUTE_UNUSED,
+ asymbol *symbol_in ATTRIBUTE_UNUSED,
+ void * data ATTRIBUTE_UNUSED,
+ asection *input_section ATTRIBUTE_UNUSED,
+ bfd *output_bfd ATTRIBUTE_UNUSED,
+ char **error_message ATTRIBUTE_UNUSED)
{
/* FIXME. */
abort ();
/* This special function is used for the global 15 bit relocations. */
static bfd_reloc_status_type
-glob15_reloc (abfd, reloc_entry, symbol_in, data, input_section, output_bfd,
- error_message)
- bfd *abfd ATTRIBUTE_UNUSED;
- arelent *reloc_entry ATTRIBUTE_UNUSED;
- asymbol *symbol_in ATTRIBUTE_UNUSED;
- PTR data ATTRIBUTE_UNUSED;
- asection *input_section ATTRIBUTE_UNUSED;
- bfd *output_bfd ATTRIBUTE_UNUSED;
- char **error_message ATTRIBUTE_UNUSED;
+glob15_reloc (bfd *abfd ATTRIBUTE_UNUSED,
+ arelent *reloc_entry ATTRIBUTE_UNUSED,
+ asymbol *symbol_in ATTRIBUTE_UNUSED,
+ void * data ATTRIBUTE_UNUSED,
+ asection *input_section ATTRIBUTE_UNUSED,
+ bfd *output_bfd ATTRIBUTE_UNUSED,
+ char **error_message ATTRIBUTE_UNUSED)
{
/* FIXME. */
abort ();
/* This special function is used for the global 16 bit relocations. */
static bfd_reloc_status_type
-glob16_reloc (abfd, reloc_entry, symbol_in, data, input_section, output_bfd,
- error_message)
- bfd *abfd ATTRIBUTE_UNUSED;
- arelent *reloc_entry ATTRIBUTE_UNUSED;
- asymbol *symbol_in ATTRIBUTE_UNUSED;
- PTR data ATTRIBUTE_UNUSED;
- asection *input_section ATTRIBUTE_UNUSED;
- bfd *output_bfd ATTRIBUTE_UNUSED;
- char **error_message ATTRIBUTE_UNUSED;
+glob16_reloc (bfd *abfd ATTRIBUTE_UNUSED,
+ arelent *reloc_entry ATTRIBUTE_UNUSED,
+ asymbol *symbol_in ATTRIBUTE_UNUSED,
+ void * data ATTRIBUTE_UNUSED,
+ asection *input_section ATTRIBUTE_UNUSED,
+ bfd *output_bfd ATTRIBUTE_UNUSED,
+ char **error_message ATTRIBUTE_UNUSED)
{
/* FIXME. */
abort ();
/* This special function is used for the local 16 bit relocations. */
static bfd_reloc_status_type
-local16_reloc (abfd, reloc_entry, symbol_in, data, input_section, output_bfd,
- error_message)
- bfd *abfd ATTRIBUTE_UNUSED;
- arelent *reloc_entry ATTRIBUTE_UNUSED;
- asymbol *symbol_in ATTRIBUTE_UNUSED;
- PTR data ATTRIBUTE_UNUSED;
- asection *input_section ATTRIBUTE_UNUSED;
- bfd *output_bfd ATTRIBUTE_UNUSED;
- char **error_message ATTRIBUTE_UNUSED;
+local16_reloc (bfd *abfd ATTRIBUTE_UNUSED,
+ arelent *reloc_entry ATTRIBUTE_UNUSED,
+ asymbol *symbol_in ATTRIBUTE_UNUSED,
+ void * data ATTRIBUTE_UNUSED,
+ asection *input_section ATTRIBUTE_UNUSED,
+ bfd *output_bfd ATTRIBUTE_UNUSED,
+ char **error_message ATTRIBUTE_UNUSED)
{
/* FIXME. */
abort ();
to generate an output file. */
static void
-rtype2howto (cache_ptr, dst)
- arelent *cache_ptr;
- struct internal_reloc *dst;
+rtype2howto (arelent *cache_ptr, struct internal_reloc *dst)
{
unsigned int i;
#define coff_rtype_to_howto coff_tic80_rtype_to_howto
static reloc_howto_type *
-coff_tic80_rtype_to_howto (abfd, sec, rel, h, sym, addendp)
- bfd *abfd ATTRIBUTE_UNUSED;
- asection *sec;
- struct internal_reloc *rel;
- struct coff_link_hash_entry *h ATTRIBUTE_UNUSED;
- struct internal_syment *sym ATTRIBUTE_UNUSED;
- bfd_vma *addendp;
+coff_tic80_rtype_to_howto (bfd *abfd ATTRIBUTE_UNUSED,
+ asection *sec,
+ struct internal_reloc *rel,
+ struct coff_link_hash_entry *h ATTRIBUTE_UNUSED,
+ struct internal_syment *sym ATTRIBUTE_UNUSED,
+ bfd_vma *addendp)
{
arelent genrel;
of this is a copy of _bfd_coff_generic_relocate_section. */
static bfd_boolean
-coff_tic80_relocate_section (output_bfd, info, input_bfd,
- input_section, contents, relocs, syms,
- sections)
- bfd *output_bfd;
- struct bfd_link_info *info;
- bfd *input_bfd;
- asection *input_section;
- bfd_byte *contents;
- struct internal_reloc *relocs;
- struct internal_syment *syms;
- asection **sections;
+coff_tic80_relocate_section (bfd *output_bfd,
+ struct bfd_link_info *info,
+ bfd *input_bfd,
+ asection *input_section,
+ bfd_byte *contents,
+ struct internal_reloc *relocs,
+ struct internal_syment *syms,
+ asection **sections)
{
struct internal_reloc *rel;
struct internal_reloc *relend;
/* BFD back-end for WDC 65816 COFF binaries.
Copyright 1995, 1996, 1997, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
- 2006, 2007, 2008 Free Software Foundation, Inc.
+ 2006, 2007, 2008, 2012 Free Software Foundation, Inc.
Written by Steve Chamberlain, <sac@cygnus.com>.
This file is part of BFD, the Binary File Descriptor library.
#include "coff/internal.h"
#include "libcoff.h"
-static int select_reloc PARAMS ((reloc_howto_type *));
-static void rtype2howto PARAMS ((arelent *, struct internal_reloc *));
-static void reloc_processing PARAMS ((arelent *, struct internal_reloc *, asymbol **, bfd *, asection *));
-static int w65_reloc16_estimate PARAMS ((bfd *, asection *, arelent *, unsigned int, struct bfd_link_info *));
-static void w65_reloc16_extra_cases PARAMS ((bfd *,struct bfd_link_info *, struct bfd_link_order *, arelent *, bfd_byte *, unsigned int *, unsigned int *));
-
#define COFF_DEFAULT_SECTION_ALIGNMENT_POWER (1)
static reloc_howto_type howto_table[] =
- {
- HOWTO (R_W65_ABS8, 0, 0, 8, FALSE, 0, complain_overflow_bitfield, 0, "abs8", TRUE, 0x000000ff, 0x000000ff, FALSE),
+{
+ HOWTO (R_W65_ABS8, 0, 0, 8, FALSE, 0, complain_overflow_bitfield, 0, "abs8", TRUE, 0x000000ff, 0x000000ff, FALSE),
HOWTO (R_W65_ABS16, 1, 0, 16, FALSE, 0, complain_overflow_bitfield, 0, "abs16", TRUE, 0x0000ffff, 0x0000ffff, FALSE),
HOWTO (R_W65_ABS24, 0, 2, 32, FALSE, 0, complain_overflow_bitfield, 0, "abs24", TRUE, 0x00ffffff, 0x00ffffff, FALSE),
HOWTO (R_W65_ABS8S8, 0, 0, 8, FALSE, 0, complain_overflow_bitfield, 0, ">abs8", TRUE, 0x000000ff, 0x000000ff, FALSE),
dst->r_stuff[1] = 'C';
static int
-select_reloc (howto)
- reloc_howto_type *howto;
+select_reloc (reloc_howto_type *howto)
{
return howto->type ;
}
/* 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)
{
internal->howto = howto_table + dst->r_type - 1;
}
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);
}
static int
-w65_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;
+w65_reloc16_estimate (bfd *abfd,
+ asection *input_section,
+ arelent *reloc,
+ unsigned int shrink,
+ struct bfd_link_info *link_info)
{
bfd_vma value;
bfd_vma dot;
bfd_vma gap;
/* The address of the thing to be relocated will have moved back by
- the size of the shrink - but we don't change reloc->address here,
- since we need it to know where the relocation lives in the source
- uncooked section. */
+ the size of the shrink - but we don't change reloc->address here,
+ since we need it to know where the relocation lives in the source
+ uncooked section. */
/* reloc->address -= shrink; conceptual */
R_MOV24B1 R_MOV24B2 24 or 8 bit reloc for mov.b */
static void
-w65_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;
+w65_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;
memset (&incount, 0, sizeof (incount));
incount.r_vaddr = o->reloc_count + 1;
- bfd_coff_swap_reloc_out (abfd, (PTR) &incount, (PTR) excount);
+ bfd_coff_swap_reloc_out (abfd, &incount, excount);
if (bfd_bwrite (excount, relsz, abfd) != relsz)
/* We'll leak, but it's an error anyway. */
goto error_return;
/* BFD support for the ARC processor
- Copyright 1994, 1995, 1997, 2001, 2002, 2005, 2007
+ Copyright 1994, 1995, 1997, 2001, 2002, 2005, 2007, 2012
Free Software Foundation, Inc.
Contributed by Doug Evans (dje@cygnus.com).
/* Given cpu type NAME, return its bfd_mach_arc_xxx value.
Returns -1 if not found. */
-int arc_get_mach PARAMS ((char *));
+int arc_get_mach (char *);
int
-arc_get_mach (name)
- char *name;
+arc_get_mach (char *name)
{
const bfd_arch_info_type *p;
/* BFD support for the Axis CRIS architecture.
- Copyright 2000, 2002, 2004, 2005, 2007
+ Copyright 2000, 2002, 2004, 2005, 2007, 2012
Free Software Foundation, Inc.
Contributed by Axis Communications AB.
Written by Hans-Peter Nilsson.
there's a compatible subset for which we provide an arch_info. */
static const bfd_arch_info_type * get_compatible
- PARAMS ((const bfd_arch_info_type *, const bfd_arch_info_type *));
+ (const bfd_arch_info_type *, const bfd_arch_info_type *);
static const bfd_arch_info_type *
-get_compatible (a,b)
- const bfd_arch_info_type *a;
- const bfd_arch_info_type *b;
+get_compatible (const bfd_arch_info_type *a,
+ const bfd_arch_info_type *b)
{
/* Arches must match. */
if (a->arch != b->arch)
/* BFD library support routines for the H8/500 architecture.
- Copyright 1993, 1995, 1999, 2000, 2001, 2002, 2003, 2005, 2007
+ Copyright 1993, 1995, 1999, 2000, 2001, 2002, 2003, 2005, 2007, 2012
Free Software Foundation, Inc.
Hacked by Steve Chamberlain of Cygnus Support.
#include "libbfd.h"
static bfd_boolean scan_mach
- PARAMS ((const struct bfd_arch_info *, const char *));
+ (const struct bfd_arch_info *, const char *);
static bfd_boolean
-scan_mach (info, string)
- const struct bfd_arch_info *info ATTRIBUTE_UNUSED;
- const char *string;
+scan_mach (const struct bfd_arch_info *info ATTRIBUTE_UNUSED,
+ const char *string)
{
if (strcmp (string,"h8/500") == 0)
return TRUE;
/* BFD library support routines for the i960 architecture.
Copyright 1990, 1991, 1993, 1994, 1996, 1999, 2000, 2001, 2002, 2005, 2006,
- 2007 Free Software Foundation, Inc.
+ 2007, 2012 Free Software Foundation, Inc.
Hacked by Steve Chamberlain of Cygnus Support.
This file is part of BFD, the Binary File Descriptor library.
#include "bfd.h"
#include "libbfd.h"
-static bfd_boolean scan_960_mach
- PARAMS ((const bfd_arch_info_type *, const char *));
-static const bfd_arch_info_type *compatible
- PARAMS ((const bfd_arch_info_type *, const bfd_arch_info_type *));
-
/* This routine is provided a string, and tries to work out if it
could possibly refer to the i960 machine pointed at in the
info_struct pointer */
static bfd_boolean
-scan_960_mach (ap, string)
- const bfd_arch_info_type *ap;
- const char *string;
+scan_960_mach (const bfd_arch_info_type *ap,
+ const char *string)
{
unsigned long machine;
int fail_because_not_80960 = FALSE;
to its info structure */
static const bfd_arch_info_type *
-compatible (a,b)
- const bfd_arch_info_type *a;
- const bfd_arch_info_type *b;
+compatible (const bfd_arch_info_type *a,
+ const bfd_arch_info_type *b)
{
/* The i960 has distinct subspecies which may not interbreed:
};
if (a->arch != b->arch || matrix[a->mach][b->mach] == ERROR)
- {
return NULL;
- }
- else
- {
- return (a->mach == matrix[a->mach][b->mach]) ? a : b;
- }
+
+ return (a->mach == matrix[a->mach][b->mach]) ? a : b;
}
#define N(a,b,d,n) \
/* BFD library support routines for the MSP architecture.
- Copyright (C) 2002, 2003, 2005, 2007 Free Software Foundation, Inc.
+ Copyright (C) 2002, 2003, 2005, 2007, 2012
+ Free Software Foundation, Inc.
Contributed by Dmitry Diky <diwil@mail.ru>
This file is part of BFD, the Binary File Descriptor library.
#include "bfd.h"
#include "libbfd.h"
-static const bfd_arch_info_type *compatible
- PARAMS ((const bfd_arch_info_type *, const bfd_arch_info_type *));
+/* This routine is provided two arch_infos and works out which MSP
+ machine which would be compatible with both and returns a pointer
+ to its info structure. */
+
+static const bfd_arch_info_type *
+compatible (const bfd_arch_info_type * a,
+ const bfd_arch_info_type * b)
+{
+ /* If a & b are for different architectures we can do nothing. */
+ if (a->arch != b->arch)
+ return NULL;
+
+ if (a->mach <= b->mach)
+ return b;
+
+ return a;
+}
#define N(addr_bits, machine, print, default, next) \
{ \
const bfd_arch_info_type bfd_msp430_arch =
N (16, bfd_mach_msp14, "msp:14", TRUE, & arch_info_struct[0]);
-/* This routine is provided two arch_infos and works out which MSP
- machine which would be compatible with both and returns a pointer
- to its info structure. */
-
-static const bfd_arch_info_type *
-compatible (a,b)
- const bfd_arch_info_type * a;
- const bfd_arch_info_type * b;
-{
- /* If a & b are for different architectures we can do nothing. */
- if (a->arch != b->arch)
- return NULL;
-
- if (a->mach <= b->mach)
- return b;
-
- return a;
-}
const bfd_arch_info_type bfd_ns32k_arch =
N(32032,"ns32k:32032",FALSE, &arch_info_struct[0]);
-static bfd_reloc_status_type do_ns32k_reloc
- PARAMS ((bfd *, arelent *, struct bfd_symbol *, PTR, asection *,
- bfd *, char **,
- bfd_vma (*) (bfd_byte *, int),
- void (*) (bfd_vma, bfd_byte *, int)));
-
bfd_vma
-_bfd_ns32k_get_displacement (buffer, size)
- bfd_byte *buffer;
- int size;
+_bfd_ns32k_get_displacement (bfd_byte *buffer, int size)
{
bfd_signed_vma value;
}
void
-_bfd_ns32k_put_displacement (value, buffer, size)
- bfd_vma value;
- bfd_byte *buffer;
- int size;
+_bfd_ns32k_put_displacement (bfd_vma value, bfd_byte *buffer, int size)
{
switch (size)
{
}
bfd_vma
-_bfd_ns32k_get_immediate (buffer, size)
- bfd_byte *buffer;
- int size;
+_bfd_ns32k_get_immediate (bfd_byte *buffer, int size)
{
bfd_vma value = 0;
}
void
-_bfd_ns32k_put_immediate (value, buffer, size)
- bfd_vma value;
- bfd_byte *buffer;
- int size;
+_bfd_ns32k_put_immediate (bfd_vma value, bfd_byte *buffer, int size)
{
buffer += size - 1;
switch (size)
needs to be! */
static bfd_reloc_status_type
-do_ns32k_reloc (abfd, reloc_entry, symbol, data, input_section, output_bfd,
- error_message, get_data, put_data)
- bfd *abfd;
- arelent *reloc_entry;
- struct bfd_symbol *symbol;
- PTR data;
- asection *input_section;
- bfd *output_bfd;
- char **error_message ATTRIBUTE_UNUSED;
- bfd_vma (*get_data) PARAMS ((bfd_byte *, int));
- void (*put_data) PARAMS ((bfd_vma, bfd_byte *, int));
+do_ns32k_reloc (bfd * abfd,
+ arelent * reloc_entry,
+ struct bfd_symbol * symbol,
+ void * data,
+ asection * input_section,
+ bfd * output_bfd,
+ char ** error_message ATTRIBUTE_UNUSED,
+ bfd_vma (* get_data) (bfd_byte *, int),
+ void (* put_data) (bfd_vma, bfd_byte *, int))
{
int overflow = 0;
bfd_vma relocation;
/* Relocate a given location using a given value and howto. */
bfd_reloc_status_type
-_bfd_do_ns32k_reloc_contents (howto, input_bfd, relocation, location,
- get_data, put_data)
- reloc_howto_type *howto;
- bfd *input_bfd ATTRIBUTE_UNUSED;
- bfd_vma relocation;
- bfd_byte *location;
- bfd_vma (*get_data) PARAMS ((bfd_byte *, int));
- void (*put_data) PARAMS ((bfd_vma, bfd_byte *, int));
+_bfd_do_ns32k_reloc_contents (reloc_howto_type *howto,
+ bfd *input_bfd ATTRIBUTE_UNUSED,
+ bfd_vma relocation,
+ bfd_byte *location,
+ bfd_vma (*get_data) (bfd_byte *, int),
+ void (*put_data) (bfd_vma, bfd_byte *, int))
{
int size;
bfd_vma x;
}
bfd_reloc_status_type
-_bfd_ns32k_reloc_disp (abfd, reloc_entry, symbol, data, input_section,
- output_bfd, error_message)
- bfd *abfd;
- arelent *reloc_entry;
- struct bfd_symbol *symbol;
- PTR data;
- asection *input_section;
- bfd *output_bfd;
- char **error_message;
+_bfd_ns32k_reloc_disp (bfd *abfd,
+ arelent *reloc_entry,
+ struct bfd_symbol *symbol,
+ void * data,
+ asection *input_section,
+ bfd *output_bfd,
+ char **error_message)
{
return do_ns32k_reloc (abfd, reloc_entry, symbol, data, input_section,
output_bfd, error_message,
}
bfd_reloc_status_type
-_bfd_ns32k_reloc_imm (abfd, reloc_entry, symbol, data, input_section,
- output_bfd, error_message)
- bfd *abfd;
- arelent *reloc_entry;
- struct bfd_symbol *symbol;
- PTR data;
- asection *input_section;
- bfd *output_bfd;
- char **error_message;
+_bfd_ns32k_reloc_imm (bfd *abfd,
+ arelent *reloc_entry,
+ struct bfd_symbol *symbol,
+ void * data,
+ asection *input_section,
+ bfd *output_bfd,
+ char **error_message)
{
return do_ns32k_reloc (abfd, reloc_entry, symbol, data, input_section,
output_bfd, error_message, _bfd_ns32k_get_immediate,
}
bfd_reloc_status_type
-_bfd_ns32k_final_link_relocate (howto, input_bfd, input_section, contents,
- address, value, addend)
- reloc_howto_type *howto;
- bfd *input_bfd;
- asection *input_section;
- bfd_byte *contents;
- bfd_vma address;
- bfd_vma value;
- bfd_vma addend;
+_bfd_ns32k_final_link_relocate (reloc_howto_type *howto,
+ bfd *input_bfd,
+ asection *input_section,
+ bfd_byte *contents,
+ bfd_vma address,
+ bfd_vma value,
+ bfd_vma addend)
{
bfd_vma relocation;
/* The common PowerPC architecture is compatible with the RS/6000. */
-static const bfd_arch_info_type *powerpc_compatible
- PARAMS ((const bfd_arch_info_type *, const bfd_arch_info_type *));
-
static const bfd_arch_info_type *
-powerpc_compatible (a,b)
- const bfd_arch_info_type *a;
- const bfd_arch_info_type *b;
+powerpc_compatible (const bfd_arch_info_type *a,
+ const bfd_arch_info_type *b)
{
BFD_ASSERT (a->arch == bfd_arch_powerpc);
switch (b->arch)
/* BFD back-end for rs6000 support
- Copyright 1990, 1991, 1993, 1995, 2000, 2002, 2003, 2005, 2007
+ Copyright 1990, 1991, 1993, 1995, 2000, 2002, 2003, 2005, 2007, 2012
Free Software Foundation, Inc.
Written by Mimi Phuong-Thao Vo of IBM
and John Gilmore of Cygnus Support.
/* The RS/6000 architecture is compatible with the PowerPC common
architecture. */
-static const bfd_arch_info_type *rs6000_compatible
- PARAMS ((const bfd_arch_info_type *, const bfd_arch_info_type *));
-
static const bfd_arch_info_type *
-rs6000_compatible (a,b)
- const bfd_arch_info_type *a;
- const bfd_arch_info_type *b;
+rs6000_compatible (const bfd_arch_info_type *a,
+ const bfd_arch_info_type *b)
{
BFD_ASSERT (a->arch == bfd_arch_rs6000);
switch (b->arch)
/* bfd back-end for TMS320C[34]x support
- Copyright 1996, 1997, 2002, 2003, 2005, 2007 Free Software Foundation, Inc.
+ Copyright 1996, 1997, 2002, 2003, 2005, 2007, 2012
+ Free Software Foundation, Inc.
Contributed by Michael Hayes (m.hayes@elec.canterbury.ac.nz)
#include "bfd.h"
#include "libbfd.h"
-static bfd_boolean tic4x_scan
- PARAMS ((const struct bfd_arch_info *, const char * ));
-
-
static bfd_boolean
-tic4x_scan (info, string)
- const struct bfd_arch_info *info;
- const char *string;
+tic4x_scan (const struct bfd_arch_info *info,
+ const char *string)
{
/* Allow strings of form [ti][Cc][34][0-9], let's not be too picky
about strange numbered machines in C3x or C4x series. */
/* BFD library support routines for the WDC 65816 architecture.
- Copyright 1995, 1999, 2000, 2001, 2002, 2005, 2007
+ Copyright 1995, 1999, 2000, 2001, 2002, 2005, 2007, 2012
Free Software Foundation, Inc.
Hacked by Steve Chamberlain of Cygnus Support.
#include "bfd.h"
#include "libbfd.h"
-static bfd_boolean scan_mach
- PARAMS ((const struct bfd_arch_info *, const char *));
-
static bfd_boolean
-scan_mach (info, string)
- const struct bfd_arch_info *info ATTRIBUTE_UNUSED;
- const char *string;
+scan_mach (const struct bfd_arch_info *info ATTRIBUTE_UNUSED,
+ const char *string)
{
if (strcmp(string,"w65") == 0)
return TRUE;
/* Generic ECOFF (Extended-COFF) routines.
Copyright 1990, 1991, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
- 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011
+ 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012
Free Software Foundation, Inc.
Original version by Per Bothner.
Full support added by Ian Lance Taylor, ian@cygnus.com.
}
bfd_boolean
-_bfd_ecoff_no_long_sections (abfd, enable)
- bfd *abfd;
- int enable;
+_bfd_ecoff_no_long_sections (bfd *abfd, int enable)
{
(void) abfd;
(void) enable;
/* Routines to link ECOFF debugging information.
Copyright 1993, 1994, 1995, 1996, 1997, 1999, 2000, 2001, 2002, 2003,
- 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
+ 2004, 2005, 2006, 2007, 2008, 2009, 2012 Free Software Foundation, Inc.
Written by Ian Lance Taylor, Cygnus Support, <ian@cygnus.com>.
This file is part of BFD, the Binary File Descriptor library.
#include "libcoff.h"
#include "libecoff.h"
\f
-static bfd_boolean ecoff_add_bytes
- PARAMS ((char **buf, char **bufend, size_t need));
-static struct bfd_hash_entry *string_hash_newfunc
- PARAMS ((struct bfd_hash_entry *, struct bfd_hash_table *,
- const char *));
-static void ecoff_align_debug
- PARAMS ((bfd *abfd, struct ecoff_debug_info *debug,
- const struct ecoff_debug_swap *swap));
-static bfd_boolean ecoff_write_symhdr
- PARAMS ((bfd *, struct ecoff_debug_info *, const struct ecoff_debug_swap *,
- file_ptr where));
-static int cmp_fdrtab_entry
- PARAMS ((const PTR, const PTR));
-static bfd_boolean mk_fdrtab
- PARAMS ((bfd *, struct ecoff_debug_info * const,
- const struct ecoff_debug_swap * const, struct ecoff_find_line *));
-static long fdrtab_lookup
- PARAMS ((struct ecoff_find_line *, bfd_vma));
-static bfd_boolean lookup_line
- PARAMS ((bfd *, struct ecoff_debug_info * const,
- const struct ecoff_debug_swap * const, struct ecoff_find_line *));
-\f
/* Routines to swap auxiliary information in and out. I am assuming
that the auxiliary information format is always going to be target
independent. */
info comes from the file header record (fh-fBigendian). */
void
-_bfd_ecoff_swap_tir_in (bigend, ext_copy, intern)
- int bigend;
- const struct tir_ext *ext_copy;
- TIR *intern;
+_bfd_ecoff_swap_tir_in (int bigend, const struct tir_ext *ext_copy,
+ TIR *intern)
{
struct tir_ext ext[1];
*ext = *ext_copy; /* Make it reasonable to do in-place. */
/* now the fun stuff... */
- if (bigend) {
- intern->fBitfield = 0 != (ext->t_bits1[0] & TIR_BITS1_FBITFIELD_BIG);
- intern->continued = 0 != (ext->t_bits1[0] & TIR_BITS1_CONTINUED_BIG);
- intern->bt = (ext->t_bits1[0] & TIR_BITS1_BT_BIG)
- >> TIR_BITS1_BT_SH_BIG;
- intern->tq4 = (ext->t_tq45[0] & TIR_BITS_TQ4_BIG)
- >> TIR_BITS_TQ4_SH_BIG;
- intern->tq5 = (ext->t_tq45[0] & TIR_BITS_TQ5_BIG)
- >> TIR_BITS_TQ5_SH_BIG;
- intern->tq0 = (ext->t_tq01[0] & TIR_BITS_TQ0_BIG)
- >> TIR_BITS_TQ0_SH_BIG;
- intern->tq1 = (ext->t_tq01[0] & TIR_BITS_TQ1_BIG)
- >> TIR_BITS_TQ1_SH_BIG;
- intern->tq2 = (ext->t_tq23[0] & TIR_BITS_TQ2_BIG)
- >> TIR_BITS_TQ2_SH_BIG;
- intern->tq3 = (ext->t_tq23[0] & TIR_BITS_TQ3_BIG)
- >> TIR_BITS_TQ3_SH_BIG;
- } else {
- intern->fBitfield = 0 != (ext->t_bits1[0] & TIR_BITS1_FBITFIELD_LITTLE);
- intern->continued = 0 != (ext->t_bits1[0] & TIR_BITS1_CONTINUED_LITTLE);
- intern->bt = (ext->t_bits1[0] & TIR_BITS1_BT_LITTLE)
- >> TIR_BITS1_BT_SH_LITTLE;
- intern->tq4 = (ext->t_tq45[0] & TIR_BITS_TQ4_LITTLE)
- >> TIR_BITS_TQ4_SH_LITTLE;
- intern->tq5 = (ext->t_tq45[0] & TIR_BITS_TQ5_LITTLE)
- >> TIR_BITS_TQ5_SH_LITTLE;
- intern->tq0 = (ext->t_tq01[0] & TIR_BITS_TQ0_LITTLE)
- >> TIR_BITS_TQ0_SH_LITTLE;
- intern->tq1 = (ext->t_tq01[0] & TIR_BITS_TQ1_LITTLE)
- >> TIR_BITS_TQ1_SH_LITTLE;
- intern->tq2 = (ext->t_tq23[0] & TIR_BITS_TQ2_LITTLE)
- >> TIR_BITS_TQ2_SH_LITTLE;
- intern->tq3 = (ext->t_tq23[0] & TIR_BITS_TQ3_LITTLE)
- >> TIR_BITS_TQ3_SH_LITTLE;
- }
+ if (bigend)
+ {
+ intern->fBitfield = 0 != (ext->t_bits1[0] & TIR_BITS1_FBITFIELD_BIG);
+ intern->continued = 0 != (ext->t_bits1[0] & TIR_BITS1_CONTINUED_BIG);
+ intern->bt = (ext->t_bits1[0] & TIR_BITS1_BT_BIG)
+ >> TIR_BITS1_BT_SH_BIG;
+ intern->tq4 = (ext->t_tq45[0] & TIR_BITS_TQ4_BIG)
+ >> TIR_BITS_TQ4_SH_BIG;
+ intern->tq5 = (ext->t_tq45[0] & TIR_BITS_TQ5_BIG)
+ >> TIR_BITS_TQ5_SH_BIG;
+ intern->tq0 = (ext->t_tq01[0] & TIR_BITS_TQ0_BIG)
+ >> TIR_BITS_TQ0_SH_BIG;
+ intern->tq1 = (ext->t_tq01[0] & TIR_BITS_TQ1_BIG)
+ >> TIR_BITS_TQ1_SH_BIG;
+ intern->tq2 = (ext->t_tq23[0] & TIR_BITS_TQ2_BIG)
+ >> TIR_BITS_TQ2_SH_BIG;
+ intern->tq3 = (ext->t_tq23[0] & TIR_BITS_TQ3_BIG)
+ >> TIR_BITS_TQ3_SH_BIG;
+ }
+ else
+ {
+ intern->fBitfield = 0 != (ext->t_bits1[0] & TIR_BITS1_FBITFIELD_LITTLE);
+ intern->continued = 0 != (ext->t_bits1[0] & TIR_BITS1_CONTINUED_LITTLE);
+ intern->bt = (ext->t_bits1[0] & TIR_BITS1_BT_LITTLE)
+ >> TIR_BITS1_BT_SH_LITTLE;
+ intern->tq4 = (ext->t_tq45[0] & TIR_BITS_TQ4_LITTLE)
+ >> TIR_BITS_TQ4_SH_LITTLE;
+ intern->tq5 = (ext->t_tq45[0] & TIR_BITS_TQ5_LITTLE)
+ >> TIR_BITS_TQ5_SH_LITTLE;
+ intern->tq0 = (ext->t_tq01[0] & TIR_BITS_TQ0_LITTLE)
+ >> TIR_BITS_TQ0_SH_LITTLE;
+ intern->tq1 = (ext->t_tq01[0] & TIR_BITS_TQ1_LITTLE)
+ >> TIR_BITS_TQ1_SH_LITTLE;
+ intern->tq2 = (ext->t_tq23[0] & TIR_BITS_TQ2_LITTLE)
+ >> TIR_BITS_TQ2_SH_LITTLE;
+ intern->tq3 = (ext->t_tq23[0] & TIR_BITS_TQ3_LITTLE)
+ >> TIR_BITS_TQ3_SH_LITTLE;
+ }
#ifdef TEST
if (memcmp ((char *)ext, (char *)intern, sizeof (*intern)) != 0)
info comes from the file header record (fh-fBigendian). */
void
-_bfd_ecoff_swap_tir_out (bigend, intern_copy, ext)
- int bigend;
- const TIR *intern_copy;
- struct tir_ext *ext;
+_bfd_ecoff_swap_tir_out (int bigend,
+ const TIR *intern_copy,
+ struct tir_ext *ext)
{
TIR intern[1];
*intern = *intern_copy; /* Make it reasonable to do in-place. */
/* now the fun stuff... */
- if (bigend) {
- ext->t_bits1[0] = ((intern->fBitfield ? TIR_BITS1_FBITFIELD_BIG : 0)
+ if (bigend)
+ {
+ ext->t_bits1[0] = ((intern->fBitfield ? TIR_BITS1_FBITFIELD_BIG : 0)
| (intern->continued ? TIR_BITS1_CONTINUED_BIG : 0)
| ((intern->bt << TIR_BITS1_BT_SH_BIG)
& TIR_BITS1_BT_BIG));
- ext->t_tq45[0] = (((intern->tq4 << TIR_BITS_TQ4_SH_BIG)
+ ext->t_tq45[0] = (((intern->tq4 << TIR_BITS_TQ4_SH_BIG)
& TIR_BITS_TQ4_BIG)
| ((intern->tq5 << TIR_BITS_TQ5_SH_BIG)
& TIR_BITS_TQ5_BIG));
- ext->t_tq01[0] = (((intern->tq0 << TIR_BITS_TQ0_SH_BIG)
+ ext->t_tq01[0] = (((intern->tq0 << TIR_BITS_TQ0_SH_BIG)
& TIR_BITS_TQ0_BIG)
| ((intern->tq1 << TIR_BITS_TQ1_SH_BIG)
& TIR_BITS_TQ1_BIG));
- ext->t_tq23[0] = (((intern->tq2 << TIR_BITS_TQ2_SH_BIG)
+ ext->t_tq23[0] = (((intern->tq2 << TIR_BITS_TQ2_SH_BIG)
& TIR_BITS_TQ2_BIG)
| ((intern->tq3 << TIR_BITS_TQ3_SH_BIG)
& TIR_BITS_TQ3_BIG));
- } else {
- ext->t_bits1[0] = ((intern->fBitfield ? TIR_BITS1_FBITFIELD_LITTLE : 0)
+ }
+ else
+ {
+ ext->t_bits1[0] = ((intern->fBitfield ? TIR_BITS1_FBITFIELD_LITTLE : 0)
| (intern->continued ? TIR_BITS1_CONTINUED_LITTLE : 0)
| ((intern->bt << TIR_BITS1_BT_SH_LITTLE)
& TIR_BITS1_BT_LITTLE));
- ext->t_tq45[0] = (((intern->tq4 << TIR_BITS_TQ4_SH_LITTLE)
+ ext->t_tq45[0] = (((intern->tq4 << TIR_BITS_TQ4_SH_LITTLE)
& TIR_BITS_TQ4_LITTLE)
| ((intern->tq5 << TIR_BITS_TQ5_SH_LITTLE)
& TIR_BITS_TQ5_LITTLE));
- ext->t_tq01[0] = (((intern->tq0 << TIR_BITS_TQ0_SH_LITTLE)
+ ext->t_tq01[0] = (((intern->tq0 << TIR_BITS_TQ0_SH_LITTLE)
& TIR_BITS_TQ0_LITTLE)
| ((intern->tq1 << TIR_BITS_TQ1_SH_LITTLE)
& TIR_BITS_TQ1_LITTLE));
- ext->t_tq23[0] = (((intern->tq2 << TIR_BITS_TQ2_SH_LITTLE)
+ ext->t_tq23[0] = (((intern->tq2 << TIR_BITS_TQ2_SH_LITTLE)
& TIR_BITS_TQ2_LITTLE)
| ((intern->tq3 << TIR_BITS_TQ3_SH_LITTLE)
& TIR_BITS_TQ3_LITTLE));
- }
+ }
#ifdef TEST
if (memcmp ((char *)ext, (char *)intern, sizeof (*intern)) != 0)
big-endian or little-endian format.*/
void
-_bfd_ecoff_swap_rndx_in (bigend, ext_copy, intern)
- int bigend;
- const struct rndx_ext *ext_copy;
- RNDXR *intern;
+_bfd_ecoff_swap_rndx_in (int bigend,
+ const struct rndx_ext *ext_copy,
+ RNDXR *intern)
{
struct rndx_ext ext[1];
*ext = *ext_copy; /* Make it reasonable to do in-place. */
/* now the fun stuff... */
- if (bigend) {
- intern->rfd = (ext->r_bits[0] << RNDX_BITS0_RFD_SH_LEFT_BIG)
+ if (bigend)
+ {
+ intern->rfd = (ext->r_bits[0] << RNDX_BITS0_RFD_SH_LEFT_BIG)
| ((ext->r_bits[1] & RNDX_BITS1_RFD_BIG)
>> RNDX_BITS1_RFD_SH_BIG);
- intern->index = ((ext->r_bits[1] & RNDX_BITS1_INDEX_BIG)
+ intern->index = ((ext->r_bits[1] & RNDX_BITS1_INDEX_BIG)
<< RNDX_BITS1_INDEX_SH_LEFT_BIG)
| (ext->r_bits[2] << RNDX_BITS2_INDEX_SH_LEFT_BIG)
| (ext->r_bits[3] << RNDX_BITS3_INDEX_SH_LEFT_BIG);
- } else {
- intern->rfd = (ext->r_bits[0] << RNDX_BITS0_RFD_SH_LEFT_LITTLE)
+ }
+ else
+ {
+ intern->rfd = (ext->r_bits[0] << RNDX_BITS0_RFD_SH_LEFT_LITTLE)
| ((ext->r_bits[1] & RNDX_BITS1_RFD_LITTLE)
<< RNDX_BITS1_RFD_SH_LEFT_LITTLE);
- intern->index = ((ext->r_bits[1] & RNDX_BITS1_INDEX_LITTLE)
+ intern->index = ((ext->r_bits[1] & RNDX_BITS1_INDEX_LITTLE)
>> RNDX_BITS1_INDEX_SH_LITTLE)
| (ext->r_bits[2] << RNDX_BITS2_INDEX_SH_LEFT_LITTLE)
| ((unsigned int) ext->r_bits[3]
<< RNDX_BITS3_INDEX_SH_LEFT_LITTLE);
- }
+ }
#ifdef TEST
if (memcmp ((char *)ext, (char *)intern, sizeof (*intern)) != 0)
big-endian or little-endian format.*/
void
-_bfd_ecoff_swap_rndx_out (bigend, intern_copy, ext)
- int bigend;
- const RNDXR *intern_copy;
- struct rndx_ext *ext;
+_bfd_ecoff_swap_rndx_out (int bigend,
+ const RNDXR *intern_copy,
+ struct rndx_ext *ext)
{
RNDXR intern[1];
*intern = *intern_copy; /* Make it reasonable to do in-place. */
/* now the fun stuff... */
- if (bigend) {
- ext->r_bits[0] = intern->rfd >> RNDX_BITS0_RFD_SH_LEFT_BIG;
- ext->r_bits[1] = (((intern->rfd << RNDX_BITS1_RFD_SH_BIG)
+ if (bigend)
+ {
+ ext->r_bits[0] = intern->rfd >> RNDX_BITS0_RFD_SH_LEFT_BIG;
+ ext->r_bits[1] = (((intern->rfd << RNDX_BITS1_RFD_SH_BIG)
& RNDX_BITS1_RFD_BIG)
| ((intern->index >> RNDX_BITS1_INDEX_SH_LEFT_BIG)
& RNDX_BITS1_INDEX_BIG));
- ext->r_bits[2] = intern->index >> RNDX_BITS2_INDEX_SH_LEFT_BIG;
- ext->r_bits[3] = intern->index >> RNDX_BITS3_INDEX_SH_LEFT_BIG;
- } else {
- ext->r_bits[0] = intern->rfd >> RNDX_BITS0_RFD_SH_LEFT_LITTLE;
- ext->r_bits[1] = (((intern->rfd >> RNDX_BITS1_RFD_SH_LEFT_LITTLE)
+ ext->r_bits[2] = intern->index >> RNDX_BITS2_INDEX_SH_LEFT_BIG;
+ ext->r_bits[3] = intern->index >> RNDX_BITS3_INDEX_SH_LEFT_BIG;
+ }
+ else
+ {
+ ext->r_bits[0] = intern->rfd >> RNDX_BITS0_RFD_SH_LEFT_LITTLE;
+ ext->r_bits[1] = (((intern->rfd >> RNDX_BITS1_RFD_SH_LEFT_LITTLE)
& RNDX_BITS1_RFD_LITTLE)
| ((intern->index << RNDX_BITS1_INDEX_SH_LITTLE)
& RNDX_BITS1_INDEX_LITTLE));
- ext->r_bits[2] = intern->index >> RNDX_BITS2_INDEX_SH_LEFT_LITTLE;
- ext->r_bits[3] = intern->index >> RNDX_BITS3_INDEX_SH_LEFT_LITTLE;
- }
+ ext->r_bits[2] = intern->index >> RNDX_BITS2_INDEX_SH_LEFT_LITTLE;
+ ext->r_bits[3] = intern->index >> RNDX_BITS3_INDEX_SH_LEFT_LITTLE;
+ }
#ifdef TEST
if (memcmp ((char *)ext, (char *)intern, sizeof (*intern)) != 0)
/* Add bytes to a buffer. Return success. */
static bfd_boolean
-ecoff_add_bytes (buf, bufend, need)
- char **buf;
- char **bufend;
- size_t need;
+ecoff_add_bytes (char **buf, char **bufend, size_t need)
{
size_t have;
size_t want;
/* Routine to create an entry in a string hash table. */
static struct bfd_hash_entry *
-string_hash_newfunc (entry, table, string)
- struct bfd_hash_entry *entry;
- struct bfd_hash_table *table;
- const char *string;
+string_hash_newfunc (struct bfd_hash_entry *entry,
+ struct bfd_hash_table *table,
+ const char *string)
{
struct string_hash_entry *ret = (struct string_hash_entry *) entry;
file_ptr offset;
} file;
/* The data to be written out. */
- PTR memory;
+ void * memory;
} u;
};
/* Add a file entry to a shuffle list. */
-static bfd_boolean add_file_shuffle
- PARAMS ((struct accumulate *, struct shuffle **, struct shuffle **,
- bfd *, file_ptr, unsigned long));
-
static bfd_boolean
-add_file_shuffle (ainfo, head, tail, input_bfd, offset, size)
- struct accumulate *ainfo;
- struct shuffle **head;
- struct shuffle **tail;
- bfd *input_bfd;
- file_ptr offset;
- unsigned long size;
+add_file_shuffle (struct accumulate *ainfo,
+ struct shuffle **head,
+ struct shuffle **tail,
+ bfd *input_bfd,
+ file_ptr offset,
+ unsigned long size)
{
struct shuffle *n;
/* Add a memory entry to a shuffle list. */
-static bfd_boolean add_memory_shuffle
- PARAMS ((struct accumulate *, struct shuffle **head, struct shuffle **tail,
- bfd_byte *data, unsigned long size));
-
static bfd_boolean
-add_memory_shuffle (ainfo, head, tail, data, size)
- struct accumulate *ainfo;
- struct shuffle **head;
- struct shuffle **tail;
- bfd_byte *data;
- unsigned long size;
+add_memory_shuffle (struct accumulate *ainfo,
+ struct shuffle **head,
+ struct shuffle **tail,
+ bfd_byte *data,
+ unsigned long size)
{
struct shuffle *n;
n->next = NULL;
n->size = size;
n->filep = FALSE;
- n->u.memory = (PTR) data;
+ n->u.memory = data;
if (*head == (struct shuffle *) NULL)
*head = n;
if (*tail != (struct shuffle *) NULL)
/* Initialize the FDR hash table. This returns a handle which is then
passed in to bfd_ecoff_debug_accumulate, et. al. */
-PTR
-bfd_ecoff_debug_init (output_bfd, output_debug, output_swap, info)
- bfd *output_bfd ATTRIBUTE_UNUSED;
- struct ecoff_debug_info *output_debug;
- const struct ecoff_debug_swap *output_swap ATTRIBUTE_UNUSED;
- struct bfd_link_info *info;
+void *
+bfd_ecoff_debug_init (bfd *output_bfd ATTRIBUTE_UNUSED,
+ struct ecoff_debug_info *output_debug,
+ const struct ecoff_debug_swap *output_swap ATTRIBUTE_UNUSED,
+ struct bfd_link_info *info)
{
struct accumulate *ainfo;
bfd_size_type amt = sizeof (struct accumulate);
return NULL;
}
- return (PTR) ainfo;
+ return ainfo;
}
/* Free the accumulated debugging information. */
void
-bfd_ecoff_debug_free (handle, output_bfd, output_debug, output_swap, info)
- PTR handle;
- bfd *output_bfd ATTRIBUTE_UNUSED;
- struct ecoff_debug_info *output_debug ATTRIBUTE_UNUSED;
- const struct ecoff_debug_swap *output_swap ATTRIBUTE_UNUSED;
- struct bfd_link_info *info;
+bfd_ecoff_debug_free (void * handle,
+ bfd *output_bfd ATTRIBUTE_UNUSED,
+ struct ecoff_debug_info *output_debug ATTRIBUTE_UNUSED,
+ const struct ecoff_debug_swap *output_swap ATTRIBUTE_UNUSED,
+ struct bfd_link_info *info)
{
struct accumulate *ainfo = (struct accumulate *) handle;
bfd_ecoff_debug_init. */
bfd_boolean
-bfd_ecoff_debug_accumulate (handle, output_bfd, output_debug, output_swap,
- input_bfd, input_debug, input_swap,
- info)
- PTR handle;
- bfd *output_bfd;
- struct ecoff_debug_info *output_debug;
- const struct ecoff_debug_swap *output_swap;
- bfd *input_bfd;
- struct ecoff_debug_info *input_debug;
- const struct ecoff_debug_swap *input_swap;
- struct bfd_link_info *info;
+bfd_ecoff_debug_accumulate (void * handle,
+ bfd *output_bfd,
+ struct ecoff_debug_info *output_debug,
+ const struct ecoff_debug_swap *output_swap,
+ bfd *input_bfd,
+ struct ecoff_debug_info *input_debug,
+ const struct ecoff_debug_swap *input_swap,
+ struct bfd_link_info *info)
{
struct accumulate *ainfo = (struct accumulate *) handle;
- void (* const swap_sym_in) PARAMS ((bfd *, PTR, SYMR *))
+ void (* const swap_sym_in) (bfd *, void *, SYMR *)
= input_swap->swap_sym_in;
- void (* const swap_rfd_in) PARAMS ((bfd *, PTR, RFDT *))
+ void (* const swap_rfd_in) (bfd *, void *, RFDT *)
= input_swap->swap_rfd_in;
- void (* const swap_sym_out) PARAMS ((bfd *, const SYMR *, PTR))
+ void (* const swap_sym_out) (bfd *, const SYMR *, void *)
= output_swap->swap_sym_out;
- void (* const swap_fdr_out) PARAMS ((bfd *, const FDR *, PTR))
+ void (* const swap_fdr_out) (bfd *, const FDR *, void *)
= output_swap->swap_fdr_out;
- void (* const swap_rfd_out) PARAMS ((bfd *, const RFDT *, PTR))
+ void (* const swap_rfd_out) (bfd *, const RFDT *, void *)
= output_swap->swap_rfd_out;
bfd_size_type external_pdr_size = output_swap->external_pdr_size;
bfd_size_type external_sym_size = output_swap->external_sym_size;
/* Use section_adjust to hold the value to add to a symbol in a
particular section. */
- memset ((PTR) section_adjust, 0, sizeof section_adjust);
+ memset (section_adjust, 0, sizeof section_adjust);
#define SET(name, indx) \
sec = bfd_get_section_by_name (input_bfd, name); \
if (input_debug->fdr != (FDR *) NULL)
fdr = *(FDR *) fdr_ptr;
else
- (*input_swap->swap_fdr_in) (input_bfd, (PTR) fdr_ptr, &fdr);
+ (*input_swap->swap_fdr_in) (input_bfd, fdr_ptr, &fdr);
/* See if this FDR can be merged with an existing one. */
if (fdr.cbLine == 0 && fdr.rss != -1 && fdr.fMerge)
if (fh->val != -1)
{
input_debug->ifdmap[i] = fh->val;
- (*swap_rfd_out) (output_bfd, input_debug->ifdmap + i,
- (PTR) rfd_out);
+ (*swap_rfd_out) (output_bfd, input_debug->ifdmap + i, rfd_out);
/* Don't copy this FDR. */
continue;
}
input_debug->ifdmap[i] = output_symhdr->ifdMax + copied;
- (*swap_rfd_out) (output_bfd, input_debug->ifdmap + i, (PTR) rfd_out);
+ (*swap_rfd_out) (output_bfd, input_debug->ifdmap + i, rfd_out);
++copied;
}
{
RFDT rfd;
- (*swap_rfd_in) (input_bfd, (PTR) rfd_in, &rfd);
+ (*swap_rfd_in) (input_bfd, rfd_in, &rfd);
BFD_ASSERT (rfd >= 0 && rfd < input_symhdr->ifdMax);
rfd = input_debug->ifdmap[rfd];
- (*swap_rfd_out) (output_bfd, &rfd, (PTR) rfd_out);
+ (*swap_rfd_out) (output_bfd, &rfd, rfd_out);
rfd_out += external_rfd_size;
}
if (input_debug->fdr != (FDR *) NULL)
fdr = *(FDR *) fdr_ptr;
else
- (*input_swap->swap_fdr_in) (input_bfd, (PTR) fdr_ptr, &fdr);
+ (*input_swap->swap_fdr_in) (input_bfd, fdr_ptr, &fdr);
/* FIXME: It is conceivable that this FDR points to the .init or
.fini section, in which case this will not do the right
{
SYMR internal_sym;
- (*swap_sym_in) (input_bfd, (PTR) lraw_src, &internal_sym);
+ (*swap_sym_in) (input_bfd, lraw_src, &internal_sym);
BFD_ASSERT (internal_sym.sc != scCommon
&& internal_sym.sc != scSCommon);
{
PDR pdr;
- (*input_swap->swap_pdr_in) (input_bfd, (PTR) in, &pdr);
- (*output_swap->swap_pdr_out) (output_bfd, &pdr, (PTR) out);
+ (*input_swap->swap_pdr_in) (input_bfd, in, &pdr);
+ (*output_swap->swap_pdr_out) (output_bfd, &pdr, out);
}
/* Swap over the optimization information. */
{
OPTR opt;
- (*input_swap->swap_opt_in) (input_bfd, (PTR) in, &opt);
- (*output_swap->swap_opt_out) (output_bfd, &opt, (PTR) out);
+ (*input_swap->swap_opt_in) (input_bfd, in, &opt);
+ (*output_swap->swap_opt_out) (output_bfd, &opt, out);
}
}
/* Add a string to the debugging information we are accumulating.
Return the offset from the fdr string base. */
-static long ecoff_add_string
- PARAMS ((struct accumulate *, struct bfd_link_info *,
- struct ecoff_debug_info *, FDR *fdr, const char *string));
-
static long
-ecoff_add_string (ainfo, info, debug, fdr, string)
- struct accumulate *ainfo;
- struct bfd_link_info *info;
- struct ecoff_debug_info *debug;
- FDR *fdr;
- const char *string;
+ecoff_add_string (struct accumulate *ainfo,
+ struct bfd_link_info *info,
+ struct ecoff_debug_info *debug,
+ FDR *fdr,
+ const char *string)
{
HDRR *symhdr;
size_t len;
/* Add debugging information from a non-ECOFF file. */
bfd_boolean
-bfd_ecoff_debug_accumulate_other (handle, output_bfd, output_debug,
- output_swap, input_bfd, info)
- PTR handle;
- bfd *output_bfd;
- struct ecoff_debug_info *output_debug;
- const struct ecoff_debug_swap *output_swap;
- bfd *input_bfd;
- struct bfd_link_info *info;
+bfd_ecoff_debug_accumulate_other (void * handle,
+ bfd *output_bfd,
+ struct ecoff_debug_info *output_debug,
+ const struct ecoff_debug_swap *output_swap,
+ bfd *input_bfd,
+ struct bfd_link_info *info)
{
struct accumulate *ainfo = (struct accumulate *) handle;
- void (* const swap_sym_out) PARAMS ((bfd *, const SYMR *, PTR))
+ void (* const swap_sym_out) (bfd *, const SYMR *, void *)
= output_swap->swap_sym_out;
HDRR *output_symhdr = &output_debug->symbolic_header;
FDR fdr;
asymbol **sym_end;
long symsize;
long symcount;
- PTR external_fdr;
+ void * external_fdr;
- memset ((PTR) &fdr, 0, sizeof fdr);
+ memset (&fdr, 0, sizeof fdr);
sec = bfd_get_section_by_name (input_bfd, ".text");
if (sec != NULL)
for (sym_ptr = symbols; sym_ptr != sym_end; sym_ptr++)
{
SYMR internal_sym;
- PTR external_sym;
+ void * external_sym;
if (((*sym_ptr)->flags & BSF_EXPORT) != 0)
continue;
- memset ((PTR) &internal_sym, 0, sizeof internal_sym);
+ memset (&internal_sym, 0, sizeof internal_sym);
internal_sym.iss = ecoff_add_string (ainfo, info, output_debug, &fdr,
(*sym_ptr)->name);
internal_sym.sc = scUndefined;
internal_sym.index = indexNil;
- external_sym = (PTR) objalloc_alloc (ainfo->memory,
- output_swap->external_sym_size);
+ external_sym = objalloc_alloc (ainfo->memory,
+ output_swap->external_sym_size);
if (!external_sym)
{
bfd_set_error (bfd_error_no_memory);
++output_symhdr->isymMax;
}
- bfd_release (output_bfd, (PTR) symbols);
+ bfd_release (output_bfd, symbols);
/* Leave everything else in the FDR zeroed out. This will cause
the lang field to be langC. The fBigendian field will
indicate little endian format, but it doesn't matter because
it only applies to aux fields and there are none. */
- external_fdr = (PTR) objalloc_alloc (ainfo->memory,
- output_swap->external_fdr_size);
+ external_fdr = objalloc_alloc (ainfo->memory,
+ output_swap->external_fdr_size);
if (!external_fdr)
{
bfd_set_error (bfd_error_no_memory);
this interface, so that must be changed to do something else. */
bfd_boolean
-bfd_ecoff_debug_externals (abfd, debug, swap, relocatable, get_extr,
- set_index)
- bfd *abfd;
- struct ecoff_debug_info *debug;
- const struct ecoff_debug_swap *swap;
- bfd_boolean relocatable;
- bfd_boolean (*get_extr) PARAMS ((asymbol *, EXTR *));
- void (*set_index) PARAMS ((asymbol *, bfd_size_type));
+bfd_ecoff_debug_externals (bfd *abfd,
+ struct ecoff_debug_info *debug,
+ const struct ecoff_debug_swap *swap,
+ bfd_boolean relocatable,
+ bfd_boolean (*get_extr) (asymbol *, EXTR *),
+ void (*set_index) (asymbol *, bfd_size_type))
{
HDRR * const symhdr = &debug->symbolic_header;
asymbol **sym_ptr_ptr;
/* Add a single external symbol to the debugging information. */
bfd_boolean
-bfd_ecoff_debug_one_external (abfd, debug, swap, name, esym)
- bfd *abfd;
- struct ecoff_debug_info *debug;
- const struct ecoff_debug_swap *swap;
- const char *name;
- EXTR *esym;
+bfd_ecoff_debug_one_external (bfd *abfd,
+ struct ecoff_debug_info *debug,
+ const struct ecoff_debug_swap *swap,
+ const char *name,
+ EXTR *esym)
{
const bfd_size_type external_ext_size = swap->external_ext_size;
- void (* const swap_ext_out) PARAMS ((bfd *, const EXTR *, PTR))
+ void (* const swap_ext_out) (bfd *, const EXTR *, void *)
= swap->swap_ext_out;
HDRR * const symhdr = &debug->symbolic_header;
size_t namelen;
/* Align the ECOFF debugging information. */
static void
-ecoff_align_debug (abfd, debug, swap)
- bfd *abfd ATTRIBUTE_UNUSED;
- struct ecoff_debug_info *debug;
- const struct ecoff_debug_swap *swap;
+ecoff_align_debug (bfd *abfd ATTRIBUTE_UNUSED,
+ struct ecoff_debug_info *debug,
+ const struct ecoff_debug_swap *swap)
{
HDRR * const symhdr = &debug->symbolic_header;
bfd_size_type debug_align, aux_align, rfd_align;
if (add != debug_align)
{
if (debug->line != (unsigned char *) NULL)
- memset ((PTR) (debug->line + symhdr->cbLine), 0, add);
+ memset ((debug->line + symhdr->cbLine), 0, add);
symhdr->cbLine += add;
}
if (add != debug_align)
{
if (debug->ss != (char *) NULL)
- memset ((PTR) (debug->ss + symhdr->issMax), 0, add);
+ memset ((debug->ss + symhdr->issMax), 0, add);
symhdr->issMax += add;
}
if (add != debug_align)
{
if (debug->ssext != (char *) NULL)
- memset ((PTR) (debug->ssext + symhdr->issExtMax), 0, add);
+ memset ((debug->ssext + symhdr->issExtMax), 0, add);
symhdr->issExtMax += add;
}
if (add != aux_align)
{
if (debug->external_aux != (union aux_ext *) NULL)
- memset ((PTR) (debug->external_aux + symhdr->iauxMax), 0,
+ memset ((debug->external_aux + symhdr->iauxMax), 0,
add * sizeof (union aux_ext));
symhdr->iauxMax += add;
}
add = rfd_align - (symhdr->crfd & (rfd_align - 1));
if (add != rfd_align)
{
- if (debug->external_rfd != (PTR) NULL)
- memset ((PTR) ((char *) debug->external_rfd
- + symhdr->crfd * swap->external_rfd_size),
+ if (debug->external_rfd != NULL)
+ memset (((char *) debug->external_rfd
+ + symhdr->crfd * swap->external_rfd_size),
0, (size_t) (add * swap->external_rfd_size));
symhdr->crfd += add;
}
/* Return the size required by the ECOFF debugging information. */
bfd_size_type
-bfd_ecoff_debug_size (abfd, debug, swap)
- bfd *abfd;
- struct ecoff_debug_info *debug;
- const struct ecoff_debug_swap *swap;
+bfd_ecoff_debug_size (bfd *abfd,
+ struct ecoff_debug_info *debug,
+ const struct ecoff_debug_swap *swap)
{
bfd_size_type tot;
correctly. */
static bfd_boolean
-ecoff_write_symhdr (abfd, debug, swap, where)
- bfd *abfd;
- struct ecoff_debug_info *debug;
- const struct ecoff_debug_swap *swap;
- file_ptr where;
+ecoff_write_symhdr (bfd *abfd,
+ struct ecoff_debug_info *debug,
+ const struct ecoff_debug_swap *swap,
+ file_ptr where)
{
HDRR * const symhdr = &debug->symbolic_header;
char *buff = NULL;
symbolic header. */
bfd_boolean
-bfd_ecoff_write_debug (abfd, debug, swap, where)
- bfd *abfd;
- struct ecoff_debug_info *debug;
- const struct ecoff_debug_swap *swap;
- file_ptr where;
+bfd_ecoff_write_debug (bfd *abfd,
+ struct ecoff_debug_info *debug,
+ const struct ecoff_debug_swap *swap,
+ file_ptr where)
{
HDRR * const symhdr = &debug->symbolic_header;
#define WRITE(ptr, count, size, offset) \
BFD_ASSERT (symhdr->offset == 0 \
|| (bfd_vma) bfd_tell (abfd) == symhdr->offset); \
- if (bfd_bwrite ((PTR) debug->ptr, (bfd_size_type) size * symhdr->count, abfd)\
+ if (bfd_bwrite (debug->ptr, (bfd_size_type) size * symhdr->count, abfd)\
!= size * symhdr->count) \
return FALSE;
/* Write out a shuffle list. */
-static bfd_boolean ecoff_write_shuffle
- PARAMS ((bfd *, const struct ecoff_debug_swap *, struct shuffle *,
- PTR space));
static bfd_boolean
-ecoff_write_shuffle (abfd, swap, shuffle, space)
- bfd *abfd;
- const struct ecoff_debug_swap *swap;
- struct shuffle *shuffle;
- PTR space;
+ecoff_write_shuffle (bfd *abfd,
+ const struct ecoff_debug_swap *swap,
+ struct shuffle *shuffle,
+ void * space)
{
- register struct shuffle *l;
+ struct shuffle *l;
unsigned long total;
total = 0;
if (s == NULL && i != 0)
return FALSE;
- if (bfd_bwrite ((PTR) s, (bfd_size_type) i, abfd) != i)
+ if (bfd_bwrite (s, (bfd_size_type) i, abfd) != i)
{
free (s);
return FALSE;
information. */
bfd_boolean
-bfd_ecoff_write_accumulated_debug (handle, abfd, debug, swap, info, where)
- PTR handle;
- bfd *abfd;
- struct ecoff_debug_info *debug;
- const struct ecoff_debug_swap *swap;
- struct bfd_link_info *info;
- file_ptr where;
+bfd_ecoff_write_accumulated_debug (void * handle,
+ bfd *abfd,
+ struct ecoff_debug_info *debug,
+ const struct ecoff_debug_swap *swap,
+ struct bfd_link_info *info,
+ file_ptr where)
{
struct accumulate *ainfo = (struct accumulate *) handle;
- PTR space = NULL;
+ void * space = NULL;
bfd_size_type amt;
if (! ecoff_write_symhdr (abfd, debug, swap, where))
goto error_return;
amt = ainfo->largest_file_shuffle;
- space = (PTR) bfd_malloc (amt);
+ space = bfd_malloc (amt);
if (space == NULL && ainfo->largest_file_shuffle != 0)
goto error_return;
BFD_ASSERT (ainfo->ss == (struct shuffle *) NULL);
null = 0;
- if (bfd_bwrite ((PTR) &null, (bfd_size_type) 1, abfd) != 1)
+ if (bfd_bwrite (&null, (bfd_size_type) 1, abfd) != 1)
goto error_return;
total = 1;
BFD_ASSERT (ainfo->ss_hash == NULL || ainfo->ss_hash->val == 1);
len = strlen (sh->root.string);
amt = len + 1;
- if (bfd_bwrite ((PTR) sh->root.string, amt, abfd) != amt)
+ if (bfd_bwrite (sh->root.string, amt, abfd) != amt)
goto error_return;
total += len + 1;
}
if (s == NULL && i != 0)
goto error_return;
- if (bfd_bwrite ((PTR) s, (bfd_size_type) i, abfd) != i)
+ if (bfd_bwrite (s, (bfd_size_type) i, abfd) != i)
{
free (s);
goto error_return;
if (s == NULL && i != 0)
goto error_return;
- if (bfd_bwrite ((PTR) s, (bfd_size_type) i, abfd) != i)
+ if (bfd_bwrite (s, (bfd_size_type) i, abfd) != i)
{
free (s);
goto error_return;
/* Compare FDR entries. This is called via qsort. */
static int
-cmp_fdrtab_entry (leftp, rightp)
- const PTR leftp;
- const PTR rightp;
+cmp_fdrtab_entry (const void * leftp, const void * rightp)
{
const struct ecoff_fdrtab_entry *lp =
(const struct ecoff_fdrtab_entry *) leftp;
search. */
static bfd_boolean
-mk_fdrtab (abfd, debug_info, debug_swap, line_info)
- bfd *abfd;
- struct ecoff_debug_info * const debug_info;
- const struct ecoff_debug_swap * const debug_swap;
- struct ecoff_find_line *line_info;
+mk_fdrtab (bfd *abfd,
+ struct ecoff_debug_info * const debug_info,
+ const struct ecoff_debug_swap * const debug_swap,
+ struct ecoff_find_line *line_info)
{
struct ecoff_fdrtab_entry *tab;
FDR *fdr_ptr;
The table is mostly sorted already, but there are cases (e.g.,
static functions in include files), where this does not hold.
Use "odump -PFv" to verify... */
- qsort ((PTR) line_info->fdrtab, (size_t) len,
+ qsort (line_info->fdrtab, (size_t) len,
sizeof (struct ecoff_fdrtab_entry), cmp_fdrtab_entry);
return TRUE;
/* Return index of first FDR that covers to OFFSET. */
static long
-fdrtab_lookup (line_info, offset)
- struct ecoff_find_line *line_info;
- bfd_vma offset;
+fdrtab_lookup (struct ecoff_find_line *line_info, bfd_vma offset)
{
long low, high, len;
long mid = -1;
LINE_INFO->cache. */
static bfd_boolean
-lookup_line (abfd, debug_info, debug_swap, line_info)
- bfd *abfd;
- struct ecoff_debug_info * const debug_info;
- const struct ecoff_debug_swap * const debug_swap;
- struct ecoff_find_line *line_info;
+lookup_line (bfd *abfd,
+ struct ecoff_debug_info * const debug_info,
+ const struct ecoff_debug_swap * const debug_swap,
+ struct ecoff_find_line *line_info)
{
struct ecoff_fdrtab_entry *tab;
bfd_vma offset;
pdr_ptr = ((char *) debug_info->external_pdr
+ fdr_ptr->ipdFirst * external_pdr_size);
pdr_end = pdr_ptr + fdr_ptr->cpd * external_pdr_size;
- (*debug_swap->swap_pdr_in) (abfd, (PTR) pdr_ptr, &pdr);
+ (*debug_swap->swap_pdr_in) (abfd, pdr_ptr, &pdr);
/* Find PDR that is closest to OFFSET. If pdr.prof is set,
the procedure entry-point *may* be 0x10 below pdr.adr. We
simply pretend that pdr.prof *implies* a lower entry-point.
for (pdr_hold = NULL;
pdr_ptr < pdr_end;
(pdr_ptr += external_pdr_size,
- (*debug_swap->swap_pdr_in) (abfd, (PTR) pdr_ptr, &pdr)))
+ (*debug_swap->swap_pdr_in) (abfd, pdr_ptr, &pdr)))
{
if (offset >= (pdr.adr - 0x10 * pdr.prof))
{
/* Phew, finally we got something that we can hold onto. */
fdr_ptr = best_fdr;
pdr_ptr = best_pdr;
- (*debug_swap->swap_pdr_in) (abfd, (PTR) pdr_ptr, &pdr);
+ (*debug_swap->swap_pdr_in) (abfd, pdr_ptr, &pdr);
/* Now we can look for the actual line number. The line numbers
are stored in a very funky format, which I won't try to
describe. The search is bounded by the end of the FDRs line
/* Do the work of find_nearest_line. */
bfd_boolean
-_bfd_ecoff_locate_line (abfd, section, offset, debug_info, debug_swap,
- line_info, filename_ptr, functionname_ptr, retline_ptr)
- bfd *abfd;
- asection *section;
- bfd_vma offset;
- struct ecoff_debug_info * const debug_info;
- const struct ecoff_debug_swap * const debug_swap;
- struct ecoff_find_line *line_info;
- const char **filename_ptr;
- const char **functionname_ptr;
- unsigned int *retline_ptr;
+_bfd_ecoff_locate_line (bfd *abfd,
+ asection *section,
+ bfd_vma offset,
+ struct ecoff_debug_info * const debug_info,
+ const struct ecoff_debug_swap * const debug_swap,
+ struct ecoff_find_line *line_info,
+ const char **filename_ptr,
+ const char **functionname_ptr,
+ unsigned int *retline_ptr)
{
offset += section->vma;
/* Collect a shuffle into a memory buffer. */
-static bfd_boolean ecoff_collect_shuffle
- PARAMS ((struct shuffle *, bfd_byte *));
-
static bfd_boolean
-ecoff_collect_shuffle (l, buff)
- struct shuffle *l;
- bfd_byte *buff;
+ecoff_collect_shuffle (struct shuffle *l, bfd_byte *buff)
{
unsigned long total;
/* Copy PDR information into a memory buffer. */
bfd_boolean
-_bfd_ecoff_get_accumulated_pdr (handle, buff)
- PTR handle;
- bfd_byte *buff;
+_bfd_ecoff_get_accumulated_pdr (void * handle,
+ bfd_byte *buff)
{
struct accumulate *ainfo = (struct accumulate *) handle;
/* Copy symbol information into a memory buffer. */
bfd_boolean
-_bfd_ecoff_get_accumulated_sym (handle, buff)
- PTR handle;
- bfd_byte *buff;
+_bfd_ecoff_get_accumulated_sym (void * handle, bfd_byte *buff)
{
struct accumulate *ainfo = (struct accumulate *) handle;
/* Copy the string table into a memory buffer. */
bfd_boolean
-_bfd_ecoff_get_accumulated_ss (handle, buff)
- PTR handle;
- bfd_byte *buff;
+_bfd_ecoff_get_accumulated_ss (void * handle, bfd_byte *buff)
{
struct accumulate *ainfo = (struct accumulate *) handle;
struct string_hash_entry *sh;
size_t len;
len = strlen (sh->root.string);
- memcpy (buff, (PTR) sh->root.string, len + 1);
+ memcpy (buff, sh->root.string, len + 1);
total += len + 1;
buff += len + 1;
}
#include "libbfd.h"
#include "elf-bfd.h"
-static reloc_howto_type *bfd_elf32_bfd_reloc_type_lookup
- PARAMS ((bfd *abfd, bfd_reloc_code_real_type code));
-static void mn10200_info_to_howto
- PARAMS ((bfd *, arelent *, Elf_Internal_Rela *));
-static bfd_boolean mn10200_elf_relax_delete_bytes
- PARAMS ((bfd *, asection *, bfd_vma, int));
-static bfd_boolean mn10200_elf_symbol_address_p
- PARAMS ((bfd *, asection *, Elf_Internal_Sym *, bfd_vma));
-static bfd_reloc_status_type mn10200_elf_final_link_relocate
- PARAMS ((reloc_howto_type *, bfd *, bfd *, asection *,
- bfd_byte *, bfd_vma, bfd_vma, bfd_vma,
- struct bfd_link_info *, asection *, int));
-static bfd_boolean mn10200_elf_relocate_section
- PARAMS ((bfd *, struct bfd_link_info *, bfd *, asection *,
- bfd_byte *, Elf_Internal_Rela *, Elf_Internal_Sym *,
- asection **));
-static bfd_boolean mn10200_elf_relax_section
- PARAMS ((bfd *, asection *, struct bfd_link_info *, bfd_boolean *));
-static bfd_byte * mn10200_elf_get_relocated_section_contents
- PARAMS ((bfd *, struct bfd_link_info *, struct bfd_link_order *,
- bfd_byte *, bfd_boolean, asymbol **));
-
-enum reloc_type {
+static bfd_boolean
+mn10200_elf_relax_delete_bytes (bfd *, asection *, bfd_vma, int);
+static bfd_boolean
+mn10200_elf_symbol_address_p (bfd *, asection *, Elf_Internal_Sym *, bfd_vma);
+
+enum reloc_type
+{
R_MN10200_NONE = 0,
R_MN10200_32,
R_MN10200_16,
R_MN10200_MAX
};
-static reloc_howto_type elf_mn10200_howto_table[] = {
+static reloc_howto_type elf_mn10200_howto_table[] =
+{
/* Dummy relocation. Does nothing. */
HOWTO (R_MN10200_NONE,
0,
TRUE),
};
-struct mn10200_reloc_map {
+struct mn10200_reloc_map
+{
bfd_reloc_code_real_type bfd_reloc_val;
unsigned char elf_reloc_val;
};
-static const struct mn10200_reloc_map mn10200_reloc_map[] = {
+static const struct mn10200_reloc_map mn10200_reloc_map[] =
+{
{ BFD_RELOC_NONE , R_MN10200_NONE , },
{ BFD_RELOC_32 , R_MN10200_32 , },
{ BFD_RELOC_16 , R_MN10200_16 , },
};
static reloc_howto_type *
-bfd_elf32_bfd_reloc_type_lookup (abfd, code)
- bfd *abfd ATTRIBUTE_UNUSED;
- bfd_reloc_code_real_type code;
+bfd_elf32_bfd_reloc_type_lookup (bfd *abfd ATTRIBUTE_UNUSED,
+ bfd_reloc_code_real_type code)
{
unsigned int i;
/* Set the howto pointer for an MN10200 ELF reloc. */
static void
-mn10200_info_to_howto (abfd, cache_ptr, dst)
- bfd *abfd ATTRIBUTE_UNUSED;
- arelent *cache_ptr;
- Elf_Internal_Rela *dst;
+mn10200_info_to_howto (bfd *abfd ATTRIBUTE_UNUSED,
+ arelent *cache_ptr,
+ Elf_Internal_Rela *dst)
{
unsigned int r_type;
/* Perform a relocation as part of a final link. */
static bfd_reloc_status_type
-mn10200_elf_final_link_relocate (howto, input_bfd, output_bfd,
- input_section, contents, offset, value,
- addend, info, sym_sec, is_local)
- reloc_howto_type *howto;
- bfd *input_bfd;
- bfd *output_bfd ATTRIBUTE_UNUSED;
- asection *input_section;
- 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;
+mn10200_elf_final_link_relocate (reloc_howto_type *howto,
+ bfd *input_bfd,
+ bfd *output_bfd ATTRIBUTE_UNUSED,
+ asection *input_section,
+ 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)
{
unsigned long r_type = howto->type;
bfd_byte *hit_data = contents + offset;
\f
/* Relocate an MN10200 ELF section. */
static bfd_boolean
-mn10200_elf_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;
+mn10200_elf_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;
return TRUE;
}
+/* Delete some bytes from a section while relaxing. */
+
+static bfd_boolean
+mn10200_elf_relax_delete_bytes (bfd *abfd, asection *sec,
+ bfd_vma addr, int count)
+{
+ Elf_Internal_Shdr *symtab_hdr;
+ unsigned int sec_shndx;
+ bfd_byte *contents;
+ Elf_Internal_Rela *irel, *irelend;
+ bfd_vma toaddr;
+ Elf_Internal_Sym *isym;
+ Elf_Internal_Sym *isymend;
+ struct elf_link_hash_entry **sym_hashes;
+ struct elf_link_hash_entry **end_hashes;
+ unsigned int symcount;
+
+ sec_shndx = _bfd_elf_section_from_bfd_section (abfd, sec);
+
+ contents = elf_section_data (sec)->this_hdr.contents;
+
+ toaddr = sec->size;
+
+ irel = elf_section_data (sec)->relocs;
+ irelend = irel + sec->reloc_count;
+
+ /* Actually delete the bytes. */
+ memmove (contents + addr, contents + addr + count,
+ (size_t) (toaddr - addr - count));
+ sec->size -= count;
+
+ /* Adjust all the relocs. */
+ for (irel = elf_section_data (sec)->relocs; irel < irelend; irel++)
+ {
+ /* Get the new reloc address. */
+ if ((irel->r_offset > addr
+ && irel->r_offset < toaddr))
+ irel->r_offset -= count;
+ }
+
+ /* Adjust the local symbols defined in this section. */
+ symtab_hdr = &elf_tdata (abfd)->symtab_hdr;
+ isym = (Elf_Internal_Sym *) symtab_hdr->contents;
+ for (isymend = isym + symtab_hdr->sh_info; isym < isymend; isym++)
+ {
+ if (isym->st_shndx == sec_shndx
+ && isym->st_value > addr
+ && isym->st_value < toaddr)
+ isym->st_value -= count;
+ }
+
+ /* Now adjust the global symbols defined in this section. */
+ symcount = (symtab_hdr->sh_size / sizeof (Elf32_External_Sym)
+ - symtab_hdr->sh_info);
+ sym_hashes = elf_sym_hashes (abfd);
+ end_hashes = sym_hashes + symcount;
+ for (; sym_hashes < end_hashes; sym_hashes++)
+ {
+ struct elf_link_hash_entry *sym_hash = *sym_hashes;
+ if ((sym_hash->root.type == bfd_link_hash_defined
+ || sym_hash->root.type == bfd_link_hash_defweak)
+ && sym_hash->root.u.def.section == sec
+ && sym_hash->root.u.def.value > addr
+ && sym_hash->root.u.def.value < toaddr)
+ {
+ sym_hash->root.u.def.value -= count;
+ }
+ }
+
+ return TRUE;
+}
+
/* This function handles relaxing for the mn10200.
There are quite a few relaxing opportunities available on the mn10200:
and somewhat more difficult to support. */
static bfd_boolean
-mn10200_elf_relax_section (abfd, sec, link_info, again)
- bfd *abfd;
- asection *sec;
- struct bfd_link_info *link_info;
- bfd_boolean *again;
+mn10200_elf_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;
/* Get a copy of the native relocations. */
internal_relocs = (_bfd_elf_link_read_relocs
- (abfd, sec, (PTR) NULL, (Elf_Internal_Rela *) NULL,
+ (abfd, sec, NULL, (Elf_Internal_Rela *) NULL,
link_info->keep_memory));
if (internal_relocs == NULL)
goto error_return;
return FALSE;
}
-/* Delete some bytes from a section while relaxing. */
-
-static bfd_boolean
-mn10200_elf_relax_delete_bytes (abfd, sec, addr, count)
- bfd *abfd;
- asection *sec;
- bfd_vma addr;
- int count;
-{
- Elf_Internal_Shdr *symtab_hdr;
- unsigned int sec_shndx;
- bfd_byte *contents;
- Elf_Internal_Rela *irel, *irelend;
- bfd_vma toaddr;
- Elf_Internal_Sym *isym;
- Elf_Internal_Sym *isymend;
- struct elf_link_hash_entry **sym_hashes;
- struct elf_link_hash_entry **end_hashes;
- unsigned int symcount;
-
- sec_shndx = _bfd_elf_section_from_bfd_section (abfd, sec);
-
- contents = elf_section_data (sec)->this_hdr.contents;
-
- toaddr = sec->size;
-
- irel = elf_section_data (sec)->relocs;
- irelend = irel + sec->reloc_count;
-
- /* Actually delete the bytes. */
- memmove (contents + addr, contents + addr + count,
- (size_t) (toaddr - addr - count));
- sec->size -= count;
-
- /* Adjust all the relocs. */
- for (irel = elf_section_data (sec)->relocs; irel < irelend; irel++)
- {
- /* Get the new reloc address. */
- if ((irel->r_offset > addr
- && irel->r_offset < toaddr))
- irel->r_offset -= count;
- }
-
- /* Adjust the local symbols defined in this section. */
- symtab_hdr = &elf_tdata (abfd)->symtab_hdr;
- isym = (Elf_Internal_Sym *) symtab_hdr->contents;
- for (isymend = isym + symtab_hdr->sh_info; isym < isymend; isym++)
- {
- if (isym->st_shndx == sec_shndx
- && isym->st_value > addr
- && isym->st_value < toaddr)
- isym->st_value -= count;
- }
-
- /* Now adjust the global symbols defined in this section. */
- symcount = (symtab_hdr->sh_size / sizeof (Elf32_External_Sym)
- - symtab_hdr->sh_info);
- sym_hashes = elf_sym_hashes (abfd);
- end_hashes = sym_hashes + symcount;
- for (; sym_hashes < end_hashes; sym_hashes++)
- {
- struct elf_link_hash_entry *sym_hash = *sym_hashes;
- if ((sym_hash->root.type == bfd_link_hash_defined
- || sym_hash->root.type == bfd_link_hash_defweak)
- && sym_hash->root.u.def.section == sec
- && sym_hash->root.u.def.value > addr
- && sym_hash->root.u.def.value < toaddr)
- {
- sym_hash->root.u.def.value -= count;
- }
- }
-
- return TRUE;
-}
-
/* Return TRUE if a symbol exists at the given address, else return
FALSE. */
static bfd_boolean
-mn10200_elf_symbol_address_p (abfd, sec, isym, addr)
- bfd *abfd;
- asection *sec;
- Elf_Internal_Sym *isym;
- bfd_vma addr;
+mn10200_elf_symbol_address_p (bfd *abfd,
+ asection *sec,
+ Elf_Internal_Sym *isym,
+ bfd_vma addr)
{
Elf_Internal_Shdr *symtab_hdr;
unsigned int sec_shndx;
which uses mn10200_elf_relocate_section. */
static bfd_byte *
-mn10200_elf_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;
+mn10200_elf_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;
bfd_size_type amt;
internal_relocs = (_bfd_elf_link_read_relocs
- (input_bfd, input_section, (PTR) NULL,
+ (input_bfd, input_section, NULL,
(Elf_Internal_Rela *) NULL, FALSE));
if (internal_relocs == NULL)
goto error_return;
bfd *abfd ATTRIBUTE_UNUSED,
arelent *reloc_entry ATTRIBUTE_UNUSED,
asymbol *symbol ATTRIBUTE_UNUSED,
- PTR data ATTRIBUTE_UNUSED,
+ void * data ATTRIBUTE_UNUSED,
asection *input_section ATTRIBUTE_UNUSED,
bfd *output_bfd ATTRIBUTE_UNUSED,
char **error_message ATTRIBUTE_UNUSED)
bfin_pcrel24_reloc (bfd *abfd,
arelent *reloc_entry,
asymbol *symbol,
- PTR data,
+ void * data,
asection *input_section,
bfd *output_bfd,
char **error_message ATTRIBUTE_UNUSED)
bfin_imm16_reloc (bfd *abfd,
arelent *reloc_entry,
asymbol *symbol,
- PTR data,
+ void * data,
asection *input_section,
bfd *output_bfd,
char **error_message ATTRIBUTE_UNUSED)
bfin_byte4_reloc (bfd *abfd,
arelent *reloc_entry,
asymbol *symbol,
- PTR data,
+ void * data,
asection *input_section,
bfd *output_bfd,
char **error_message ATTRIBUTE_UNUSED)
bfin_bfd_reloc (bfd *abfd,
arelent *reloc_entry,
asymbol *symbol,
- PTR data,
+ void * data,
asection *input_section,
bfd *output_bfd,
char **error_message ATTRIBUTE_UNUSED)
/* Given a bfin relocation type, return the howto. */
static reloc_howto_type *
bfin_reloc_type_lookup (bfd * abfd ATTRIBUTE_UNUSED,
- unsigned int r_type)
+ unsigned int r_type)
{
if (r_type <= BFIN_RELOC_MAX)
return &bfin_howto_table [r_type];
/* Return TRUE if the name is a local label.
bfin local labels begin with L$. */
static bfd_boolean
-bfin_is_local_label_name (
- bfd *abfd,
- const char *label)
+bfin_is_local_label_name (bfd *abfd, const char *label)
{
if (label[0] == 'L' && label[1] == '$' )
return TRUE;
const Elf_Internal_Rela *rel_end;
asection *sgot;
asection *srelgot;
+
if (info->relocatable)
return TRUE;
for memory allocation purposes. */
inline static struct bfinfdpic_relocs_info *
bfinfdpic_relocs_info_for_global (struct htab *ht,
- bfd *abfd,
- struct elf_link_hash_entry *h,
- bfd_vma addend,
- enum insert_option insert)
+ bfd *abfd,
+ struct elf_link_hash_entry *h,
+ bfd_vma addend,
+ enum insert_option insert)
{
struct bfinfdpic_relocs_info entry;
inline static void
bfinfdpic_pic_merge_early_relocs_info (struct bfinfdpic_relocs_info *e2,
- struct bfinfdpic_relocs_info const *e1)
+ struct bfinfdpic_relocs_info const *e1)
{
e2->got17m4 |= e1->got17m4;
e2->gothilo |= e1->gothilo;
static bfd_vma
_bfinfdpic_add_rofixup (bfd *output_bfd, asection *rofixup, bfd_vma offset,
- struct bfinfdpic_relocs_info *entry)
+ struct bfinfdpic_relocs_info *entry)
{
bfd_vma fixup_offset;
asection *sec,
Elf_Internal_Sym *sym,
bfd_vma addend)
-
{
- bfd_vma fd_lazy_rel_offset = (bfd_vma)-1;
+ bfd_vma fd_lazy_rel_offset = (bfd_vma) -1;
int dynindx = -1;
if (entry->done)
subtract it from the relocation or fixup count. */
static bfd_boolean
_bfinfdpic_check_discarded_relocs (bfd *abfd, asection *sec,
- struct bfd_link_info *info,
-
- bfd_boolean *changed)
+ struct bfd_link_info *info,
+ bfd_boolean *changed)
{
Elf_Internal_Shdr *symtab_hdr;
struct elf_link_hash_entry **sym_hashes, **sym_hashes_end;
regular object. */
static bfd_boolean
-elf32_bfinfdpic_adjust_dynamic_symbol
-(struct bfd_link_info *info,
- struct elf_link_hash_entry *h)
+elf32_bfinfdpic_adjust_dynamic_symbol (struct bfd_link_info *info,
+ struct elf_link_hash_entry *h)
{
bfd * dynobj;
/* Display the flags field. */
static bfd_boolean
-elf32_bfin_print_private_bfd_data (bfd * abfd, PTR ptr)
+elf32_bfin_print_private_bfd_data (bfd * abfd, void * ptr)
{
FILE *file = (FILE *) ptr;
flagword flags;
static bfd_boolean
bfin_finish_dynamic_sections (bfd * output_bfd ATTRIBUTE_UNUSED,
- struct bfd_link_info *info)
+ struct bfd_link_info *info)
{
bfd *dynobj;
asection *sdyn;
static bfd_boolean
bfin_finish_dynamic_symbol (bfd * output_bfd,
- struct bfd_link_info *info,
- struct elf_link_hash_entry *h,
- Elf_Internal_Sym * sym)
+ struct bfd_link_info *info,
+ struct elf_link_hash_entry *h,
+ Elf_Internal_Sym * sym)
{
bfd *dynobj;
static bfd_boolean
bfin_adjust_dynamic_symbol (struct bfd_link_info *info,
- struct elf_link_hash_entry *h)
+ struct elf_link_hash_entry *h)
{
bfd *dynobj;
asection *s;
case. */
static bfd_boolean
-bfin_discard_copies (struct elf_link_hash_entry *h, PTR inf)
+bfin_discard_copies (struct elf_link_hash_entry *h, void * inf)
{
struct bfd_link_info *info = (struct bfd_link_info *) inf;
struct bfin_pcrel_relocs_copied *s;
static bfd_boolean
bfin_size_dynamic_sections (bfd * output_bfd ATTRIBUTE_UNUSED,
- struct bfd_link_info *info)
+ struct bfd_link_info *info)
{
bfd *dynobj;
asection *s;
will not fill them in in the relocate_section routine. */
if (info->shared)
elf_link_hash_traverse (elf_hash_table (info),
- bfin_discard_copies, (PTR) info);
+ bfin_discard_copies, info);
/* The check_relocs and adjust_dynamic_symbol entry points have
determined the sizes of the various dynamic sections. Allocate
after the add_symbols entry point has been called for all the
objects, and before the final_link entry point is called. */
-bfd_boolean bfd_bfin_elf32_create_embedded_relocs
- PARAMS ((bfd *, struct bfd_link_info *, asection *, asection *, char **));
-
bfd_boolean
-bfd_bfin_elf32_create_embedded_relocs (
- bfd *abfd,
- struct bfd_link_info *info,
- asection *datasec,
- asection *relsec,
- char **errmsg)
+bfd_bfin_elf32_create_embedded_relocs (bfd *abfd,
+ struct bfd_link_info *info,
+ asection *datasec,
+ asection *relsec,
+ char **errmsg)
{
Elf_Internal_Shdr *symtab_hdr;
Elf_Internal_Sym *isymbuf = NULL;
/* Get a copy of the native relocations. */
internal_relocs = (_bfd_elf_link_read_relocs
- (abfd, datasec, (PTR) NULL, (Elf_Internal_Rela *) NULL,
+ (abfd, datasec, NULL, (Elf_Internal_Rela *) NULL,
info->keep_memory));
if (internal_relocs == NULL)
goto error_return;
#include "elf/cris.h"
#include <limits.h>
-/* Forward declarations. */
-static reloc_howto_type * cris_reloc_type_lookup
- PARAMS ((bfd *abfd, bfd_reloc_code_real_type code));
-
-static void cris_info_to_howto_rela
- PARAMS ((bfd *, arelent *, Elf_Internal_Rela *));
-
-static bfd_reloc_status_type cris_elf_pcrel_reloc
- PARAMS ((bfd *, arelent *, asymbol *, PTR, asection *, bfd *, char **));
-
-static bfd_boolean cris_elf_grok_prstatus
- PARAMS ((bfd *abfd, Elf_Internal_Note *note));
-
-static bfd_boolean cris_elf_grok_psinfo
- PARAMS ((bfd *abfd, Elf_Internal_Note *note));
-
-static bfd_boolean cris_elf_relocate_section
- PARAMS ((bfd *, struct bfd_link_info *, bfd *, asection *, bfd_byte *,
- Elf_Internal_Rela *, Elf_Internal_Sym *, asection **));
-
-static bfd_reloc_status_type cris_final_link_relocate
- PARAMS ((reloc_howto_type *, bfd *, asection *, bfd_byte *,
- Elf_Internal_Rela *, bfd_vma));
-
-static bfd_boolean cris_elf_object_p PARAMS ((bfd *));
-
-static void cris_elf_final_write_processing PARAMS ((bfd *, bfd_boolean));
-
-static bfd_boolean cris_elf_set_mach_from_flags
- PARAMS ((bfd *, unsigned long int));
-
-static bfd_boolean cris_elf_print_private_bfd_data PARAMS ((bfd *, PTR));
-
-static bfd_boolean cris_elf_merge_private_bfd_data PARAMS ((bfd *, bfd *));
-static bfd_boolean cris_elf_copy_private_bfd_data PARAMS ((bfd *, bfd *));
-
-struct elf_cris_link_hash_entry;
-static bfd_boolean elf_cris_discard_excess_dso_dynamics
- PARAMS ((struct elf_cris_link_hash_entry *, PTR));
-static bfd_boolean elf_cris_discard_excess_program_dynamics
- PARAMS ((struct elf_cris_link_hash_entry *, PTR));
-static bfd_boolean elf_cris_adjust_gotplt_to_got
- PARAMS ((struct elf_cris_link_hash_entry *, PTR));
-static bfd_boolean elf_cris_try_fold_plt_to_got
- PARAMS ((struct elf_cris_link_hash_entry *, PTR));
-static struct bfd_hash_entry *elf_cris_link_hash_newfunc
- PARAMS ((struct bfd_hash_entry *, struct bfd_hash_table *, const char *));
-static struct bfd_link_hash_table *elf_cris_link_hash_table_create
- PARAMS ((bfd *));
-static bfd_boolean elf_cris_adjust_dynamic_symbol
- PARAMS ((struct bfd_link_info *, struct elf_link_hash_entry *));
-static bfd_boolean cris_elf_check_relocs
- PARAMS ((bfd *, struct bfd_link_info *, asection *,
- const Elf_Internal_Rela *));
-
-static bfd_boolean elf_cris_size_dynamic_sections
- PARAMS ((bfd *, struct bfd_link_info *));
-static bfd_boolean elf_cris_finish_dynamic_symbol
- PARAMS ((bfd *, struct bfd_link_info *, struct elf_link_hash_entry *,
- Elf_Internal_Sym *));
-static bfd_boolean elf_cris_finish_dynamic_sections
- PARAMS ((bfd *, struct bfd_link_info *));
-static void elf_cris_hide_symbol
- PARAMS ((struct bfd_link_info *, struct elf_link_hash_entry *, bfd_boolean));
-static enum elf_reloc_type_class elf_cris_reloc_type_class
- PARAMS ((const Elf_Internal_Rela *));
+bfd_reloc_status_type
+cris_elf_pcrel_reloc (bfd *, arelent *, asymbol *, void *,
+ asection *, bfd *, char **);
+static bfd_boolean
+cris_elf_set_mach_from_flags (bfd *, unsigned long);
+/* Forward declarations. */
static reloc_howto_type cris_elf_howto_table [] =
{
/* This reloc does nothing. */
};
static reloc_howto_type *
-cris_reloc_type_lookup (abfd, code)
- bfd * abfd ATTRIBUTE_UNUSED;
- bfd_reloc_code_real_type code;
+cris_reloc_type_lookup (bfd * abfd ATTRIBUTE_UNUSED,
+ bfd_reloc_code_real_type code)
{
unsigned int i;
/* Set the howto pointer for an CRIS ELF reloc. */
static void
-cris_info_to_howto_rela (abfd, cache_ptr, dst)
- bfd * abfd ATTRIBUTE_UNUSED;
- arelent * cache_ptr;
- Elf_Internal_Rela * dst;
+cris_info_to_howto_rela (bfd * abfd ATTRIBUTE_UNUSED,
+ arelent * cache_ptr,
+ Elf_Internal_Rela * dst)
{
enum elf_cris_reloc_type r_type;
}
bfd_reloc_status_type
-cris_elf_pcrel_reloc (abfd, reloc_entry, symbol, data, input_section,
- output_bfd, error_message)
- bfd *abfd ATTRIBUTE_UNUSED;
- arelent *reloc_entry;
- asymbol *symbol;
- PTR data ATTRIBUTE_UNUSED;
- asection *input_section;
- bfd *output_bfd;
- char **error_message ATTRIBUTE_UNUSED;
+cris_elf_pcrel_reloc (bfd *abfd ATTRIBUTE_UNUSED,
+ arelent *reloc_entry,
+ asymbol *symbol,
+ void * data ATTRIBUTE_UNUSED,
+ asection *input_section,
+ bfd *output_bfd,
+ char **error_message ATTRIBUTE_UNUSED)
{
/* By default (using only bfd_elf_generic_reloc when linking to
non-ELF formats) PC-relative relocs are relative to the beginning
changes, while still keeping Linux/CRIS and Linux/CRISv32 code apart. */
static bfd_boolean
-cris_elf_grok_prstatus (abfd, note)
- bfd *abfd;
- Elf_Internal_Note *note;
+cris_elf_grok_prstatus (bfd *abfd, Elf_Internal_Note *note)
{
int offset;
size_t size;
}
static bfd_boolean
-cris_elf_grok_psinfo (abfd, note)
- bfd *abfd;
- Elf_Internal_Note *note;
+cris_elf_grok_psinfo (bfd *abfd, Elf_Internal_Note *note)
{
if (bfd_get_mach (abfd) == bfd_mach_cris_v32)
switch (note->descsz)
bfd_signed_vma dtp_refcount;
};
+static bfd_boolean
+elf_cris_discard_excess_dso_dynamics (struct elf_cris_link_hash_entry *,
+ void * );
+static bfd_boolean
+elf_cris_discard_excess_program_dynamics (struct elf_cris_link_hash_entry *,
+ void *);
+
/* The local_got_refcounts and local_got_offsets are a multiple of
LSNUM in size, namely LGOT_ALLOC_NELTS_FOR(LSNUM) (plus one for the
refcount for GOT itself, see code), with the summary / group offset
routines, with a few tweaks. */
static bfd_reloc_status_type
-cris_final_link_relocate (howto, input_bfd, input_section, contents, rel,
- relocation)
- reloc_howto_type * howto;
- bfd * input_bfd;
- asection * input_section;
- bfd_byte * contents;
- Elf_Internal_Rela * rel;
- bfd_vma relocation;
+cris_final_link_relocate (reloc_howto_type * howto,
+ bfd * input_bfd,
+ asection * input_section,
+ bfd_byte * contents,
+ Elf_Internal_Rela * rel,
+ bfd_vma relocation)
{
bfd_reloc_status_type r;
enum elf_cris_reloc_type r_type = ELF32_R_TYPE (rel->r_info);
computed. */
static bfd_boolean
-elf_cris_finish_dynamic_sections (output_bfd, info)
- bfd *output_bfd;
- struct bfd_link_info *info;
+elf_cris_finish_dynamic_sections (bfd *output_bfd,
+ struct bfd_link_info *info)
{
bfd *dynobj;
asection *sgot;
created (we're only linking static objects). */
static bfd_boolean
-elf_cris_adjust_gotplt_to_got (h, p)
- struct elf_cris_link_hash_entry *h;
- PTR p;
+elf_cris_adjust_gotplt_to_got (struct elf_cris_link_hash_entry *h, void * p)
{
struct bfd_link_info *info = (struct bfd_link_info *) p;
elf_cris_hide_symbol. */
static bfd_boolean
-elf_cris_try_fold_plt_to_got (h, p)
- struct elf_cris_link_hash_entry *h;
- PTR p;
+elf_cris_try_fold_plt_to_got (struct elf_cris_link_hash_entry *h, void * p)
{
struct bfd_link_info *info = (struct bfd_link_info *) p;
entry. */
static void
-elf_cris_hide_symbol (info, h, force_local)
- struct bfd_link_info *info;
- struct elf_link_hash_entry *h;
- bfd_boolean force_local;
+elf_cris_hide_symbol (struct bfd_link_info *info,
+ struct elf_link_hash_entry *h,
+ bfd_boolean force_local)
{
elf_cris_adjust_gotplt_to_got ((struct elf_cris_link_hash_entry *) h, info);
relocate_section routine. */
static bfd_boolean
-elf_cris_discard_excess_dso_dynamics (h, inf)
- struct elf_cris_link_hash_entry *h;
- PTR inf;
+elf_cris_discard_excess_dso_dynamics (struct elf_cris_link_hash_entry *h,
+ void * inf)
{
struct elf_cris_pcrel_relocs_copied *s;
struct bfd_link_info *info = (struct bfd_link_info *) inf;
in the .got, but which we found we do not have to resolve at run-time. */
static bfd_boolean
-elf_cris_discard_excess_program_dynamics (h, inf)
- struct elf_cris_link_hash_entry *h;
- PTR inf;
+elf_cris_discard_excess_program_dynamics (struct elf_cris_link_hash_entry *h,
+ void * inf)
{
struct bfd_link_info *info = (struct bfd_link_info *) inf;
underscores on symbols. */
static bfd_boolean
-cris_elf_object_p (abfd)
- bfd *abfd;
+cris_elf_object_p (bfd *abfd)
{
if (! cris_elf_set_mach_from_flags (abfd, elf_elfheader (abfd)->e_flags))
return FALSE;
flags from mach type. */
static void
-cris_elf_final_write_processing (abfd, linker)
- bfd *abfd;
- bfd_boolean linker ATTRIBUTE_UNUSED;
+cris_elf_final_write_processing (bfd *abfd,
+ bfd_boolean linker ATTRIBUTE_UNUSED)
{
unsigned long e_flags = elf_elfheader (abfd)->e_flags;
/* Set the mach type from e_flags value. */
static bfd_boolean
-cris_elf_set_mach_from_flags (abfd, flags)
- bfd *abfd;
- unsigned long flags;
+cris_elf_set_mach_from_flags (bfd *abfd,
+ unsigned long flags)
{
switch (flags & EF_CRIS_VARIANT_MASK)
{
/* Display the flags field. */
static bfd_boolean
-cris_elf_print_private_bfd_data (abfd, ptr)
- bfd *abfd;
- PTR ptr;
+cris_elf_print_private_bfd_data (bfd *abfd, void * ptr)
{
FILE *file = (FILE *) ptr;
/* Don't mix files with and without a leading underscore. */
static bfd_boolean
-cris_elf_merge_private_bfd_data (ibfd, obfd)
- bfd *ibfd;
- bfd *obfd;
+cris_elf_merge_private_bfd_data (bfd *ibfd, bfd *obfd)
{
int imach, omach;
/* Do side-effects of e_flags copying to obfd. */
static bfd_boolean
-cris_elf_copy_private_bfd_data (ibfd, obfd)
- bfd *ibfd;
- bfd *obfd;
+cris_elf_copy_private_bfd_data (bfd *ibfd, bfd *obfd)
{
/* Call the base function. */
if (!_bfd_elf_copy_private_bfd_data (ibfd, obfd))
}
static enum elf_reloc_type_class
-elf_cris_reloc_type_class (rela)
- const Elf_Internal_Rela *rela;
+elf_cris_reloc_type_class (const Elf_Internal_Rela *rela)
{
enum elf_cris_reloc_type r_type = ELF32_R_TYPE (rela->r_info);
switch (r_type)
bfd_size_type amt;
internal_relocs = (_bfd_elf_link_read_relocs
- (input_bfd, input_section, (PTR) NULL,
+ (input_bfd, input_section, NULL,
(Elf_Internal_Rela *) NULL, FALSE));
if (internal_relocs == NULL)
goto error_return;
/* Get a copy of the native relocations. */
internal_relocs = (_bfd_elf_link_read_relocs
- (abfd, sec, (PTR) NULL, (Elf_Internal_Rela *) NULL,
+ (abfd, sec, NULL, (Elf_Internal_Rela *) NULL,
link_info->keep_memory));
if (internal_relocs == NULL)
goto error_return;
#include "elf/fr30.h"
/* Forward declarations. */
-static bfd_reloc_status_type fr30_elf_i20_reloc
- PARAMS ((bfd *, arelent *, asymbol *, PTR, asection *, bfd *, char **));
-static bfd_reloc_status_type fr30_elf_i32_reloc
- PARAMS ((bfd *, arelent *, asymbol *, PTR, asection *, bfd *, char **));
-static reloc_howto_type * fr30_reloc_type_lookup
- PARAMS ((bfd *abfd, bfd_reloc_code_real_type code));
-static void fr30_info_to_howto_rela
- PARAMS ((bfd *, arelent *, Elf_Internal_Rela *));
-static bfd_boolean fr30_elf_relocate_section
- PARAMS ((bfd *, struct bfd_link_info *, bfd *, asection *, bfd_byte *,
- Elf_Internal_Rela *, Elf_Internal_Sym *, asection **));
-static bfd_reloc_status_type fr30_final_link_relocate
- PARAMS ((reloc_howto_type *, bfd *, asection *, bfd_byte *,
- Elf_Internal_Rela *, bfd_vma));
-static bfd_boolean fr30_elf_check_relocs
- PARAMS ((bfd *, struct bfd_link_info *, asection *,
- const Elf_Internal_Rela *));
+static bfd_reloc_status_type
+fr30_elf_i20_reloc (bfd *, arelent *, asymbol *, void * data,
+ asection *, bfd *, char **error_message);
+static bfd_reloc_status_type
+fr30_elf_i32_reloc (bfd *, arelent *, asymbol *, void *,
+ asection *, bfd *, char **);
static reloc_howto_type fr30_elf_howto_table [] =
{
/* Utility to actually perform an R_FR30_20 reloc. */
static bfd_reloc_status_type
-fr30_elf_i20_reloc (abfd, reloc_entry, symbol, data,
- input_section, output_bfd, error_message)
- bfd *abfd;
- arelent *reloc_entry;
- asymbol *symbol;
- PTR data;
- asection *input_section;
- bfd *output_bfd;
- char **error_message ATTRIBUTE_UNUSED;
+fr30_elf_i20_reloc (bfd *abfd,
+ arelent *reloc_entry,
+ asymbol *symbol,
+ void * data,
+ asection *input_section,
+ bfd *output_bfd,
+ char **error_message ATTRIBUTE_UNUSED)
{
bfd_vma relocation;
unsigned long x;
/* Utility to actually perform a R_FR30_48 reloc. */
static bfd_reloc_status_type
-fr30_elf_i32_reloc (abfd, reloc_entry, symbol, data,
- input_section, output_bfd, error_message)
- bfd *abfd;
- arelent *reloc_entry;
- asymbol *symbol;
- PTR data;
- asection *input_section;
- bfd *output_bfd;
- char **error_message ATTRIBUTE_UNUSED;
+fr30_elf_i32_reloc (bfd *abfd,
+ arelent *reloc_entry,
+ asymbol *symbol,
+ void * data,
+ asection *input_section,
+ bfd *output_bfd,
+ char **error_message ATTRIBUTE_UNUSED)
{
bfd_vma relocation;
};
static reloc_howto_type *
-fr30_reloc_type_lookup (abfd, code)
- bfd *abfd ATTRIBUTE_UNUSED;
- bfd_reloc_code_real_type code;
+fr30_reloc_type_lookup (bfd *abfd ATTRIBUTE_UNUSED,
+ bfd_reloc_code_real_type code)
{
unsigned int i;
/* Set the howto pointer for an FR30 ELF reloc. */
static void
-fr30_info_to_howto_rela (abfd, cache_ptr, dst)
- bfd *abfd ATTRIBUTE_UNUSED;
- arelent *cache_ptr;
- Elf_Internal_Rela *dst;
+fr30_info_to_howto_rela (bfd *abfd ATTRIBUTE_UNUSED,
+ arelent *cache_ptr,
+ Elf_Internal_Rela *dst)
{
unsigned int r_type;
routines, but a few relocs, we have to do them ourselves. */
static bfd_reloc_status_type
-fr30_final_link_relocate (howto, input_bfd, input_section, contents, rel,
- relocation)
- reloc_howto_type *howto;
- bfd *input_bfd;
- asection *input_section;
- bfd_byte *contents;
- Elf_Internal_Rela *rel;
- bfd_vma relocation;
+fr30_final_link_relocate (reloc_howto_type *howto,
+ bfd *input_bfd,
+ asection *input_section,
+ bfd_byte *contents,
+ Elf_Internal_Rela *rel,
+ bfd_vma relocation)
{
bfd_reloc_status_type r = bfd_reloc_ok;
bfd_vma x;
accordingly. */
static bfd_boolean
-fr30_elf_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;
+fr30_elf_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;
virtual table relocs for gc. */
static bfd_boolean
-fr30_elf_check_relocs (abfd, info, sec, relocs)
- bfd *abfd;
- struct bfd_link_info *info;
- asection *sec;
- const Elf_Internal_Rela *relocs;
+fr30_elf_check_relocs (bfd *abfd,
+ struct bfd_link_info *info,
+ asection *sec,
+ const Elf_Internal_Rela *relocs)
{
Elf_Internal_Shdr *symtab_hdr;
struct elf_link_hash_entry **sym_hashes;
#include "hashtab.h"
/* Forward declarations. */
-static bfd_reloc_status_type elf32_frv_relocate_lo16
- PARAMS ((bfd *, Elf_Internal_Rela *, bfd_byte *, bfd_vma));
-static bfd_reloc_status_type elf32_frv_relocate_hi16
- PARAMS ((bfd *, Elf_Internal_Rela *, bfd_byte *, bfd_vma));
-static bfd_reloc_status_type elf32_frv_relocate_label24
- PARAMS ((bfd *, asection *, Elf_Internal_Rela *, bfd_byte *, bfd_vma));
-static bfd_reloc_status_type elf32_frv_relocate_gprel12
- PARAMS ((struct bfd_link_info *, bfd *, asection *, Elf_Internal_Rela *,
- bfd_byte *, bfd_vma));
-static bfd_reloc_status_type elf32_frv_relocate_gprelu12
- PARAMS ((struct bfd_link_info *, bfd *, asection *, Elf_Internal_Rela *,
- bfd_byte *, bfd_vma));
-static bfd_reloc_status_type elf32_frv_relocate_gprello
- PARAMS ((struct bfd_link_info *, bfd *, asection *, Elf_Internal_Rela *,
- bfd_byte *, bfd_vma));
-static bfd_reloc_status_type elf32_frv_relocate_gprelhi
- PARAMS ((struct bfd_link_info *, bfd *, asection *, Elf_Internal_Rela *,
- bfd_byte *, bfd_vma));
-static reloc_howto_type *frv_reloc_type_lookup
- PARAMS ((bfd *, bfd_reloc_code_real_type));
-static void frv_info_to_howto_rela
- PARAMS ((bfd *, arelent *, Elf_Internal_Rela *));
-static bfd_boolean elf32_frv_relocate_section
- PARAMS ((bfd *, struct bfd_link_info *, bfd *, asection *, bfd_byte *,
- Elf_Internal_Rela *, Elf_Internal_Sym *, asection **));
-static bfd_boolean elf32_frv_add_symbol_hook
- PARAMS (( bfd *, struct bfd_link_info *, Elf_Internal_Sym *,
- const char **, flagword *, asection **, bfd_vma *));
-static bfd_reloc_status_type frv_final_link_relocate
- PARAMS ((reloc_howto_type *, bfd *, asection *, bfd_byte *,
- Elf_Internal_Rela *, bfd_vma));
-static bfd_boolean elf32_frv_check_relocs
- PARAMS ((bfd *, struct bfd_link_info *, asection *,
- const Elf_Internal_Rela *));
-static int elf32_frv_machine
- PARAMS ((bfd *));
-static bfd_boolean elf32_frv_object_p
- PARAMS ((bfd *));
-static bfd_boolean frv_elf_set_private_flags
- PARAMS ((bfd *, flagword));
-static bfd_boolean frv_elf_copy_private_bfd_data
- PARAMS ((bfd *, bfd *));
-static bfd_boolean frv_elf_merge_private_bfd_data
- PARAMS ((bfd *, bfd *));
-static bfd_boolean frv_elf_print_private_bfd_data
- PARAMS ((bfd *, PTR));
-static bfd_boolean elf32_frv_grok_prstatus (bfd * abfd,
- Elf_Internal_Note * note);
-static bfd_boolean elf32_frv_grok_psinfo (bfd * abfd,
- Elf_Internal_Note * note);
+
static reloc_howto_type elf32_frv_howto_table [] =
{
/* Handle an FRV small data reloc. */
static bfd_reloc_status_type
-elf32_frv_relocate_gprel12 (info, input_bfd, input_section, relocation,
- contents, value)
- struct bfd_link_info *info;
- bfd *input_bfd;
- asection *input_section;
- Elf_Internal_Rela *relocation;
- bfd_byte *contents;
- bfd_vma value;
+elf32_frv_relocate_gprel12 (struct bfd_link_info *info,
+ bfd *input_bfd,
+ asection *input_section,
+ Elf_Internal_Rela *relocation,
+ bfd_byte *contents,
+ bfd_vma value)
{
bfd_vma insn;
bfd_vma gp;
/* Handle an FRV small data reloc. for the u12 field. */
static bfd_reloc_status_type
-elf32_frv_relocate_gprelu12 (info, input_bfd, input_section, relocation,
- contents, value)
- struct bfd_link_info *info;
- bfd *input_bfd;
- asection *input_section;
- Elf_Internal_Rela *relocation;
- bfd_byte *contents;
- bfd_vma value;
+elf32_frv_relocate_gprelu12 (struct bfd_link_info *info,
+ bfd *input_bfd,
+ asection *input_section,
+ Elf_Internal_Rela *relocation,
+ bfd_byte *contents,
+ bfd_vma value)
{
bfd_vma insn;
bfd_vma gp;
/* Handle an FRV ELF HI16 reloc. */
static bfd_reloc_status_type
-elf32_frv_relocate_hi16 (input_bfd, relhi, contents, value)
- bfd *input_bfd;
- Elf_Internal_Rela *relhi;
- bfd_byte *contents;
- bfd_vma value;
+elf32_frv_relocate_hi16 (bfd *input_bfd,
+ Elf_Internal_Rela *relhi,
+ bfd_byte *contents,
+ bfd_vma value)
{
bfd_vma insn;
}
static bfd_reloc_status_type
-elf32_frv_relocate_lo16 (input_bfd, rello, contents, value)
- bfd *input_bfd;
- Elf_Internal_Rela *rello;
- bfd_byte *contents;
- bfd_vma value;
+elf32_frv_relocate_lo16 (bfd *input_bfd,
+ Elf_Internal_Rela *rello,
+ bfd_byte *contents,
+ bfd_vma value)
{
bfd_vma insn;
/* Perform the relocation for the CALL label24 instruction. */
static bfd_reloc_status_type
-elf32_frv_relocate_label24 (input_bfd, input_section, rello, contents, value)
- bfd *input_bfd;
- asection *input_section;
- Elf_Internal_Rela *rello;
- bfd_byte *contents;
- bfd_vma value;
+elf32_frv_relocate_label24 (bfd *input_bfd,
+ asection *input_section,
+ Elf_Internal_Rela *rello,
+ bfd_byte *contents,
+ bfd_vma value)
{
bfd_vma insn;
bfd_vma label6;
}
static bfd_reloc_status_type
-elf32_frv_relocate_gprelhi (info, input_bfd, input_section, relocation,
- contents, value)
- struct bfd_link_info *info;
- bfd *input_bfd;
- asection *input_section;
- Elf_Internal_Rela *relocation;
- bfd_byte *contents;
- bfd_vma value;
+elf32_frv_relocate_gprelhi (struct bfd_link_info *info,
+ bfd *input_bfd,
+ asection *input_section,
+ Elf_Internal_Rela *relocation,
+ bfd_byte *contents,
+ bfd_vma value)
{
bfd_vma insn;
bfd_vma gp;
}
static bfd_reloc_status_type
-elf32_frv_relocate_gprello (info, input_bfd, input_section, relocation,
- contents, value)
- struct bfd_link_info *info;
- bfd *input_bfd;
- asection *input_section;
- Elf_Internal_Rela *relocation;
- bfd_byte *contents;
- bfd_vma value;
+elf32_frv_relocate_gprello (struct bfd_link_info *info,
+ bfd *input_bfd,
+ asection *input_section,
+ Elf_Internal_Rela *relocation,
+ bfd_byte *contents,
+ bfd_vma value)
{
bfd_vma insn;
bfd_vma gp;
}
static reloc_howto_type *
-frv_reloc_type_lookup (abfd, code)
- bfd *abfd ATTRIBUTE_UNUSED;
- bfd_reloc_code_real_type code;
+frv_reloc_type_lookup (bfd *abfd ATTRIBUTE_UNUSED,
+ bfd_reloc_code_real_type code)
{
switch (code)
{
/* Set the howto pointer for an FRV ELF reloc. */
static void
-frv_info_to_howto_rela (abfd, cache_ptr, dst)
- bfd *abfd ATTRIBUTE_UNUSED;
- arelent *cache_ptr;
- Elf_Internal_Rela *dst;
+frv_info_to_howto_rela (bfd *abfd ATTRIBUTE_UNUSED,
+ arelent *cache_ptr,
+ Elf_Internal_Rela *dst)
{
unsigned int r_type;
routines, but a few relocs, we have to do them ourselves. */
static bfd_reloc_status_type
-frv_final_link_relocate (howto, input_bfd, input_section, contents, rel,
- relocation)
- reloc_howto_type *howto;
- bfd *input_bfd;
- asection *input_section;
- bfd_byte *contents;
- Elf_Internal_Rela *rel;
- bfd_vma relocation;
+frv_final_link_relocate (reloc_howto_type *howto,
+ bfd *input_bfd,
+ asection *input_section,
+ bfd_byte *contents,
+ Elf_Internal_Rela *rel,
+ bfd_vma relocation)
{
return _bfd_final_link_relocate (howto, input_bfd, input_section,
contents, rel->r_offset, relocation,
accordingly. */
static bfd_boolean
-elf32_frv_relocate_section (output_bfd, info, input_bfd, input_section,
- contents, relocs, local_syms, local_sections)
- bfd *output_bfd ATTRIBUTE_UNUSED;
- 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_frv_relocate_section (bfd *output_bfd ATTRIBUTE_UNUSED,
+ 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;
file. We use it to put .comm items in .scomm, and not .comm. */
static bfd_boolean
-elf32_frv_add_symbol_hook (abfd, info, sym, namep, flagsp, secp, valp)
- bfd *abfd;
- struct bfd_link_info *info;
- Elf_Internal_Sym *sym;
- const char **namep ATTRIBUTE_UNUSED;
- flagword *flagsp ATTRIBUTE_UNUSED;
- asection **secp;
- bfd_vma *valp;
+elf32_frv_add_symbol_hook (bfd *abfd,
+ struct bfd_link_info *info,
+ Elf_Internal_Sym *sym,
+ const char **namep ATTRIBUTE_UNUSED,
+ flagword *flagsp ATTRIBUTE_UNUSED,
+ asection **secp,
+ bfd_vma *valp)
{
if (sym->st_shndx == SHN_COMMON
&& !info->relocatable
Given infinite time and money... :-) */
static bfd_boolean
-elf32_frv_check_relocs (abfd, info, sec, relocs)
- bfd *abfd;
- struct bfd_link_info *info;
- asection *sec;
- const Elf_Internal_Rela *relocs;
+elf32_frv_check_relocs (bfd *abfd,
+ struct bfd_link_info *info,
+ asection *sec,
+ const Elf_Internal_Rela *relocs)
{
Elf_Internal_Shdr *symtab_hdr;
struct elf_link_hash_entry **sym_hashes;
/* Return the machine subcode from the ELF e_flags header. */
static int
-elf32_frv_machine (abfd)
- bfd *abfd;
+elf32_frv_machine (bfd *abfd)
{
switch (elf_elfheader (abfd)->e_flags & EF_FRV_CPU_MASK)
{
/* Set the right machine number for a FRV ELF file. */
static bfd_boolean
-elf32_frv_object_p (abfd)
- bfd *abfd;
+elf32_frv_object_p (bfd *abfd)
{
bfd_default_set_arch_mach (abfd, bfd_arch_frv, elf32_frv_machine (abfd));
return (((elf_elfheader (abfd)->e_flags & EF_FRV_FDPIC) != 0)
/* Function to set the ELF flag bits. */
static bfd_boolean
-frv_elf_set_private_flags (abfd, flags)
- bfd *abfd;
- flagword flags;
+frv_elf_set_private_flags (bfd *abfd, flagword flags)
{
elf_elfheader (abfd)->e_flags = flags;
elf_flags_init (abfd) = TRUE;
/* Copy backend specific data from one object module to another. */
static bfd_boolean
-frv_elf_copy_private_bfd_data (ibfd, obfd)
- bfd *ibfd;
- bfd *obfd;
+frv_elf_copy_private_bfd_data (bfd *ibfd, bfd *obfd)
{
if (bfd_get_flavour (ibfd) != bfd_target_elf_flavour
|| bfd_get_flavour (obfd) != bfd_target_elf_flavour)
object file when linking. */
static bfd_boolean
-frv_elf_merge_private_bfd_data (ibfd, obfd)
- bfd *ibfd;
- bfd *obfd;
+frv_elf_merge_private_bfd_data (bfd *ibfd, bfd *obfd)
{
flagword old_flags, old_partial;
flagword new_flags, new_partial;
}
\f
-bfd_boolean
-frv_elf_print_private_bfd_data (abfd, ptr)
- bfd *abfd;
- PTR ptr;
+static bfd_boolean
+frv_elf_print_private_bfd_data (bfd *abfd, void * ptr)
{
FILE *file = (FILE *) ptr;
flagword flags;
bfd_byte *, Elf_Internal_Rela *,
Elf_Internal_Sym *, asection **);
static bfd_reloc_status_type special
- (bfd *, arelent *, asymbol *, PTR, asection *, bfd *, char **);
+ (bfd *, arelent *, asymbol *, void *, asection *, bfd *, char **);
/* This does not include any relocation information, but should be
good enough for GDB or objdump to read the file. */
-static reloc_howto_type h8_elf_howto_table[] = {
+static reloc_howto_type h8_elf_howto_table[] =
+{
#define R_H8_NONE_X 0
HOWTO (R_H8_NONE, /* type */
0, /* rightshift */
special (bfd *abfd ATTRIBUTE_UNUSED,
arelent *reloc_entry ATTRIBUTE_UNUSED,
asymbol *symbol ATTRIBUTE_UNUSED,
- PTR data ATTRIBUTE_UNUSED,
+ void * data ATTRIBUTE_UNUSED,
asection *input_section ATTRIBUTE_UNUSED,
bfd *output_bfd,
char **error_message ATTRIBUTE_UNUSED)
/* Get a copy of the native relocations. */
internal_relocs = (_bfd_elf_link_read_relocs
- (abfd, sec, (PTR) NULL, (Elf_Internal_Rela *) NULL,
+ (abfd, sec, NULL, (Elf_Internal_Rela *) NULL,
link_info->keep_memory));
if (internal_relocs == NULL)
goto error_return;
bfd_size_type amt;
internal_relocs = (_bfd_elf_link_read_relocs
- (input_bfd, input_section, (PTR) NULL,
+ (input_bfd, input_section, NULL,
(Elf_Internal_Rela *) NULL, FALSE));
if (internal_relocs == NULL)
goto error_return;
/* Intel 960 specific support for 32-bit ELF
- Copyright 1999, 2000, 2001, 2002, 2003, 2005, 2007
+ Copyright 1999, 2000, 2001, 2002, 2003, 2005, 2007, 2012
Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library.
elf32_i960_relocate (bfd *abfd ATTRIBUTE_UNUSED,
arelent *reloc_entry,
asymbol *symbol,
- PTR data ATTRIBUTE_UNUSED,
+ void * data ATTRIBUTE_UNUSED,
asection *input_section,
bfd *output_bfd,
char **error_message ATTRIBUTE_UNUSED)
\f
static bfd_boolean
-m32c_elf_print_private_bfd_data (bfd *abfd, PTR ptr)
+m32c_elf_print_private_bfd_data (bfd *abfd, void *ptr)
{
FILE *file = (FILE *) ptr;
flagword flags;
};
static bfd_boolean
-m32c_relax_plt_check (struct elf_link_hash_entry *h,
- PTR xdata)
+m32c_relax_plt_check (struct elf_link_hash_entry *h, void * xdata)
{
struct relax_plt_data *data = (struct relax_plt_data *) xdata;
previously had a plt entry, give it a new entry offset. */
static bfd_boolean
-m32c_relax_plt_realloc (struct elf_link_hash_entry *h,
- PTR xdata)
+m32c_relax_plt_realloc (struct elf_link_hash_entry *h, void * xdata)
{
bfd_vma *entry = (bfd_vma *) xdata;
if (shndx_buf == NULL)
goto error_return;
if (bfd_seek (abfd, shndx_hdr->sh_offset, SEEK_SET) != 0
- || bfd_bread ((PTR) shndx_buf, amt, abfd) != amt)
+ || bfd_bread (shndx_buf, amt, abfd) != amt)
goto error_return;
shndx_hdr->contents = (bfd_byte *) shndx_buf;
}
/* Get a copy of the native relocations. */
internal_relocs = (_bfd_elf_link_read_relocs
- (abfd, sec, (PTR) NULL, (Elf_Internal_Rela *) NULL,
+ (abfd, sec, NULL, (Elf_Internal_Rela *) NULL,
link_info->keep_memory));
if (internal_relocs == NULL)
goto error_return;
/* Get a copy of the native relocations. */
internal_relocs = (_bfd_elf_link_read_relocs
- (abfd, sec, (PTR) NULL, (Elf_Internal_Rela *) NULL,
+ (abfd, sec, NULL, (Elf_Internal_Rela *) NULL,
link_info->keep_memory));
if (internal_relocs == NULL)
goto error_return;
(bfd *, arelent *, Elf_Internal_Rela *);
/* Trampoline generation. */
-static bfd_boolean m68hc12_elf_size_one_stub
- (struct bfd_hash_entry *gen_entry, void *in_arg);
-static bfd_boolean m68hc12_elf_build_one_stub
- (struct bfd_hash_entry *gen_entry, void *in_arg);
-static struct bfd_link_hash_table* m68hc12_elf_bfd_link_hash_table_create
- (bfd*);
-
-static bfd_boolean m68hc12_elf_set_mach_from_flags PARAMS ((bfd *));
+
/* Use REL instead of RELA to save space */
#define USE_REL 1
static bfd_boolean m68hc11_elf_export_one_stub
(struct bfd_hash_entry *gen_entry, void *in_arg);
-static void scan_sections_for_abi (bfd*, asection*, PTR);
+static void scan_sections_for_abi (bfd*, asection*, void *);
struct m68hc11_scan_param
{
#include "elf/m68k.h"
#include "opcode/m68k.h"
-static reloc_howto_type *reloc_type_lookup
- PARAMS ((bfd *, bfd_reloc_code_real_type));
-static void rtype_to_howto
- PARAMS ((bfd *, arelent *, Elf_Internal_Rela *));
-static struct bfd_hash_entry *elf_m68k_link_hash_newfunc
- PARAMS ((struct bfd_hash_entry *, struct bfd_hash_table *, const char *));
-static struct bfd_link_hash_table *elf_m68k_link_hash_table_create
- PARAMS ((bfd *));
-static bfd_boolean elf_m68k_check_relocs
- PARAMS ((bfd *, struct bfd_link_info *, asection *,
- const Elf_Internal_Rela *));
-static bfd_boolean elf_m68k_adjust_dynamic_symbol
- PARAMS ((struct bfd_link_info *, struct elf_link_hash_entry *));
-static bfd_boolean elf_m68k_size_dynamic_sections
- PARAMS ((bfd *, struct bfd_link_info *));
-static bfd_boolean elf_m68k_discard_copies
- PARAMS ((struct elf_link_hash_entry *, PTR));
-static bfd_boolean elf_m68k_relocate_section
- PARAMS ((bfd *, struct bfd_link_info *, bfd *, asection *, bfd_byte *,
- Elf_Internal_Rela *, Elf_Internal_Sym *, asection **));
-static bfd_boolean elf_m68k_finish_dynamic_symbol
- PARAMS ((bfd *, struct bfd_link_info *, struct elf_link_hash_entry *,
- Elf_Internal_Sym *));
-static bfd_boolean elf_m68k_finish_dynamic_sections
- PARAMS ((bfd *, struct bfd_link_info *));
-
-static bfd_boolean elf32_m68k_set_private_flags
- PARAMS ((bfd *, flagword));
-static bfd_boolean elf32_m68k_merge_private_bfd_data
- PARAMS ((bfd *, bfd *));
-static bfd_boolean elf32_m68k_print_private_bfd_data
- PARAMS ((bfd *, PTR));
-static enum elf_reloc_type_class elf32_m68k_reloc_type_class
- PARAMS ((const Elf_Internal_Rela *));
-
-static reloc_howto_type howto_table[] = {
+static bfd_boolean
+elf_m68k_discard_copies (struct elf_link_hash_entry *, void *);
+
+static reloc_howto_type howto_table[] =
+{
HOWTO(R_68K_NONE, 0, 0, 0, FALSE,0, complain_overflow_dont, bfd_elf_generic_reloc, "R_68K_NONE", FALSE, 0, 0x00000000,FALSE),
HOWTO(R_68K_32, 0, 2,32, FALSE,0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_68K_32", FALSE, 0, 0xffffffff,FALSE),
HOWTO(R_68K_16, 0, 1,16, FALSE,0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_68K_16", FALSE, 0, 0x0000ffff,FALSE),
};
static reloc_howto_type *
-reloc_type_lookup (abfd, code)
- bfd *abfd ATTRIBUTE_UNUSED;
- bfd_reloc_code_real_type code;
+reloc_type_lookup (bfd *abfd ATTRIBUTE_UNUSED,
+ bfd_reloc_code_real_type code)
{
unsigned int i;
for (i = 0; i < sizeof (reloc_map) / sizeof (reloc_map[0]); i++)
/* Keep m68k-specific flags in the ELF header. */
static bfd_boolean
-elf32_m68k_set_private_flags (abfd, flags)
- bfd *abfd;
- flagword flags;
+elf32_m68k_set_private_flags (bfd *abfd, flagword flags)
{
elf_elfheader (abfd)->e_flags = flags;
elf_flags_init (abfd) = TRUE;
/* Merge backend specific data from an object file to the output
object file when linking. */
static bfd_boolean
-elf32_m68k_merge_private_bfd_data (ibfd, obfd)
- bfd *ibfd;
- bfd *obfd;
+elf32_m68k_merge_private_bfd_data (bfd *ibfd, bfd *obfd)
{
flagword out_flags;
flagword in_flags;
table. */
static bfd_boolean
-elf_m68k_check_relocs (abfd, info, sec, relocs)
- bfd *abfd;
- struct bfd_link_info *info;
- asection *sec;
- const Elf_Internal_Rela *relocs;
+elf_m68k_check_relocs (bfd *abfd,
+ struct bfd_link_info *info,
+ asection *sec,
+ const Elf_Internal_Rela *relocs)
{
bfd *dynobj;
Elf_Internal_Shdr *symtab_hdr;
understand. */
static bfd_boolean
-elf_m68k_adjust_dynamic_symbol (info, h)
- struct bfd_link_info *info;
- struct elf_link_hash_entry *h;
+elf_m68k_adjust_dynamic_symbol (struct bfd_link_info *info,
+ struct elf_link_hash_entry *h)
{
struct elf_m68k_link_hash_table *htab;
bfd *dynobj;
/* Set the sizes of the dynamic sections. */
static bfd_boolean
-elf_m68k_size_dynamic_sections (output_bfd, info)
- bfd *output_bfd ATTRIBUTE_UNUSED;
- struct bfd_link_info *info;
+elf_m68k_size_dynamic_sections (bfd *output_bfd ATTRIBUTE_UNUSED,
+ struct bfd_link_info *info)
{
bfd *dynobj;
asection *s;
if (info->shared)
elf_link_hash_traverse (elf_hash_table (info),
elf_m68k_discard_copies,
- (PTR) info);
+ info);
/* The check_relocs and adjust_dynamic_symbol entry points have
determined the sizes of the various dynamic sections. Allocate
case. */
static bfd_boolean
-elf_m68k_discard_copies (h, inf)
- struct elf_link_hash_entry *h;
- PTR inf;
+elf_m68k_discard_copies (struct elf_link_hash_entry *h,
+ void * inf)
{
struct bfd_link_info *info = (struct bfd_link_info *) inf;
struct elf_m68k_pcrel_relocs_copied *s;
/* Relocate an M68K ELF section. */
static bfd_boolean
-elf_m68k_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;
+elf_m68k_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)
{
bfd *dynobj;
Elf_Internal_Shdr *symtab_hdr;
dynamic sections here. */
static bfd_boolean
-elf_m68k_finish_dynamic_symbol (output_bfd, info, h, sym)
- bfd *output_bfd;
- struct bfd_link_info *info;
- struct elf_link_hash_entry *h;
- Elf_Internal_Sym *sym;
+elf_m68k_finish_dynamic_symbol (bfd *output_bfd,
+ struct bfd_link_info *info,
+ struct elf_link_hash_entry *h,
+ Elf_Internal_Sym *sym)
{
bfd *dynobj;
/* Finish up the dynamic sections. */
static bfd_boolean
-elf_m68k_finish_dynamic_sections (output_bfd, info)
- bfd *output_bfd;
- struct bfd_link_info *info;
+elf_m68k_finish_dynamic_sections (bfd *output_bfd, struct bfd_link_info *info)
{
bfd *dynobj;
asection *sgot;
/* Get a copy of the native relocations. */
internal_relocs = (_bfd_elf_link_read_relocs
- (abfd, datasec, (PTR) NULL, (Elf_Internal_Rela *) NULL,
+ (abfd, datasec, NULL, (Elf_Internal_Rela *) NULL,
info->keep_memory));
if (internal_relocs == NULL)
goto error_return;
}
static enum elf_reloc_type_class
-elf32_m68k_reloc_type_class (rela)
- const Elf_Internal_Rela *rela;
+elf32_m68k_reloc_type_class (const Elf_Internal_Rela *rela)
{
switch ((int) ELF32_R_TYPE (rela->r_info))
{
mcore_elf_unsupported_reloc (bfd * abfd,
arelent * reloc_entry,
asymbol * symbol ATTRIBUTE_UNUSED,
- PTR data ATTRIBUTE_UNUSED,
+ void * data ATTRIBUTE_UNUSED,
asection * input_section ATTRIBUTE_UNUSED,
bfd * output_bfd ATTRIBUTE_UNUSED,
char ** error_message ATTRIBUTE_UNUSED)
};
static bfd_boolean
-rl78_relax_plt_check (struct elf_link_hash_entry *h,
- PTR xdata)
+rl78_relax_plt_check (struct elf_link_hash_entry *h, void * xdata)
{
struct relax_plt_data *data = (struct relax_plt_data *) xdata;
previously had a plt entry, give it a new entry offset. */
static bfd_boolean
-rl78_relax_plt_realloc (struct elf_link_hash_entry *h,
- PTR xdata)
+rl78_relax_plt_realloc (struct elf_link_hash_entry *h, void * xdata)
{
bfd_vma *entry = (bfd_vma *) xdata;
if (shndx_buf == NULL)
goto error_return;
if (bfd_seek (abfd, shndx_hdr->sh_offset, SEEK_SET) != 0
- || bfd_bread ((PTR) shndx_buf, amt, abfd) != amt)
+ || bfd_bread (shndx_buf, amt, abfd) != amt)
goto error_return;
shndx_hdr->contents = (bfd_byte *) shndx_buf;
}
/* Get a copy of the native relocations. */
internal_relocs = (_bfd_elf_link_read_relocs
- (abfd, sec, (PTR) NULL, (Elf_Internal_Rela *) NULL,
+ (abfd, sec, NULL, (Elf_Internal_Rela *) NULL,
link_info->keep_memory));
if (internal_relocs == NULL)
goto error_return;
if (shndx_buf == NULL)
goto error_return;
if (bfd_seek (abfd, shndx_hdr->sh_offset, SEEK_SET) != 0
- || bfd_bread ((PTR) shndx_buf, amt, abfd) != amt)
+ || bfd_bread (shndx_buf, amt, abfd) != amt)
goto error_return;
shndx_hdr->contents = (bfd_byte *) shndx_buf;
}
/* Get a copy of the native relocations. */
internal_relocs = (_bfd_elf_link_read_relocs
- (abfd, sec, (PTR) NULL, (Elf_Internal_Rela *) NULL,
+ (abfd, sec, NULL, (Elf_Internal_Rela *) NULL,
link_info->keep_memory));
if (internal_relocs == NULL)
goto error_return;
#include "bfdlink.h"
#include "libbfd.h"
#include "elf-bfd.h"
-
-static reloc_howto_type *elf_s390_reloc_type_lookup
- PARAMS ((bfd *, bfd_reloc_code_real_type));
-static void elf_s390_info_to_howto
- PARAMS ((bfd *, arelent *, Elf_Internal_Rela *));
-static bfd_boolean elf_s390_is_local_label_name
- PARAMS ((bfd *, const char *));
-static struct bfd_hash_entry *link_hash_newfunc
- PARAMS ((struct bfd_hash_entry *, struct bfd_hash_table *, const char *));
-static struct bfd_link_hash_table *elf_s390_link_hash_table_create
- PARAMS ((bfd *));
-static bfd_boolean create_got_section
- PARAMS((bfd *, struct bfd_link_info *));
-static bfd_boolean elf_s390_create_dynamic_sections
- PARAMS((bfd *, struct bfd_link_info *));
-static void elf_s390_copy_indirect_symbol
- PARAMS ((struct bfd_link_info *, struct elf_link_hash_entry *,
- struct elf_link_hash_entry *));
-static bfd_boolean elf_s390_check_relocs
- PARAMS ((bfd *, struct bfd_link_info *, asection *,
- const Elf_Internal_Rela *));
-struct elf_s390_link_hash_entry;
-static void elf_s390_adjust_gotplt
- PARAMS ((struct elf_s390_link_hash_entry *));
-static bfd_boolean elf_s390_adjust_dynamic_symbol
- PARAMS ((struct bfd_link_info *, struct elf_link_hash_entry *));
-static bfd_boolean allocate_dynrelocs
- PARAMS ((struct elf_link_hash_entry *, PTR));
-static bfd_boolean readonly_dynrelocs
- PARAMS ((struct elf_link_hash_entry *, PTR));
-static bfd_boolean elf_s390_size_dynamic_sections
- PARAMS ((bfd *, struct bfd_link_info *));
-static bfd_boolean elf_s390_relocate_section
- PARAMS ((bfd *, struct bfd_link_info *, bfd *, asection *, bfd_byte *,
- Elf_Internal_Rela *, Elf_Internal_Sym *, asection **));
-static bfd_boolean elf_s390_finish_dynamic_symbol
- PARAMS ((bfd *, struct bfd_link_info *, struct elf_link_hash_entry *,
- Elf_Internal_Sym *));
-static enum elf_reloc_type_class elf_s390_reloc_type_class
- PARAMS ((const Elf_Internal_Rela *));
-static bfd_boolean elf_s390_finish_dynamic_sections
- PARAMS ((bfd *, struct bfd_link_info *));
-static bfd_boolean elf_s390_object_p
- PARAMS ((bfd *));
-static bfd_boolean elf_s390_grok_prstatus
- PARAMS ((bfd *, Elf_Internal_Note *));
-static int elf_s390_tls_transition
- PARAMS ((struct bfd_link_info *, int, int));
-static bfd_reloc_status_type s390_tls_reloc
- PARAMS ((bfd *, arelent *, asymbol *, PTR, asection *, bfd *, char **));
-static bfd_vma dtpoff_base
- PARAMS ((struct bfd_link_info *));
-static bfd_vma tpoff
- PARAMS ((struct bfd_link_info *, bfd_vma));
-static void invalid_tls_insn
- PARAMS ((bfd *, asection *, Elf_Internal_Rela *));
-static bfd_reloc_status_type s390_elf_ldisp_reloc
- PARAMS ((bfd *, arelent *, asymbol *, PTR, asection *, bfd *, char **));
-
#include "elf/s390.h"
+static bfd_reloc_status_type
+s390_tls_reloc (bfd *, arelent *, asymbol *, void *,
+ asection *, bfd *, char **);
+static bfd_reloc_status_type
+s390_elf_ldisp_reloc (bfd *, arelent *, asymbol *, void *,
+ asection *, bfd *, char **);
+
/* The relocation "howto" table. */
static reloc_howto_type elf_howto_table[] =
HOWTO (R_390_GNU_VTENTRY, 0,2,0,FALSE,0,complain_overflow_dont, _bfd_elf_rel_vtable_reloc_fn,"R_390_GNU_VTENTRY", FALSE,0,0, FALSE);
static reloc_howto_type *
-elf_s390_reloc_type_lookup (abfd, code)
- bfd *abfd ATTRIBUTE_UNUSED;
- bfd_reloc_code_real_type code;
+elf_s390_reloc_type_lookup (bfd *abfd ATTRIBUTE_UNUSED,
+ bfd_reloc_code_real_type code)
{
switch (code)
{
and elf32-s390.c has its own copy. */
static void
-elf_s390_info_to_howto (abfd, cache_ptr, dst)
- bfd *abfd ATTRIBUTE_UNUSED;
- arelent *cache_ptr;
- Elf_Internal_Rela *dst;
+elf_s390_info_to_howto (bfd *abfd ATTRIBUTE_UNUSED,
+ arelent *cache_ptr,
+ Elf_Internal_Rela *dst)
{
unsigned int r_type = ELF32_R_TYPE(dst->r_info);
switch (r_type)
/* A relocation function which doesn't do anything. */
static bfd_reloc_status_type
-s390_tls_reloc (abfd, reloc_entry, symbol, data, input_section,
- output_bfd, error_message)
- bfd *abfd ATTRIBUTE_UNUSED;
- arelent *reloc_entry;
- asymbol *symbol ATTRIBUTE_UNUSED;
- PTR data ATTRIBUTE_UNUSED;
- asection *input_section;
- bfd *output_bfd;
- char **error_message ATTRIBUTE_UNUSED;
+s390_tls_reloc (bfd *abfd ATTRIBUTE_UNUSED,
+ arelent *reloc_entry,
+ asymbol *symbol ATTRIBUTE_UNUSED,
+ void * data ATTRIBUTE_UNUSED,
+ asection *input_section,
+ bfd *output_bfd,
+ char **error_message ATTRIBUTE_UNUSED)
{
if (output_bfd)
reloc_entry->address += input_section->output_offset;
/* Handle the large displacement relocs. */
static bfd_reloc_status_type
-s390_elf_ldisp_reloc (abfd, reloc_entry, symbol, data, input_section,
- output_bfd, error_message)
- bfd *abfd ATTRIBUTE_UNUSED;
- arelent *reloc_entry;
- asymbol *symbol;
- PTR data ATTRIBUTE_UNUSED;
- asection *input_section;
- bfd *output_bfd;
- char **error_message ATTRIBUTE_UNUSED;
+s390_elf_ldisp_reloc (bfd *abfd ATTRIBUTE_UNUSED,
+ arelent *reloc_entry,
+ asymbol *symbol,
+ void * data ATTRIBUTE_UNUSED,
+ asection *input_section,
+ bfd *output_bfd,
+ char **error_message ATTRIBUTE_UNUSED)
{
reloc_howto_type *howto = reloc_entry->howto;
bfd_vma relocation;
}
static bfd_boolean
-elf_s390_is_local_label_name (abfd, name)
- bfd *abfd;
- const char *name;
+elf_s390_is_local_label_name (bfd *abfd, const char *name)
{
if (name[0] == '.' && (name[1] == 'X' || name[1] == 'L'))
return TRUE;
}
static bfd_boolean
-elf_s390_object_p (abfd)
- bfd *abfd;
+elf_s390_object_p (bfd *abfd)
{
/* Set the right machine number for an s390 elf32 file. */
return bfd_default_set_arch_mach (abfd, bfd_arch_s390, bfd_mach_s390_31);
asection *sdynbss;
asection *srelbss;
- union {
+ union
+ {
bfd_signed_vma refcount;
bfd_vma offset;
} tls_ldm_got;
/* Create an entry in an s390 ELF linker hash table. */
static struct bfd_hash_entry *
-link_hash_newfunc (entry, table, string)
- struct bfd_hash_entry *entry;
- struct bfd_hash_table *table;
- const char *string;
+link_hash_newfunc (struct bfd_hash_entry *entry,
+ struct bfd_hash_table *table,
+ const char *string)
{
/* Allocate the structure if it has not already been allocated by a
subclass. */
/* Create an s390 ELF linker hash table. */
static struct bfd_link_hash_table *
-elf_s390_link_hash_table_create (abfd)
- bfd *abfd;
+elf_s390_link_hash_table_create (bfd *abfd)
{
struct elf_s390_link_hash_table *ret;
bfd_size_type amt = sizeof (struct elf_s390_link_hash_table);
shortcuts to them in our hash table. */
static bfd_boolean
-create_got_section (dynobj, info)
- bfd *dynobj;
- struct bfd_link_info *info;
+create_got_section (bfd *dynobj, struct bfd_link_info *info)
{
struct elf_s390_link_hash_table *htab;
hash table. */
static bfd_boolean
-elf_s390_create_dynamic_sections (dynobj, info)
- bfd *dynobj;
- struct bfd_link_info *info;
+elf_s390_create_dynamic_sections (bfd *dynobj, struct bfd_link_info *info)
{
struct elf_s390_link_hash_table *htab;
/* Copy the extra info we tack onto an elf_link_hash_entry. */
static void
-elf_s390_copy_indirect_symbol (info, dir, ind)
- struct bfd_link_info *info;
- struct elf_link_hash_entry *dir, *ind;
+elf_s390_copy_indirect_symbol (struct bfd_link_info *info,
+ struct elf_link_hash_entry *dir,
+ struct elf_link_hash_entry *ind)
{
struct elf_s390_link_hash_entry *edir, *eind;
}
static int
-elf_s390_tls_transition (info, r_type, is_local)
- struct bfd_link_info *info;
- int r_type;
- int is_local;
+elf_s390_tls_transition (struct bfd_link_info *info,
+ int r_type,
+ int is_local)
{
if (info->shared)
return r_type;
table. */
static bfd_boolean
-elf_s390_check_relocs (abfd, info, sec, relocs)
- bfd *abfd;
- struct bfd_link_info *info;
- asection *sec;
- const Elf_Internal_Rela *relocs;
+elf_s390_check_relocs (bfd *abfd,
+ struct bfd_link_info *info,
+ asection *sec,
+ const Elf_Internal_Rela *relocs)
{
struct elf_s390_link_hash_table *htab;
Elf_Internal_Shdr *symtab_hdr;
created (we're only linking static objects). */
static void
-elf_s390_adjust_gotplt (h)
- struct elf_s390_link_hash_entry *h;
+elf_s390_adjust_gotplt (struct elf_s390_link_hash_entry *h)
{
if (h->elf.root.type == bfd_link_hash_warning)
h = (struct elf_s390_link_hash_entry *) h->elf.root.u.i.link;
understand. */
static bfd_boolean
-elf_s390_adjust_dynamic_symbol (info, h)
- struct bfd_link_info *info;
- struct elf_link_hash_entry *h;
+elf_s390_adjust_dynamic_symbol (struct bfd_link_info *info,
+ struct elf_link_hash_entry *h)
{
struct elf_s390_link_hash_table *htab;
asection *s;
dynamic relocs. */
static bfd_boolean
-allocate_dynrelocs (h, inf)
- struct elf_link_hash_entry *h;
- PTR inf;
+allocate_dynrelocs (struct elf_link_hash_entry *h, void * inf)
{
struct bfd_link_info *info;
struct elf_s390_link_hash_table *htab;
/* Find any dynamic relocs that apply to read-only sections. */
static bfd_boolean
-readonly_dynrelocs (h, inf)
- struct elf_link_hash_entry *h;
- PTR inf;
+readonly_dynrelocs (struct elf_link_hash_entry *h, void * inf)
{
struct elf_s390_link_hash_entry *eh;
struct elf_dyn_relocs *p;
/* Set the sizes of the dynamic sections. */
static bfd_boolean
-elf_s390_size_dynamic_sections (output_bfd, info)
- bfd *output_bfd ATTRIBUTE_UNUSED;
- struct bfd_link_info *info;
+elf_s390_size_dynamic_sections (bfd *output_bfd ATTRIBUTE_UNUSED,
+ struct bfd_link_info *info)
{
struct elf_s390_link_hash_table *htab;
bfd *dynobj;
/* Allocate global sym .plt and .got entries, and space for global
sym dynamic relocs. */
- elf_link_hash_traverse (&htab->elf, allocate_dynrelocs, (PTR) info);
+ elf_link_hash_traverse (&htab->elf, allocate_dynrelocs, info);
/* We now have determined the sizes of the various dynamic sections.
Allocate memory for them. */
/* If any dynamic relocs apply to a read-only section,
then we need a DT_TEXTREL entry. */
if ((info->flags & DF_TEXTREL) == 0)
- elf_link_hash_traverse (&htab->elf, readonly_dynrelocs,
- (PTR) info);
+ elf_link_hash_traverse (&htab->elf, readonly_dynrelocs, info);
if ((info->flags & DF_TEXTREL) != 0)
{
This is PT_TLS segment p_vaddr. */
static bfd_vma
-dtpoff_base (info)
- struct bfd_link_info *info;
+dtpoff_base (struct bfd_link_info *info)
{
/* If tls_sec is NULL, we should have signalled an error already. */
if (elf_hash_table (info)->tls_sec == NULL)
if STT_TLS virtual address is ADDRESS. */
static bfd_vma
-tpoff (info, address)
- struct bfd_link_info *info;
- bfd_vma address;
+tpoff (struct bfd_link_info *info, bfd_vma address)
{
struct elf_link_hash_table *htab = elf_hash_table (info);
instruction. */
static void
-invalid_tls_insn (input_bfd, input_section, rel)
- bfd *input_bfd;
- asection *input_section;
- Elf_Internal_Rela *rel;
+invalid_tls_insn (bfd *input_bfd,
+ asection *input_section,
+ Elf_Internal_Rela *rel)
{
reloc_howto_type *howto;
/* Relocate a 390 ELF section. */
static bfd_boolean
-elf_s390_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;
+elf_s390_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)
{
struct elf_s390_link_hash_table *htab;
Elf_Internal_Shdr *symtab_hdr;
dynamic sections here. */
static bfd_boolean
-elf_s390_finish_dynamic_symbol (output_bfd, info, h, sym)
- bfd *output_bfd;
- struct bfd_link_info *info;
- struct elf_link_hash_entry *h;
- Elf_Internal_Sym *sym;
+elf_s390_finish_dynamic_symbol (bfd *output_bfd,
+ struct bfd_link_info *info,
+ struct elf_link_hash_entry *h,
+ Elf_Internal_Sym *sym)
{
struct elf_s390_link_hash_table *htab;
dynamic linker, before writing them out. */
static enum elf_reloc_type_class
-elf_s390_reloc_type_class (rela)
- const Elf_Internal_Rela *rela;
+elf_s390_reloc_type_class (const Elf_Internal_Rela *rela)
{
switch ((int) ELF32_R_TYPE (rela->r_info))
{
/* Finish up the dynamic sections. */
static bfd_boolean
-elf_s390_finish_dynamic_sections (output_bfd, info)
- bfd *output_bfd;
- struct bfd_link_info *info;
+elf_s390_finish_dynamic_sections (bfd *output_bfd,
+ struct bfd_link_info *info)
{
struct elf_s390_link_hash_table *htab;
bfd *dynobj;
}
static bfd_boolean
-elf_s390_grok_prstatus (abfd, note)
- bfd * abfd;
- Elf_Internal_Note * note;
+elf_s390_grok_prstatus (bfd * abfd, Elf_Internal_Note * note)
{
int offset;
unsigned int size;
static bfd_boolean elf32_vax_set_private_flags (bfd *, flagword);
static bfd_boolean elf32_vax_merge_private_bfd_data (bfd *, bfd *);
-static bfd_boolean elf32_vax_print_private_bfd_data (bfd *, PTR);
+static bfd_boolean elf32_vax_print_private_bfd_data (bfd *, void *);
static reloc_howto_type howto_table[] = {
HOWTO (R_VAX_NONE, /* type */
#define elf_vax_link_hash_traverse(table, func, info) \
(elf_link_hash_traverse \
((table), \
- (bfd_boolean (*) (struct elf_link_hash_entry *, PTR)) (func), \
+ (bfd_boolean (*) (struct elf_link_hash_entry *, void *)) (func), \
(info)))
/* Create an entry in an VAX ELF linker hash table. */
/* Display the flags field */
static bfd_boolean
-elf32_vax_print_private_bfd_data (bfd *abfd, PTR ptr)
+elf32_vax_print_private_bfd_data (bfd *abfd, void * ptr)
{
FILE *file = (FILE *) ptr;
instantiate (allocate space for them). */
elf_link_hash_traverse (elf_hash_table (info),
elf_vax_instantiate_got_entries,
- (PTR) info);
+ info);
/* The check_relocs and adjust_dynamic_symbol entry points have
determined the sizes of the various dynamic sections. Allocate
static bfd_boolean
elf_vax_discard_copies (struct elf_vax_link_hash_entry *h,
- PTR ignore ATTRIBUTE_UNUSED)
+ void * ignore ATTRIBUTE_UNUSED)
{
struct elf_vax_pcrel_relocs_copied *s;
will be reserved for the symbol. */
static bfd_boolean
-elf_vax_instantiate_got_entries (struct elf_link_hash_entry *h, PTR infoptr)
+elf_vax_instantiate_got_entries (struct elf_link_hash_entry *h, void * infoptr)
{
struct bfd_link_info *info = (struct bfd_link_info *) infoptr;
bfd *dynobj;
#define alpha_elf_link_hash_traverse(table, func, info) \
(elf_link_hash_traverse \
(&(table)->root, \
- (bfd_boolean (*) (struct elf_link_hash_entry *, PTR)) (func), \
+ (bfd_boolean (*) (struct elf_link_hash_entry *, void *)) (func), \
(info)))
/* Get the Alpha ELF linker hash table from a link_info structure. */
static bfd_reloc_status_type
elf64_alpha_reloc_nil (bfd *abfd ATTRIBUTE_UNUSED, arelent *reloc,
asymbol *sym ATTRIBUTE_UNUSED,
- PTR data ATTRIBUTE_UNUSED, asection *sec,
+ void * data ATTRIBUTE_UNUSED, asection *sec,
bfd *output_bfd, char **error_message ATTRIBUTE_UNUSED)
{
if (output_bfd)
static bfd_reloc_status_type
elf64_alpha_reloc_bad (bfd *abfd ATTRIBUTE_UNUSED, arelent *reloc,
asymbol *sym ATTRIBUTE_UNUSED,
- PTR data ATTRIBUTE_UNUSED, asection *sec,
+ void * data ATTRIBUTE_UNUSED, asection *sec,
bfd *output_bfd, char **error_message ATTRIBUTE_UNUSED)
{
if (output_bfd)
static bfd_reloc_status_type
elf64_alpha_reloc_gpdisp (bfd *abfd, arelent *reloc_entry,
- asymbol *sym ATTRIBUTE_UNUSED, PTR data,
+ asymbol *sym ATTRIBUTE_UNUSED, void * data,
asection *input_section, bfd *output_bfd,
char **err_msg)
{
}
READ (line, cbLineOffset, cbLine, sizeof (unsigned char), unsigned char *);
- READ (external_dnr, cbDnOffset, idnMax, swap->external_dnr_size, PTR);
- READ (external_pdr, cbPdOffset, ipdMax, swap->external_pdr_size, PTR);
- READ (external_sym, cbSymOffset, isymMax, swap->external_sym_size, PTR);
- READ (external_opt, cbOptOffset, ioptMax, swap->external_opt_size, PTR);
+ READ (external_dnr, cbDnOffset, idnMax, swap->external_dnr_size, void *);
+ READ (external_pdr, cbPdOffset, ipdMax, swap->external_pdr_size, void *);
+ READ (external_sym, cbSymOffset, isymMax, swap->external_sym_size, void *);
+ READ (external_opt, cbOptOffset, ioptMax, swap->external_opt_size, void *);
READ (external_aux, cbAuxOffset, iauxMax, sizeof (union aux_ext),
union aux_ext *);
READ (ss, cbSsOffset, issMax, sizeof (char), char *);
READ (ssext, cbSsExtOffset, issExtMax, sizeof (char), char *);
- READ (external_fdr, cbFdOffset, ifdMax, swap->external_fdr_size, PTR);
- READ (external_rfd, cbRfdOffset, crfd, swap->external_rfd_size, PTR);
- READ (external_ext, cbExtOffset, iextMax, swap->external_ext_size, PTR);
+ READ (external_fdr, cbFdOffset, ifdMax, swap->external_fdr_size, void *);
+ READ (external_rfd, cbRfdOffset, crfd, swap->external_rfd_size, void *);
+ READ (external_ext, cbExtOffset, iextMax, swap->external_ext_size, void *);
#undef READ
debug->fdr = NULL;
fraw_end = (fraw_src
+ fi->d.symbolic_header.ifdMax * external_fdr_size);
for (; fraw_src < fraw_end; fraw_src += external_fdr_size, fdr_ptr++)
- (*swap->swap_fdr_in) (abfd, (PTR) fraw_src, fdr_ptr);
+ (*swap->swap_fdr_in) (abfd, fraw_src, fdr_ptr);
elf_tdata (abfd)->find_line_info = fi;
};
static bfd_boolean
-elf64_alpha_output_extsym (struct alpha_elf_link_hash_entry *h, PTR data)
+elf64_alpha_output_extsym (struct alpha_elf_link_hash_entry *h, void * data)
{
struct extsym_info *einfo = (struct extsym_info *) data;
bfd_boolean strip;
static bfd_boolean
elf64_alpha_calc_got_offsets_for_symbol (struct alpha_elf_link_hash_entry *h,
- PTR arg ATTRIBUTE_UNUSED)
+ void * arg ATTRIBUTE_UNUSED)
{
struct alpha_elf_got_entry *gotent;
}
static bfd_boolean
-elf64_alpha_size_plt_section_1 (struct alpha_elf_link_hash_entry *h, PTR data)
+elf64_alpha_size_plt_section_1 (struct alpha_elf_link_hash_entry *h,
+ void * data)
{
asection *splt = (asection *) data;
struct alpha_elf_got_entry *gotent;
else
{
tsec_relocs = (_bfd_elf_link_read_relocs
- (info->abfd, info->tsec, (PTR) NULL,
+ (info->abfd, info->tsec, NULL,
(Elf_Internal_Rela *) NULL,
info->link_info->keep_memory));
if (tsec_relocs == NULL)
/* Load the relocations for this section. */
internal_relocs = (_bfd_elf_link_read_relocs
- (abfd, sec, (PTR) NULL, (Elf_Internal_Rela *) NULL,
+ (abfd, sec, NULL, (Elf_Internal_Rela *) NULL,
link_info->keep_memory));
if (internal_relocs == NULL)
return FALSE;
debug.external_ext = debug.external_ext_end = NULL;
mdebug_handle = bfd_ecoff_debug_init (abfd, &debug, swap, info);
- if (mdebug_handle == (PTR) NULL)
+ if (mdebug_handle == NULL)
return FALSE;
if (1)
const char *name;
struct alpha_elf_link_hash_entry *h;
- (*input_swap->swap_ext_in) (input_bfd, (PTR) eraw_src, &ext);
+ (*input_swap->swap_ext_in) (input_bfd, eraw_src, &ext);
if (ext.asym.sc == scNil
|| ext.asym.sc == scUndefined
|| ext.asym.sc == scSUndefined)
einfo.failed = FALSE;
elf_link_hash_traverse (elf_hash_table (info),
elf64_alpha_output_extsym,
- (PTR) &einfo);
+ &einfo);
if (einfo.failed)
return FALSE;
struct bpo_reloc_request *reloc_request;
};
-static int mmix_elf_link_output_symbol_hook
- PARAMS ((struct bfd_link_info *, const char *, Elf_Internal_Sym *,
- asection *, struct elf_link_hash_entry *));
-static bfd_reloc_status_type mmix_elf_reloc
- PARAMS ((bfd *, arelent *, asymbol *, PTR, asection *, bfd *, char **));
+extern bfd_boolean mmix_elf_final_link (bfd *, struct bfd_link_info *);
-static reloc_howto_type *bfd_elf64_bfd_reloc_type_lookup
- PARAMS ((bfd *, bfd_reloc_code_real_type));
-
-static void mmix_info_to_howto_rela
- PARAMS ((bfd *, arelent *, Elf_Internal_Rela *));
-
-static int mmix_elf_sort_relocs PARAMS ((const PTR, const PTR));
-
-static bfd_boolean mmix_elf_new_section_hook
- PARAMS ((bfd *, asection *));
-
-static bfd_boolean mmix_elf_check_relocs
- PARAMS ((bfd *, struct bfd_link_info *, asection *,
- const Elf_Internal_Rela *));
-
-static bfd_boolean mmix_elf_check_common_relocs
- PARAMS ((bfd *, struct bfd_link_info *, asection *,
- const Elf_Internal_Rela *));
-
-static bfd_boolean mmix_elf_relocate_section
- PARAMS ((bfd *, struct bfd_link_info *, bfd *, asection *, bfd_byte *,
- Elf_Internal_Rela *, Elf_Internal_Sym *, asection **));
-
-static bfd_reloc_status_type mmix_final_link_relocate
- (reloc_howto_type *, asection *, bfd_byte *, bfd_vma, bfd_signed_vma,
- bfd_vma, const char *, asection *, char **);
-
-static bfd_reloc_status_type mmix_elf_perform_relocation
- (asection *, reloc_howto_type *, void *, bfd_vma, bfd_vma, char **);
-
-static bfd_boolean mmix_elf_section_from_bfd_section
- PARAMS ((bfd *, asection *, int *));
-
-static bfd_boolean mmix_elf_add_symbol_hook
- PARAMS ((bfd *, struct bfd_link_info *, Elf_Internal_Sym *,
- const char **, flagword *, asection **, bfd_vma *));
-
-static bfd_boolean mmix_elf_is_local_label_name
- PARAMS ((bfd *, const char *));
-
-static int bpo_reloc_request_sort_fn PARAMS ((const PTR, const PTR));
-
-static bfd_boolean mmix_elf_relax_section
- PARAMS ((bfd *abfd, asection *sec, struct bfd_link_info *link_info,
- bfd_boolean *again));
-
-extern bfd_boolean mmix_elf_final_link PARAMS ((bfd *, struct bfd_link_info *));
-
-extern void mmix_elf_symbol_processing PARAMS ((bfd *, asymbol *));
+extern void mmix_elf_symbol_processing (bfd *, asymbol *);
/* Only intended to be called from a debugger. */
extern void mmix_dump_bpo_gregs
- PARAMS ((struct bfd_link_info *, bfd_error_handler_type));
+ (struct bfd_link_info *, bfd_error_handler_type);
static void
-mmix_set_relaxable_size
- PARAMS ((bfd *, asection *, void *));
+mmix_set_relaxable_size (bfd *, asection *, void *);
+static bfd_reloc_status_type
+mmix_elf_reloc (bfd *, arelent *, asymbol *, void *,
+ asection *, bfd *, char **);
+static bfd_reloc_status_type
+mmix_final_link_relocate (reloc_howto_type *, asection *, bfd_byte *, bfd_vma,
+ bfd_signed_vma, bfd_vma, const char *, asection *,
+ char **);
/* Watch out: this currently needs to have elements with the same index as
};
static reloc_howto_type *
-bfd_elf64_bfd_reloc_type_lookup (abfd, code)
- bfd *abfd ATTRIBUTE_UNUSED;
- bfd_reloc_code_real_type code;
+bfd_elf64_bfd_reloc_type_lookup (bfd *abfd ATTRIBUTE_UNUSED,
+ bfd_reloc_code_real_type code)
{
unsigned int i;
}
static bfd_boolean
-mmix_elf_new_section_hook (abfd, sec)
- bfd *abfd;
- asection *sec;
+mmix_elf_new_section_hook (bfd *abfd, asection *sec)
{
if (!sec->used_by_bfd)
{
/* Set the howto pointer for an MMIX ELF reloc (type RELA). */
static void
-mmix_info_to_howto_rela (abfd, cache_ptr, dst)
- bfd *abfd ATTRIBUTE_UNUSED;
- arelent *cache_ptr;
- Elf_Internal_Rela *dst;
+mmix_info_to_howto_rela (bfd *abfd ATTRIBUTE_UNUSED,
+ arelent *cache_ptr,
+ Elf_Internal_Rela *dst)
{
unsigned int r_type;
the reloc_table. We don't get here for final pure ELF linking. */
static bfd_reloc_status_type
-mmix_elf_reloc (abfd, reloc_entry, symbol, data, input_section,
- output_bfd, error_message)
- bfd *abfd;
- arelent *reloc_entry;
- asymbol *symbol;
- PTR data;
- asection *input_section;
- bfd *output_bfd;
- char **error_message;
+mmix_elf_reloc (bfd *abfd,
+ arelent *reloc_entry,
+ asymbol *symbol,
+ void * data,
+ asection *input_section,
+ bfd *output_bfd,
+ char **error_message)
{
bfd_vma relocation;
bfd_reloc_status_type r;
for guidance if you're thinking of copying this. */
static bfd_boolean
-mmix_elf_relocate_section (output_bfd, info, input_bfd, input_section,
- contents, relocs, local_syms, local_sections)
- bfd *output_bfd ATTRIBUTE_UNUSED;
- 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;
+mmix_elf_relocate_section (bfd *output_bfd ATTRIBUTE_UNUSED,
+ 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;
/* Sort register relocs to come before expanding relocs. */
static int
-mmix_elf_sort_relocs (p1, p2)
- const PTR p1;
- const PTR p2;
+mmix_elf_sort_relocs (const void * p1, const void * p2)
{
const Elf_Internal_Rela *r1 = (const Elf_Internal_Rela *) p1;
const Elf_Internal_Rela *r2 = (const Elf_Internal_Rela *) p2;
/* Subset of mmix_elf_check_relocs, common to ELF and mmo linking. */
static bfd_boolean
-mmix_elf_check_common_relocs (abfd, info, sec, relocs)
- bfd *abfd;
- struct bfd_link_info *info;
- asection *sec;
- const Elf_Internal_Rela *relocs;
+mmix_elf_check_common_relocs (bfd *abfd,
+ struct bfd_link_info *info,
+ asection *sec,
+ const Elf_Internal_Rela *relocs)
{
bfd *bpo_greg_owner = NULL;
asection *allocated_gregs_section = NULL;
if (bpo_greg_owner == NULL)
{
bpo_greg_owner = abfd;
- info->base_file = (PTR) bpo_greg_owner;
+ info->base_file = bpo_greg_owner;
}
if (allocated_gregs_section == NULL)
/* Look through the relocs for a section during the first phase. */
static bfd_boolean
-mmix_elf_check_relocs (abfd, info, sec, relocs)
- bfd *abfd;
- struct bfd_link_info *info;
- asection *sec;
- const Elf_Internal_Rela *relocs;
+mmix_elf_check_relocs (bfd *abfd,
+ struct bfd_link_info *info,
+ asection *sec,
+ const Elf_Internal_Rela *relocs)
{
Elf_Internal_Shdr *symtab_hdr;
struct elf_link_hash_entry **sym_hashes;
/* First we sort the relocs so that any register relocs come before
expansion-relocs to the same insn. FIXME: Not done for mmo. */
- qsort ((PTR) relocs, sec->reloc_count, sizeof (Elf_Internal_Rela),
+ qsort ((void *) relocs, sec->reloc_count, sizeof (Elf_Internal_Rela),
mmix_elf_sort_relocs);
/* Do the common part. */
Copied from elf_link_add_object_symbols. */
bfd_boolean
-_bfd_mmix_check_all_relocs (abfd, info)
- bfd *abfd;
- struct bfd_link_info *info;
+_bfd_mmix_check_all_relocs (bfd *abfd, struct bfd_link_info *info)
{
asection *o;
continue;
internal_relocs
- = _bfd_elf_link_read_relocs (abfd, o, (PTR) NULL,
+ = _bfd_elf_link_read_relocs (abfd, o, NULL,
(Elf_Internal_Rela *) NULL,
info->keep_memory);
if (internal_relocs == NULL)
number. */
static int
-mmix_elf_link_output_symbol_hook (info, name, sym, input_sec, h)
- struct bfd_link_info *info ATTRIBUTE_UNUSED;
- const char *name ATTRIBUTE_UNUSED;
- Elf_Internal_Sym *sym;
- asection *input_sec;
- struct elf_link_hash_entry *h ATTRIBUTE_UNUSED;
+mmix_elf_link_output_symbol_hook (struct bfd_link_info *info ATTRIBUTE_UNUSED,
+ const char *name ATTRIBUTE_UNUSED,
+ Elf_Internal_Sym *sym,
+ asection *input_sec,
+ struct elf_link_hash_entry *h ATTRIBUTE_UNUSED)
{
if (input_sec != NULL
&& input_sec->name != NULL
index. */
static bfd_boolean
-mmix_elf_section_from_bfd_section (abfd, sec, retval)
- bfd * abfd ATTRIBUTE_UNUSED;
- asection * sec;
- int * retval;
+mmix_elf_section_from_bfd_section (bfd * abfd ATTRIBUTE_UNUSED,
+ asection * sec,
+ int * retval)
{
if (strcmp (bfd_get_section_name (abfd, sec), MMIX_REG_SECTION_NAME) == 0)
*retval = SHN_REGISTER;
symbols, since otherwise having two with the same value would cause
them to be "merged", but with the contents serialized. */
-bfd_boolean
-mmix_elf_add_symbol_hook (abfd, info, sym, namep, flagsp, secp, valp)
- bfd *abfd;
- struct bfd_link_info *info ATTRIBUTE_UNUSED;
- Elf_Internal_Sym *sym;
- const char **namep ATTRIBUTE_UNUSED;
- flagword *flagsp ATTRIBUTE_UNUSED;
- asection **secp;
- bfd_vma *valp ATTRIBUTE_UNUSED;
+static bfd_boolean
+mmix_elf_add_symbol_hook (bfd *abfd,
+ struct bfd_link_info *info ATTRIBUTE_UNUSED,
+ Elf_Internal_Sym *sym,
+ const char **namep ATTRIBUTE_UNUSED,
+ flagword *flagsp ATTRIBUTE_UNUSED,
+ asection **secp,
+ bfd_vma *valp ATTRIBUTE_UNUSED)
{
if (sym->st_shndx == SHN_REGISTER)
{
/* We consider symbols matching "L.*:[0-9]+" to be local symbols. */
-bfd_boolean
-mmix_elf_is_local_label_name (abfd, name)
- bfd *abfd;
- const char *name;
+static bfd_boolean
+mmix_elf_is_local_label_name (bfd *abfd, const char *name)
{
const char *colpos;
int digits;
/* We get rid of the register section here. */
bfd_boolean
-mmix_elf_final_link (abfd, info)
- bfd *abfd;
- struct bfd_link_info *info;
+mmix_elf_final_link (bfd *abfd, struct bfd_link_info *info)
{
/* We never output a register section, though we create one for
temporary measures. Check that nobody entered contents into it. */
section size. This is expected to shrink during linker relaxation. */
static void
-mmix_set_relaxable_size (abfd, sec, ptr)
- bfd *abfd ATTRIBUTE_UNUSED;
- asection *sec;
- void *ptr;
+mmix_set_relaxable_size (bfd *abfd ATTRIBUTE_UNUSED,
+ asection *sec,
+ void *ptr)
{
struct bfd_link_info *info = ptr;
R_MMIX_BASE_PLUS_OFFSET relocs seen by the linker. */
bfd_boolean
-_bfd_mmix_before_linker_allocation (abfd, info)
- bfd *abfd ATTRIBUTE_UNUSED;
- struct bfd_link_info *info;
+_bfd_mmix_before_linker_allocation (bfd *abfd ATTRIBUTE_UNUSED,
+ struct bfd_link_info *info)
{
asection *bpo_gregs_section;
bfd *bpo_greg_owner;
calculated at this point; we just move the contents into place here. */
bfd_boolean
-_bfd_mmix_after_linker_allocation (abfd, link_info)
- bfd *abfd ATTRIBUTE_UNUSED;
- struct bfd_link_info *link_info;
+_bfd_mmix_after_linker_allocation (bfd *abfd ATTRIBUTE_UNUSED,
+ struct bfd_link_info *link_info)
{
asection *bpo_gregs_section;
bfd *bpo_greg_owner;
value. */
static int
-bpo_reloc_request_sort_fn (p1, p2)
- const PTR p1;
- const PTR p2;
+bpo_reloc_request_sort_fn (const void * p1, const void * p2)
{
const struct bpo_reloc_request *r1 = (const struct bpo_reloc_request *) p1;
const struct bpo_reloc_request *r2 = (const struct bpo_reloc_request *) p2;
Symbol- and reloc-reading infrastructure copied from elf-m10200.c. */
static bfd_boolean
-mmix_elf_relax_section (abfd, sec, link_info, again)
- bfd *abfd;
- asection *sec;
- struct bfd_link_info *link_info;
- bfd_boolean *again;
+mmix_elf_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;
/* Get a copy of the native relocations. */
internal_relocs
- = _bfd_elf_link_read_relocs (abfd, sec, (PTR) NULL,
+ = _bfd_elf_link_read_relocs (abfd, sec, NULL,
(Elf_Internal_Rela *) NULL,
link_info->keep_memory);
if (internal_relocs == NULL)
gregdata->n_remaining_bpo_relocs_this_relaxation_round
= gregdata->n_bpo_relocs;
- qsort ((PTR) gregdata->reloc_request,
+ qsort (gregdata->reloc_request,
gregdata->n_max_bpo_relocs,
sizeof (struct bpo_reloc_request),
bpo_reloc_request_sort_fn);
#include "bfdlink.h"
#include "libbfd.h"
#include "elf-bfd.h"
-
-static reloc_howto_type *elf_s390_reloc_type_lookup
- PARAMS ((bfd *, bfd_reloc_code_real_type));
-static void elf_s390_info_to_howto
- PARAMS ((bfd *, arelent *, Elf_Internal_Rela *));
-static bfd_boolean elf_s390_is_local_label_name
- PARAMS ((bfd *, const char *));
-static struct bfd_hash_entry *link_hash_newfunc
- PARAMS ((struct bfd_hash_entry *, struct bfd_hash_table *, const char *));
-static struct bfd_link_hash_table *elf_s390_link_hash_table_create
- PARAMS ((bfd *));
-static bfd_boolean create_got_section
- PARAMS((bfd *, struct bfd_link_info *));
-static bfd_boolean elf_s390_create_dynamic_sections
- PARAMS((bfd *, struct bfd_link_info *));
-static void elf_s390_copy_indirect_symbol
- PARAMS ((struct bfd_link_info *, struct elf_link_hash_entry *,
- struct elf_link_hash_entry *));
-static bfd_boolean elf_s390_check_relocs
- PARAMS ((bfd *, struct bfd_link_info *, asection *,
- const Elf_Internal_Rela *));
-struct elf_s390_link_hash_entry;
-static void elf_s390_adjust_gotplt
- PARAMS ((struct elf_s390_link_hash_entry *));
-static bfd_boolean elf_s390_adjust_dynamic_symbol
- PARAMS ((struct bfd_link_info *, struct elf_link_hash_entry *));
-static bfd_boolean allocate_dynrelocs
- PARAMS ((struct elf_link_hash_entry *, PTR));
-static bfd_boolean readonly_dynrelocs
- PARAMS ((struct elf_link_hash_entry *, PTR));
-static bfd_boolean elf_s390_size_dynamic_sections
- PARAMS ((bfd *, struct bfd_link_info *));
-static bfd_boolean elf_s390_relocate_section
- PARAMS ((bfd *, struct bfd_link_info *, bfd *, asection *, bfd_byte *,
- Elf_Internal_Rela *, Elf_Internal_Sym *, asection **));
-static bfd_boolean elf_s390_finish_dynamic_symbol
- PARAMS ((bfd *, struct bfd_link_info *, struct elf_link_hash_entry *,
- Elf_Internal_Sym *));
-static enum elf_reloc_type_class elf_s390_reloc_type_class
- PARAMS ((const Elf_Internal_Rela *));
-static bfd_boolean elf_s390_finish_dynamic_sections
- PARAMS ((bfd *, struct bfd_link_info *));
-static bfd_boolean elf_s390_object_p
- PARAMS ((bfd *));
-static int elf_s390_tls_transition
- PARAMS ((struct bfd_link_info *, int, int));
-static bfd_reloc_status_type s390_tls_reloc
- PARAMS ((bfd *, arelent *, asymbol *, PTR, asection *, bfd *, char **));
-static bfd_vma dtpoff_base
- PARAMS ((struct bfd_link_info *));
-static bfd_vma tpoff
- PARAMS ((struct bfd_link_info *, bfd_vma));
-static void invalid_tls_insn
- PARAMS ((bfd *, asection *, Elf_Internal_Rela *));
-static bfd_reloc_status_type s390_elf_ldisp_reloc
- PARAMS ((bfd *, arelent *, asymbol *, PTR, asection *, bfd *, char **));
-
#include "elf/s390.h"
/* In case we're on a 32-bit machine, construct a 64-bit "-1" value
from smaller values. Start with zero, widen, *then* decrement. */
#define MINUS_ONE (((bfd_vma)0) - 1)
+static bfd_reloc_status_type
+s390_tls_reloc (bfd *, arelent *, asymbol *, void *,
+ asection *, bfd *, char **);
+static bfd_reloc_status_type
+s390_elf_ldisp_reloc (bfd *, arelent *, asymbol *, void *,
+ asection *, bfd *, char **);
+
/* The relocation "howto" table. */
static reloc_howto_type elf_howto_table[] =
{
HOWTO (R_390_GNU_VTENTRY, 0,4,0,FALSE,0,complain_overflow_dont, _bfd_elf_rel_vtable_reloc_fn,"R_390_GNU_VTENTRY", FALSE,0,0, FALSE);
static reloc_howto_type *
-elf_s390_reloc_type_lookup (abfd, code)
- bfd *abfd ATTRIBUTE_UNUSED;
- bfd_reloc_code_real_type code;
+elf_s390_reloc_type_lookup (bfd *abfd ATTRIBUTE_UNUSED,
+ bfd_reloc_code_real_type code)
{
switch (code)
{
and elf64-s390.c has its own copy. */
static void
-elf_s390_info_to_howto (abfd, cache_ptr, dst)
- bfd *abfd ATTRIBUTE_UNUSED;
- arelent *cache_ptr;
- Elf_Internal_Rela *dst;
+elf_s390_info_to_howto (bfd *abfd ATTRIBUTE_UNUSED,
+ arelent *cache_ptr,
+ Elf_Internal_Rela *dst)
{
unsigned int r_type = ELF64_R_TYPE(dst->r_info);
switch (r_type)
/* A relocation function which doesn't do anything. */
static bfd_reloc_status_type
-s390_tls_reloc (abfd, reloc_entry, symbol, data, input_section,
- output_bfd, error_message)
- bfd *abfd ATTRIBUTE_UNUSED;
- arelent *reloc_entry;
- asymbol *symbol ATTRIBUTE_UNUSED;
- PTR data ATTRIBUTE_UNUSED;
- asection *input_section;
- bfd *output_bfd;
- char **error_message ATTRIBUTE_UNUSED;
+s390_tls_reloc (bfd *abfd ATTRIBUTE_UNUSED,
+ arelent *reloc_entry,
+ asymbol *symbol ATTRIBUTE_UNUSED,
+ void * data ATTRIBUTE_UNUSED,
+ asection *input_section,
+ bfd *output_bfd,
+ char **error_message ATTRIBUTE_UNUSED)
{
if (output_bfd)
reloc_entry->address += input_section->output_offset;
/* Handle the large displacement relocs. */
static bfd_reloc_status_type
-s390_elf_ldisp_reloc (abfd, reloc_entry, symbol, data, input_section,
- output_bfd, error_message)
- bfd *abfd;
- arelent *reloc_entry;
- asymbol *symbol;
- PTR data;
- asection *input_section;
- bfd *output_bfd;
- char **error_message ATTRIBUTE_UNUSED;
+s390_elf_ldisp_reloc (bfd *abfd,
+ arelent *reloc_entry,
+ asymbol *symbol,
+ void * data,
+ asection *input_section,
+ bfd *output_bfd,
+ char **error_message ATTRIBUTE_UNUSED)
{
reloc_howto_type *howto = reloc_entry->howto;
bfd_vma relocation;
}
static bfd_boolean
-elf_s390_is_local_label_name (abfd, name)
- bfd *abfd;
- const char *name;
+elf_s390_is_local_label_name (bfd *abfd, const char *name)
{
if (name[0] == '.' && (name[1] == 'X' || name[1] == 'L'))
return TRUE;
}
static bfd_boolean
-elf_s390_object_p (abfd)
- bfd *abfd;
+elf_s390_object_p (bfd *abfd)
{
/* Set the right machine number for an s390 elf32 file. */
return bfd_default_set_arch_mach (abfd, bfd_arch_s390, bfd_mach_s390_64);
/* Create an entry in an s390 ELF linker hash table. */
static struct bfd_hash_entry *
-link_hash_newfunc (entry, table, string)
- struct bfd_hash_entry *entry;
- struct bfd_hash_table *table;
- const char *string;
+link_hash_newfunc (struct bfd_hash_entry *entry,
+ struct bfd_hash_table *table,
+ const char *string)
{
/* Allocate the structure if it has not already been allocated by a
subclass. */
/* Create an s390 ELF linker hash table. */
static struct bfd_link_hash_table *
-elf_s390_link_hash_table_create (abfd)
- bfd *abfd;
+elf_s390_link_hash_table_create (bfd *abfd)
{
struct elf_s390_link_hash_table *ret;
bfd_size_type amt = sizeof (struct elf_s390_link_hash_table);
/* Copy the extra info we tack onto an elf_link_hash_entry. */
static void
-elf_s390_copy_indirect_symbol (info, dir, ind)
- struct bfd_link_info *info;
- struct elf_link_hash_entry *dir, *ind;
+elf_s390_copy_indirect_symbol (struct bfd_link_info *info,
+ struct elf_link_hash_entry *dir,
+ struct elf_link_hash_entry *ind)
{
struct elf_s390_link_hash_entry *edir, *eind;
}
static int
-elf_s390_tls_transition (info, r_type, is_local)
- struct bfd_link_info *info;
- int r_type;
- int is_local;
+elf_s390_tls_transition (struct bfd_link_info *info,
+ int r_type,
+ int is_local)
{
if (info->shared)
return r_type;
created (we're only linking static objects). */
static void
-elf_s390_adjust_gotplt (h)
- struct elf_s390_link_hash_entry *h;
+elf_s390_adjust_gotplt (struct elf_s390_link_hash_entry *h)
{
if (h->elf.root.type == bfd_link_hash_warning)
h = (struct elf_s390_link_hash_entry *) h->elf.root.u.i.link;
/* Find any dynamic relocs that apply to read-only sections. */
static bfd_boolean
-readonly_dynrelocs (h, inf)
- struct elf_link_hash_entry *h;
- PTR inf;
+readonly_dynrelocs (struct elf_link_hash_entry *h, void * inf)
{
struct elf_s390_link_hash_entry *eh;
struct elf_dyn_relocs *p;
/* Allocate global sym .plt and .got entries, and space for global
sym dynamic relocs. */
- elf_link_hash_traverse (&htab->elf, allocate_dynrelocs, (PTR) info);
+ elf_link_hash_traverse (&htab->elf, allocate_dynrelocs, info);
/* We now have determined the sizes of the various dynamic sections.
Allocate memory for them. */
then we need a DT_TEXTREL entry. */
if ((info->flags & DF_TEXTREL) == 0)
elf_link_hash_traverse (&htab->elf, readonly_dynrelocs,
- (PTR) info);
+ info);
if ((info->flags & DF_TEXTREL) != 0)
{
This is PT_TLS segment p_vaddr. */
static bfd_vma
-dtpoff_base (info)
- struct bfd_link_info *info;
+dtpoff_base (struct bfd_link_info *info)
{
/* If tls_sec is NULL, we should have signalled an error already. */
if (elf_hash_table (info)->tls_sec == NULL)
if STT_TLS virtual address is ADDRESS. */
static bfd_vma
-tpoff (info, address)
- struct bfd_link_info *info;
- bfd_vma address;
+tpoff (struct bfd_link_info *info, bfd_vma address)
{
struct elf_link_hash_table *htab = elf_hash_table (info);
instruction. */
static void
-invalid_tls_insn (input_bfd, input_section, rel)
- bfd *input_bfd;
- asection *input_section;
- Elf_Internal_Rela *rel;
+invalid_tls_insn (bfd *input_bfd,
+ asection *input_section,
+ Elf_Internal_Rela *rel)
{
reloc_howto_type *howto;
dynamic linker, before writing them out. */
static enum elf_reloc_type_class
-elf_s390_reloc_type_class (rela)
- const Elf_Internal_Rela *rela;
+elf_s390_reloc_type_class (const Elf_Internal_Rela *rela)
{
switch ((int) ELF64_R_TYPE (rela->r_info))
{
#define bfd_elf64_mkobject elf_s390_mkobject
#define elf_backend_object_p elf_s390_object_p
+/* Enable ELF64 archive functions. */
+#define bfd_elf64_archive_functions
+extern bfd_boolean bfd_elf64_archive_slurp_armap (bfd *);
+extern bfd_boolean bfd_elf64_archive_write_armap (bfd *, unsigned int, struct orl *, unsigned int, int);
+
+#define bfd_elf64_archive_slurp_extended_name_table _bfd_archive_coff_slurp_extended_name_table
+#define bfd_elf64_archive_construct_extended_name_table _bfd_archive_coff_construct_extended_name_table
+#define bfd_elf64_archive_truncate_arname _bfd_archive_coff_truncate_arname
+#define bfd_elf64_archive_read_ar_hdr _bfd_archive_coff_read_ar_hdr
+#define bfd_elf64_archive_write_ar_hdr _bfd_archive_coff_write_ar_hdr
+#define bfd_elf64_archive_openr_next_archived_file _bfd_archive_coff_openr_next_archived_file
+#define bfd_elf64_archive_get_elt_at_index _bfd_archive_coff_get_elt_at_index
+#define bfd_elf64_archive_generic_stat_arch_elt _bfd_archive_coff_generic_stat_arch_elt
+#define bfd_elf64_archive_update_armap_timestamp _bfd_archive_coff_update_armap_timestamp
+
#include "elf64-target.h"
Elf_Internal_Shdr *rel_hdr,
asymbol **symbols, bfd_boolean dynamic)
{
- PTR allocated = NULL;
+ void * allocated = NULL;
bfd_byte *native_relocs;
arelent *relent;
unsigned int i;
bfd_size_type count;
arelent *relents;
- allocated = (PTR) bfd_malloc (rel_hdr->sh_size);
+ allocated = bfd_malloc (rel_hdr->sh_size);
if (allocated == NULL)
goto error_return;
/* Write out the relocs. */
static void
-elf64_sparc_write_relocs (bfd *abfd, asection *sec, PTR data)
+elf64_sparc_write_relocs (bfd *abfd, asection *sec, void * data)
{
bfd_boolean *failedp = (bfd_boolean *) data;
Elf_Internal_Shdr *rela_hdr;
rela_hdr = elf_section_data (sec)->rela.hdr;
rela_hdr->sh_size = rela_hdr->sh_entsize * count;
- rela_hdr->contents = (PTR) bfd_alloc (abfd, rela_hdr->sh_size);
+ rela_hdr->contents = bfd_alloc (abfd, rela_hdr->sh_size);
if (rela_hdr->contents == NULL)
{
*failedp = TRUE;
static bfd_boolean
elf64_sparc_output_arch_syms (bfd *output_bfd ATTRIBUTE_UNUSED,
struct bfd_link_info *info,
- PTR flaginfo,
- int (*func) (PTR, const char *,
+ void * flaginfo,
+ int (*func) (void *, const char *,
Elf_Internal_Sym *,
asection *,
struct elf_link_hash_entry *))
/* Print a STT_REGISTER symbol to file FILE. */
static const char *
-elf64_sparc_print_symbol_all (bfd *abfd ATTRIBUTE_UNUSED, PTR filep,
+elf64_sparc_print_symbol_all (bfd *abfd ATTRIBUTE_UNUSED, void * filep,
asymbol *symbol)
{
FILE *file = (FILE *) filep;
(bfd *abfd, struct bfd_link_info *info, bfd_boolean final);
static void elfNN_ia64_dyn_sym_traverse
(struct elfNN_ia64_link_hash_table *ia64_info,
- bfd_boolean (*func) (struct elfNN_ia64_dyn_sym_info *, PTR),
- PTR info);
+ bfd_boolean (*func) (struct elfNN_ia64_dyn_sym_info *, void *),
+ void * info);
static bfd_boolean allocate_global_data_got
- (struct elfNN_ia64_dyn_sym_info *dyn_i, PTR data);
+ (struct elfNN_ia64_dyn_sym_info *dyn_i, void * data);
static bfd_boolean allocate_global_fptr_got
- (struct elfNN_ia64_dyn_sym_info *dyn_i, PTR data);
+ (struct elfNN_ia64_dyn_sym_info *dyn_i, void * data);
static bfd_boolean allocate_local_got
- (struct elfNN_ia64_dyn_sym_info *dyn_i, PTR data);
+ (struct elfNN_ia64_dyn_sym_info *dyn_i, void * data);
static bfd_boolean elfNN_ia64_hpux_vec
(const bfd_target *vec);
static bfd_boolean allocate_dynrel_entries
- (struct elfNN_ia64_dyn_sym_info *dyn_i, PTR data);
+ (struct elfNN_ia64_dyn_sym_info *dyn_i, void * data);
static asection *get_pltoff
(bfd *abfd, struct bfd_link_info *info,
struct elfNN_ia64_link_hash_table *ia64_info);
static bfd_boolean
elfNN_ia64_global_dyn_info_free (void **xentry,
- PTR unused ATTRIBUTE_UNUSED)
+ void * unused ATTRIBUTE_UNUSED)
{
struct elfNN_ia64_link_hash_entry *entry
= (struct elfNN_ia64_link_hash_entry *) xentry;
static bfd_boolean
elfNN_ia64_local_dyn_info_free (void **slot,
- PTR unused ATTRIBUTE_UNUSED)
+ void * unused ATTRIBUTE_UNUSED)
{
struct elfNN_ia64_local_hash_entry *entry
= (struct elfNN_ia64_local_hash_entry *) *slot;
struct elfNN_ia64_dyn_sym_traverse_data
{
- bfd_boolean (*func) (struct elfNN_ia64_dyn_sym_info *, PTR);
- PTR data;
+ bfd_boolean (*func) (struct elfNN_ia64_dyn_sym_info *, void *);
+ void * data;
};
static bfd_boolean
elfNN_ia64_global_dyn_sym_thunk (struct bfd_hash_entry *xentry,
- PTR xdata)
+ void * xdata)
{
struct elfNN_ia64_link_hash_entry *entry
= (struct elfNN_ia64_link_hash_entry *) xentry;
}
static bfd_boolean
-elfNN_ia64_local_dyn_sym_thunk (void **slot, PTR xdata)
+elfNN_ia64_local_dyn_sym_thunk (void **slot, void * xdata)
{
struct elfNN_ia64_local_hash_entry *entry
= (struct elfNN_ia64_local_hash_entry *) *slot;
static void
elfNN_ia64_dyn_sym_traverse (struct elfNN_ia64_link_hash_table *ia64_info,
- bfd_boolean (*func) (struct elfNN_ia64_dyn_sym_info *, PTR),
- PTR data)
+ bfd_boolean (*func) (struct elfNN_ia64_dyn_sym_info *, void *),
+ void * data)
{
struct elfNN_ia64_dyn_sym_traverse_data xdata;
static bfd_boolean
allocate_local_got (struct elfNN_ia64_dyn_sym_info *dyn_i,
- PTR data)
+ void * data)
{
struct elfNN_ia64_allocate_data *x = (struct elfNN_ia64_allocate_data *)data;
in a main executable that is not exported. */
static bfd_boolean
-allocate_fptr (struct elfNN_ia64_dyn_sym_info *dyn_i, PTR data)
+allocate_fptr (struct elfNN_ia64_dyn_sym_info *dyn_i, void * data)
{
struct elfNN_ia64_allocate_data *x = (struct elfNN_ia64_allocate_data *)data;
static bfd_boolean
allocate_plt_entries (struct elfNN_ia64_dyn_sym_info *dyn_i,
- PTR data)
+ void * data)
{
struct elfNN_ia64_allocate_data *x = (struct elfNN_ia64_allocate_data *)data;
static bfd_boolean
allocate_plt2_entries (struct elfNN_ia64_dyn_sym_info *dyn_i,
- PTR data)
+ void * data)
{
struct elfNN_ia64_allocate_data *x = (struct elfNN_ia64_allocate_data *)data;
static bfd_boolean
allocate_pltoff_entries (struct elfNN_ia64_dyn_sym_info *dyn_i,
- PTR data)
+ void * data)
{
struct elfNN_ia64_allocate_data *x = (struct elfNN_ia64_allocate_data *)data;
static bfd_boolean
allocate_dynrel_entries (struct elfNN_ia64_dyn_sym_info *dyn_i,
- PTR data)
+ void * data)
{
struct elfNN_ia64_allocate_data *x = (struct elfNN_ia64_allocate_data *)data;
struct elfNN_ia64_link_hash_table *ia64_info;
static bfd *elfNN_ia64_unwind_entry_compare_bfd;
static int
-elfNN_ia64_unwind_entry_compare (const PTR a, const PTR b)
+elfNN_ia64_unwind_entry_compare (const void * a, const void * b)
{
bfd_vma av, bv;
}
static bfd_boolean
-elfNN_ia64_print_private_bfd_data (bfd *abfd, PTR ptr)
+elfNN_ia64_print_private_bfd_data (bfd *abfd, void * ptr)
{
FILE *file = (FILE *) ptr;
flagword flags = elf_elfheader (abfd)->e_flags;
}
/* Allocate space for global sym dynamic relocs. */
- elf_link_hash_traverse (&htab->root, allocate_dynrelocs, (PTR) info);
+ elf_link_hash_traverse (&htab->root, allocate_dynrelocs, info);
mips_elf_estimate_stub_size (output_bfd, info);
/* Get a copy of the native relocations. */
internal_relocs = (_bfd_elf_link_read_relocs
- (abfd, sec, (PTR) NULL, (Elf_Internal_Rela *) NULL,
+ (abfd, sec, NULL, (Elf_Internal_Rela *) NULL,
link_info->keep_memory));
if (internal_relocs == NULL)
goto error_return;
static bfd_reloc_status_type
init_insn_reloc (bfd *abfd, arelent *reloc_entry, asymbol *symbol,
- PTR data, asection *input_section, bfd *output_bfd,
+ void * data, asection *input_section, bfd *output_bfd,
bfd_vma *prelocation, bfd_vma *pinsn)
{
bfd_vma relocation;
sparc_elf_notsup_reloc (bfd *abfd ATTRIBUTE_UNUSED,
arelent *reloc_entry ATTRIBUTE_UNUSED,
asymbol *symbol ATTRIBUTE_UNUSED,
- PTR data ATTRIBUTE_UNUSED,
+ void * data ATTRIBUTE_UNUSED,
asection *input_section ATTRIBUTE_UNUSED,
bfd *output_bfd ATTRIBUTE_UNUSED,
char **error_message ATTRIBUTE_UNUSED)
static bfd_reloc_status_type
sparc_elf_wdisp16_reloc (bfd *abfd, arelent *reloc_entry, asymbol *symbol,
- PTR data, asection *input_section, bfd *output_bfd,
+ void * data, asection *input_section, bfd *output_bfd,
char **error_message ATTRIBUTE_UNUSED)
{
bfd_vma relocation;
static bfd_reloc_status_type
sparc_elf_wdisp10_reloc (bfd *abfd, arelent *reloc_entry, asymbol *symbol,
- PTR data, asection *input_section, bfd *output_bfd,
+ void * data, asection *input_section, bfd *output_bfd,
char **error_message ATTRIBUTE_UNUSED)
{
bfd_vma relocation;
static bfd_reloc_status_type
sparc_elf_hix22_reloc (bfd *abfd, arelent *reloc_entry, asymbol *symbol,
- PTR data, asection *input_section, bfd *output_bfd,
+ void * data, asection *input_section, bfd *output_bfd,
char **error_message ATTRIBUTE_UNUSED)
{
bfd_vma relocation;
static bfd_reloc_status_type
sparc_elf_lox10_reloc (bfd *abfd, arelent *reloc_entry, asymbol *symbol,
- PTR data, asection *input_section, bfd *output_bfd,
+ void * data, asection *input_section, bfd *output_bfd,
char **error_message ATTRIBUTE_UNUSED)
{
bfd_vma relocation;
dynamic relocs. */
static bfd_boolean
-allocate_dynrelocs (struct elf_link_hash_entry *h, PTR inf)
+allocate_dynrelocs (struct elf_link_hash_entry *h, void * inf)
{
struct bfd_link_info *info;
struct _bfd_sparc_elf_link_hash_table *htab;
/* Find any dynamic relocs that apply to read-only sections. */
static bfd_boolean
-readonly_dynrelocs (struct elf_link_hash_entry *h, PTR inf)
+readonly_dynrelocs (struct elf_link_hash_entry *h, void * inf)
{
struct _bfd_sparc_elf_link_hash_entry *eh;
struct _bfd_sparc_elf_dyn_relocs *p;
/* Allocate global sym .plt and .got entries, and space for global
sym dynamic relocs. */
- elf_link_hash_traverse (&htab->elf, allocate_dynrelocs, (PTR) info);
+ elf_link_hash_traverse (&htab->elf, allocate_dynrelocs, info);
/* Allocate .plt and .got entries, and space for local symbols. */
htab_traverse (htab->loc_hash_table, allocate_local_dynrelocs, info);
/* If any dynamic relocs apply to a read-only section,
then we need a DT_TEXTREL entry. */
if ((info->flags & DF_TEXTREL) == 0)
- elf_link_hash_traverse (&htab->elf, readonly_dynrelocs,
- (PTR) info);
+ elf_link_hash_traverse (&htab->elf, readonly_dynrelocs, info);
if (info->flags & DF_TEXTREL)
{
/* hash.c -- hash table routines for BFD
Copyright 1993, 1994, 1995, 1997, 1999, 2001, 2002, 2003, 2004, 2005,
- 2006, 2007, 2009, 2010, 2011 Free Software Foundation, Inc.
+ 2006, 2007, 2009, 2010, 2011, 2012 Free Software Foundation, Inc.
Written by Steve Chamberlain <sac@cygnus.com>
This file is part of BFD, the Binary File Descriptor library.
table->frozen = 1;
return hashp;
}
- memset ((PTR) newtable, 0, alloc);
+ memset (newtable, 0, alloc);
for (hi = 0; hi < table->size; hi ++)
while (table->table[hi])
/* BFD backend for hp-ux 9000/300
Copyright 1990, 1991, 1993, 1994, 1995, 1997, 1999, 2000, 2001, 2002,
- 2003, 2004, 2005, 2007, 2010 Free Software Foundation, Inc.
+ 2003, 2004, 2005, 2007, 2010, 2012 Free Software Foundation, Inc.
Written by Glenn Engel.
This file is part of BFD, the Binary File Descriptor library.
#include "aoutx.h"
-static const bfd_target * MY (callback)
- PARAMS ((bfd *));
-static bfd_boolean MY (write_object_contents)
- PARAMS ((bfd *));
+static const bfd_target * MY (callback) (bfd *);
+static bfd_boolean MY (write_object_contents) (bfd *);
static void convert_sym_type
- PARAMS ((struct external_nlist *, aout_symbol_type *, bfd *));
+ (struct external_nlist *, aout_symbol_type *, bfd *);
-bfd_boolean MY (slurp_symbol_table)
- PARAMS ((bfd *));
+bfd_boolean MY (slurp_symbol_table) (bfd *);
void MY (swap_std_reloc_in)
- PARAMS ((bfd *, struct hp300hpux_reloc *, arelent *, asymbol **,
- bfd_size_type));
+ (bfd *, struct hp300hpux_reloc *, arelent *, asymbol **, bfd_size_type);
bfd_boolean MY (slurp_reloc_table)
- PARAMS ((bfd *, sec_ptr, asymbol **));
-long MY (canonicalize_symtab)
- PARAMS ((bfd *, asymbol **));
-long MY (get_symtab_upper_bound)
- PARAMS ((bfd *));
-long MY (canonicalize_reloc)
- PARAMS ((bfd *, sec_ptr, arelent **, asymbol **));
+ (bfd *, sec_ptr, asymbol **);
+long MY (canonicalize_symtab) (bfd *, asymbol **);
+long MY (get_symtab_upper_bound) (bfd *);
+long MY (canonicalize_reloc) (bfd *, sec_ptr, arelent **, asymbol **);
/* Since the hpux symbol table has nlist elements interspersed with
strings and we need to insert som strings for secondary symbols, we
/* Set parameters about this a.out file that are machine-dependent.
This routine is called from some_aout_object_p just before it returns. */
static const bfd_target *
-MY (callback) (abfd)
- bfd *abfd;
+MY (callback) (bfd *abfd)
{
struct internal_exec *execp = exec_hdr (abfd);
return abfd->xvec;
}
-extern bfd_boolean aout_32_write_syms
- PARAMS ((bfd * abfd));
+extern bfd_boolean aout_32_write_syms (bfd *);
static bfd_boolean
-MY (write_object_contents) (abfd)
- bfd *abfd;
+MY (write_object_contents) (bfd * abfd)
{
struct external_exec exec_bytes;
struct internal_exec *execp = exec_hdr (abfd);
H_PUT_32 (abfd, (bfd_get_symcount (abfd) * 12), exec_bytes.e_drelocs);
if (bfd_seek (abfd, (file_ptr) 0, FALSE) != 0
- || (bfd_bwrite ((PTR) &exec_bytes, (bfd_size_type) EXEC_BYTES_SIZE, abfd)
+ || (bfd_bwrite (&exec_bytes, (bfd_size_type) EXEC_BYTES_SIZE, abfd)
!= EXEC_BYTES_SIZE))
return FALSE;
return TRUE;
}
-/* convert the hp symbol type to be the same as aout64.h usage so we */
-/* can piggyback routines in aoutx.h. */
+/* Convert the hp symbol type to be the same as aout64.h usage so we
+ can piggyback routines in aoutx.h. */
static void
-convert_sym_type (sym_pointer, cache_ptr, abfd)
- struct external_nlist *sym_pointer ATTRIBUTE_UNUSED;
- aout_symbol_type *cache_ptr;
- bfd *abfd ATTRIBUTE_UNUSED;
+convert_sym_type (struct external_nlist *sym_pointer ATTRIBUTE_UNUSED,
+ aout_symbol_type *cache_ptr,
+ bfd *abfd ATTRIBUTE_UNUSED)
{
int name_type;
int new_type;
*/
void
-NAME (aout,swap_exec_header_in) (abfd, raw_bytes, execp)
- bfd *abfd;
- struct external_exec *raw_bytes;
- struct internal_exec *execp;
+NAME (aout,swap_exec_header_in) (bfd *abfd,
+ struct external_exec *raw_bytes,
+ struct internal_exec *execp)
{
struct external_exec *bytes = (struct external_exec *) raw_bytes;
*/
bfd_boolean
-MY (slurp_symbol_table) (abfd)
- bfd *abfd;
+MY (slurp_symbol_table) (bfd *abfd)
{
bfd_size_type symbol_bytes;
struct external_nlist *syms;
return FALSE;
syms = (struct external_nlist *) (strings + SYM_EXTRA_BYTES);
if (bfd_seek (abfd, obj_sym_filepos (abfd), SEEK_SET) != 0
- || bfd_bread ((PTR) syms, symbol_bytes, abfd) != symbol_bytes)
+ || bfd_bread (syms, symbol_bytes, abfd) != symbol_bytes)
{
bfd_release (abfd, syms);
return FALSE;
}
void
-MY (swap_std_reloc_in) (abfd, bytes, cache_ptr, symbols, symcount)
- bfd *abfd;
- struct hp300hpux_reloc *bytes;
- arelent *cache_ptr;
- asymbol **symbols;
- bfd_size_type symcount ATTRIBUTE_UNUSED;
+MY (swap_std_reloc_in) (bfd *abfd,
+ struct hp300hpux_reloc *bytes,
+ arelent *cache_ptr,
+ asymbol **symbols,
+ bfd_size_type symcount ATTRIBUTE_UNUSED)
{
int r_index;
int r_extern = 0;
}
bfd_boolean
-MY (slurp_reloc_table) (abfd, asect, symbols)
- bfd *abfd;
- sec_ptr asect;
- asymbol **symbols;
+MY (slurp_reloc_table) (bfd *abfd, sec_ptr asect, asymbol **symbols)
{
bfd_size_type count;
bfd_size_type reloc_size;
- PTR relocs;
+ void * relocs;
arelent *reloc_cache;
size_t each_size;
struct hp300hpux_reloc *rptr;
if (!reloc_cache && count != 0)
return FALSE;
- relocs = (PTR) bfd_alloc (abfd, reloc_size);
+ relocs = bfd_alloc (abfd, reloc_size);
if (!relocs && reloc_size != 0)
{
bfd_release (abfd, reloc_cache);
/* call aout_32 versions if the input file was generated by gcc */
/************************************************************************/
-long aout_32_canonicalize_symtab
- PARAMS ((bfd * abfd, asymbol ** location));
-long aout_32_get_symtab_upper_bound
- PARAMS ((bfd * abfd));
-long aout_32_canonicalize_reloc
- PARAMS ((bfd * abfd, sec_ptr section, arelent ** relptr,
- asymbol ** symbols));
+long aout_32_canonicalize_symtab (bfd *, asymbol **);
+long aout_32_get_symtab_upper_bound (bfd *);
+long aout_32_canonicalize_reloc (bfd *, sec_ptr, arelent **, asymbol **);
long
-MY (canonicalize_symtab) (abfd, location)
- bfd *abfd;
- asymbol **location;
+MY (canonicalize_symtab) (bfd *abfd, asymbol **location)
{
unsigned int counter = 0;
aout_symbol_type *symbase;
}
long
-MY (get_symtab_upper_bound) (abfd)
- bfd *abfd;
+MY (get_symtab_upper_bound) (bfd *abfd)
{
if (obj_aout_subformat (abfd) == gnu_encap_format)
return aout_32_get_symtab_upper_bound (abfd);
}
long
-MY (canonicalize_reloc) (abfd, section, relptr, symbols)
- bfd *abfd;
- sec_ptr section;
- arelent **relptr;
- asymbol **symbols;
+MY (canonicalize_reloc) (bfd *abfd,
+ sec_ptr section,
+ arelent **relptr,
+ asymbol **symbols)
{
arelent *tblptr = section->relocation;
unsigned int count;
+
if (obj_aout_subformat (abfd) == gnu_encap_format)
return aout_32_canonicalize_reloc (abfd, section, relptr, symbols);
/* BFD back-end for HPPA BSD core files.
Copyright 1993, 1994, 1995, 1998, 1999, 2001, 2002, 2003, 2004, 2005,
- 2006, 2007 Free Software Foundation, Inc.
+ 2006, 2007, 2012 Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library.
#include <sys/user.h> /* After a.out.h */
#include <sys/file.h>
-static asection *make_bfd_asection
- PARAMS ((bfd *, const char *, flagword, bfd_size_type, file_ptr,
- unsigned int));
-static const bfd_target *hppabsd_core_core_file_p
- PARAMS ((bfd *));
-static char *hppabsd_core_core_file_failing_command
- PARAMS ((bfd *));
-static int hppabsd_core_core_file_failing_signal
- PARAMS ((bfd *));
#define hppabsd_core_core_file_matches_executable_p generic_core_file_matches_executable_p
#define hppabsd_core_core_file_pid _bfd_nocore_core_file_pid
-static void swap_abort
- PARAMS ((void));
/* These are stored in the bfd's tdata. */
struct hppabsd_core_struct
- {
- int sig;
- char cmd[MAXCOMLEN + 1];
- asection *data_section;
- asection *stack_section;
- asection *reg_section;
- };
+{
+ int sig;
+ char cmd[MAXCOMLEN + 1];
+ asection *data_section;
+ asection *stack_section;
+ asection *reg_section;
+};
#define core_hdr(bfd) ((bfd)->tdata.hppabsd_core_data)
-#define core_signal(bfd) (core_hdr(bfd)->sig)
-#define core_command(bfd) (core_hdr(bfd)->cmd)
-#define core_datasec(bfd) (core_hdr(bfd)->data_section)
+#define core_signal(bfd) (core_hdr(bfd)->sig)
+#define core_command(bfd) (core_hdr(bfd)->cmd)
+#define core_datasec(bfd) (core_hdr(bfd)->data_section)
#define core_stacksec(bfd) (core_hdr(bfd)->stack_section)
-#define core_regsec(bfd) (core_hdr(bfd)->reg_section)
+#define core_regsec(bfd) (core_hdr(bfd)->reg_section)
static asection *
-make_bfd_asection (abfd, name, flags, size, offset, alignment_power)
- bfd *abfd;
- const char *name;
- flagword flags;
- bfd_size_type size;
- file_ptr offset;
- unsigned int alignment_power;
+make_bfd_asection (bfd *abfd,
+ const char *name,
+ flagword flags,
+ bfd_size_type size,
+ file_ptr offset,
+ unsigned int alignment_power)
{
asection *asect;
}
static const bfd_target *
-hppabsd_core_core_file_p (abfd)
- bfd *abfd;
+hppabsd_core_core_file_p (bfd *abfd)
{
int val;
struct user u;
}
static char *
-hppabsd_core_core_file_failing_command (abfd)
- bfd *abfd;
+hppabsd_core_core_file_failing_command (bfd *abfd)
{
return core_command (abfd);
}
static int
-hppabsd_core_core_file_failing_signal (abfd)
- bfd *abfd;
+hppabsd_core_core_file_failing_signal (bfd *abfd)
{
return core_signal (abfd);
}
\f
/* If somebody calls any byte-swapping routines, shoot them. */
static void
-swap_abort ()
+swap_abort (void)
{
/* This way doesn't require any declaration for ANSI to fuck up. */
abort ();
NULL,
- (PTR) 0 /* backend_data */
+ NULL /* backend_data */
};
#endif
/* BFD back-end for HP/UX core files.
Copyright 1993, 1994, 1996, 1998, 1999, 2001, 2002, 2003, 2004, 2005, 2006,
- 2007, 2008, 2010, 2011 Free Software Foundation, Inc.
+ 2007, 2008, 2010, 2011, 2012 Free Software Foundation, Inc.
Written by Stu Grossman, Cygnus Support.
Converted to back-end form by Ian Lance Taylor, Cygnus SUpport
NULL,
- (PTR) 0 /* backend_data */
+ NULL /* backend_data */
};
/* BFD back-end for i386 a.out binaries under dynix.
- Copyright 1994, 1995, 2001, 2003, 2005, 2007 Free Software Foundation, Inc.
+ Copyright 1994, 1995, 2001, 2003, 2005, 2007, 2012
+ Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library.
#define a_shdrsize a_dload
void
-i386dynix_32_swap_exec_header_in (abfd, raw_bytes, execp)
- bfd *abfd;
- struct external_exec *raw_bytes;
- struct internal_exec *execp;
+i386dynix_32_swap_exec_header_in (bfd *abfd,
+ struct external_exec *raw_bytes,
+ struct internal_exec *execp)
{
struct external_exec *bytes = (struct external_exec *)raw_bytes;
configuration (IE for i960), so ensure that all such uninitialized
fields are zero'd out. There are places where two of these structs
are memcmp'd, and thus the contents do matter. */
- memset ((PTR) execp, 0, sizeof (struct internal_exec));
+ memset (execp, 0, sizeof (struct internal_exec));
/* Now fill in fields in the execp, from the bytes in the raw data. */
execp->a_info = H_GET_32 (abfd, bytes->e_info);
execp->a_text = GET_WORD (abfd, bytes->e_text);
/* BFD back-end for linux flavored i386 a.out binaries.
Copyright 1992, 1993, 1994, 1995, 1996, 1997, 1999, 2001, 2002, 2003,
- 2004, 2005, 2006, 2007, 2008, 2009, 2011 Free Software Foundation, Inc.
+ 2004, 2005, 2006, 2007, 2008, 2009, 2011, 2012
+ Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library.
becomes important. */
static void MY_final_link_callback
- PARAMS ((bfd *, file_ptr *, file_ptr *, file_ptr *));
+ (bfd *, file_ptr *, file_ptr *, file_ptr *);
static bfd_boolean i386linux_bfd_final_link
- PARAMS ((bfd *, struct bfd_link_info *));
-static bfd_boolean i386linux_write_object_contents PARAMS ((bfd *));
+ (bfd *, struct bfd_link_info *);
+static bfd_boolean i386linux_write_object_contents (bfd *);
static bfd_boolean
-i386linux_bfd_final_link (abfd, info)
- bfd *abfd;
- struct bfd_link_info *info;
+i386linux_bfd_final_link (bfd *abfd, struct bfd_link_info *info)
{
obj_aout_subformat (abfd) = q_magic_format;
return NAME(aout,final_link) (abfd, info, MY_final_link_callback);
/* Set the machine type correctly. */
static bfd_boolean
-i386linux_write_object_contents (abfd)
- bfd *abfd;
+i386linux_write_object_contents (bfd *abfd)
{
struct external_exec exec_bytes;
struct internal_exec *execp = exec_hdr (abfd);
struct fixup *fixup_list;
};
-static struct bfd_hash_entry *linux_link_hash_newfunc
- PARAMS ((struct bfd_hash_entry *, struct bfd_hash_table *, const char *));
-static struct bfd_link_hash_table *linux_link_hash_table_create
- PARAMS ((bfd *));
-static struct fixup *new_fixup
- PARAMS ((struct bfd_link_info *, struct linux_link_hash_entry *,
- bfd_vma, int));
-static bfd_boolean linux_link_create_dynamic_sections
- PARAMS ((bfd *, struct bfd_link_info *));
-static bfd_boolean linux_add_one_symbol
- PARAMS ((struct bfd_link_info *, bfd *, const char *, flagword, asection *,
- bfd_vma, const char *, bfd_boolean, bfd_boolean,
- struct bfd_link_hash_entry **));
-static bfd_boolean linux_tally_symbols
- PARAMS ((struct linux_link_hash_entry *, PTR));
-static bfd_boolean linux_finish_dynamic_link
- PARAMS ((bfd *, struct bfd_link_info *));
-
/* Routine to create an entry in an Linux link hash table. */
static struct bfd_hash_entry *
-linux_link_hash_newfunc (entry, table, string)
- struct bfd_hash_entry *entry;
- struct bfd_hash_table *table;
- const char *string;
+linux_link_hash_newfunc (struct bfd_hash_entry *entry,
+ struct bfd_hash_table *table,
+ const char *string)
{
struct linux_link_hash_entry *ret = (struct linux_link_hash_entry *) entry;
/* Create a Linux link hash table. */
static struct bfd_link_hash_table *
-linux_link_hash_table_create (abfd)
- bfd *abfd;
+linux_link_hash_table_create (bfd *abfd)
{
struct linux_link_hash_table *ret;
bfd_size_type amt = sizeof (struct linux_link_hash_table);
#define linux_link_hash_traverse(table, func, info) \
(aout_link_hash_traverse \
(&(table)->root, \
- (bfd_boolean (*) PARAMS ((struct aout_link_hash_entry *, PTR))) (func), \
+ (bfd_boolean (*) (struct aout_link_hash_entry *, void *)) (func), \
(info)))
/* Get the Linux link hash table from the info structure. This is
/* Store the information for a new fixup. */
static struct fixup *
-new_fixup (info, h, value, builtin)
- struct bfd_link_info *info;
- struct linux_link_hash_entry *h;
- bfd_vma value;
- int builtin;
+new_fixup (struct bfd_link_info *info,
+ struct linux_link_hash_entry *h,
+ bfd_vma value,
+ int builtin)
{
struct fixup *f;
create it for now. */
static bfd_boolean
-linux_link_create_dynamic_sections (abfd, info)
- bfd *abfd;
- struct bfd_link_info *info ATTRIBUTE_UNUSED;
+linux_link_create_dynamic_sections (bfd *abfd,
+ struct bfd_link_info *info ATTRIBUTE_UNUSED)
{
flagword flags;
- register asection *s;
+ asection *s;
/* Note that we set the SEC_IN_MEMORY flag. */
flags = SEC_ALLOC | SEC_LOAD | SEC_HAS_CONTENTS | SEC_IN_MEMORY;
tweaking needed for dynamic linking support. */
static bfd_boolean
-linux_add_one_symbol (info, abfd, name, flags, section, value, string,
- copy, collect, hashp)
- struct bfd_link_info *info;
- bfd *abfd;
- const char *name;
- flagword flags;
- asection *section;
- bfd_vma value;
- const char *string;
- bfd_boolean copy;
- bfd_boolean collect;
- struct bfd_link_hash_entry **hashp;
+linux_add_one_symbol (struct bfd_link_info *info,
+ bfd *abfd,
+ const char *name,
+ flagword flags,
+ asection *section,
+ bfd_vma value,
+ const char *string,
+ bfd_boolean copy,
+ bfd_boolean collect,
+ struct bfd_link_hash_entry **hashp)
{
struct linux_link_hash_entry *h;
bfd_boolean insert;
This function is called via linux_link_hash_traverse. */
static bfd_boolean
-linux_tally_symbols (h, data)
- struct linux_link_hash_entry *h;
- PTR data;
+linux_tally_symbols (struct linux_link_hash_entry *h, void * data)
{
struct bfd_link_info *info = (struct bfd_link_info *) data;
struct fixup *f, *f1;
are required. */
bfd_boolean
-bfd_i386linux_size_dynamic_sections (output_bfd, info)
- bfd *output_bfd;
- struct bfd_link_info *info;
+bfd_i386linux_size_dynamic_sections (bfd *output_bfd,
+ struct bfd_link_info *info)
{
struct fixup *f;
asection *s;
/* First find the fixups... */
linux_link_hash_traverse (linux_hash_table (info),
linux_tally_symbols,
- (PTR) info);
+ info);
/* If there are builtin fixups, leave room for a marker. This is
used by the dynamic linker so that it knows that all that follow
the stuff we need. */
static bfd_boolean
-linux_finish_dynamic_link (output_bfd, info)
- bfd *output_bfd;
- struct bfd_link_info *info;
+linux_finish_dynamic_link (bfd *output_bfd,
+ struct bfd_link_info *info)
{
asection *s, *os, *is;
bfd_byte *fixup_table;
SEEK_SET) != 0)
return FALSE;
- if (bfd_bwrite ((PTR) s->contents, s->size, output_bfd) != s->size)
+ if (bfd_bwrite (s->contents, s->size, output_bfd) != s->size)
return FALSE;
return TRUE;
/* BFD back-end for i386 a.out binaries under LynxOS.
Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1999, 2001, 2002,
- 2003, 2005, 2007, 2009, 2010 Free Software Foundation, Inc.
+ 2003, 2005, 2007, 2009, 2010, 2012 Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library.
NAME(aout,swap_exec_header_out) (abfd, execp, &exec_bytes); \
\
if (bfd_seek (abfd, (file_ptr) 0, SEEK_SET) != 0 \
- || bfd_bwrite ((PTR) &exec_bytes, (bfd_size_type) EXEC_BYTES_SIZE, \
+ || bfd_bwrite (&exec_bytes, (bfd_size_type) EXEC_BYTES_SIZE, \
abfd) != EXEC_BYTES_SIZE) \
return FALSE; \
/* Now write out reloc info, followed by syms and strings */ \
#include "libaout.h"
#include "aout/aout64.h"
-void NAME (lynx,swap_std_reloc_out)
- PARAMS ((bfd *, arelent *, struct reloc_std_external *));
-void NAME (lynx,swap_ext_reloc_out)
- PARAMS ((bfd *, arelent *, struct reloc_ext_external *));
-void NAME (lynx,swap_ext_reloc_in)
- PARAMS ((bfd *, struct reloc_ext_external *, arelent *, asymbol **,
- bfd_size_type));
-void NAME (lynx,swap_std_reloc_in)
- PARAMS ((bfd *, struct reloc_std_external *, arelent *, asymbol **,
- bfd_size_type));
-bfd_boolean NAME (lynx,slurp_reloc_table)
- PARAMS ((bfd *, sec_ptr, asymbol **));
-bfd_boolean NAME (lynx,squirt_out_relocs)
- PARAMS ((bfd *, asection *));
-long NAME (lynx,canonicalize_reloc)
- PARAMS ((bfd *, sec_ptr, arelent **, asymbol **));
#ifdef LYNX_CORE
/* Standard reloc stuff */
/* Output standard relocation information to a file in target byte order. */
-void
-NAME(lynx,swap_std_reloc_out) (abfd, g, natptr)
- bfd *abfd;
- arelent *g;
- struct reloc_std_external *natptr;
+static void
+NAME(lynx,swap_std_reloc_out) (bfd *abfd,
+ arelent *g,
+ struct reloc_std_external *natptr)
{
int r_index;
asymbol *sym = *(g->sym_ptr_ptr);
check for that here
*/
-
if (bfd_is_com_section (output_section)
|| bfd_is_abs_section (output_section)
|| bfd_is_und_section (output_section))
/* Extended stuff */
/* Output extended relocation information to a file in target byte order. */
-void
-NAME(lynx,swap_ext_reloc_out) (abfd, g, natptr)
- bfd *abfd;
- arelent *g;
- register struct reloc_ext_external *natptr;
+static void
+NAME(lynx,swap_ext_reloc_out) (bfd *abfd,
+ arelent *g,
+ struct reloc_ext_external *natptr)
{
int r_index;
int r_extern;
#define MOVE_ADDRESS(ad) \
- if (r_extern) { \
+ if (r_extern) \
+ { \
/* undefined symbol */ \
cache_ptr->sym_ptr_ptr = symbols + r_index; \
cache_ptr->addend = ad; \
- } else { \
+ } \
+ else \
+ { \
/* defined, section relative. replace symbol with pointer to \
symbol which points to section */ \
switch (r_index) { \
} \
} \
-void
-NAME(lynx,swap_ext_reloc_in) (abfd, bytes, cache_ptr, symbols, symcount)
- bfd *abfd;
- struct reloc_ext_external *bytes;
- arelent *cache_ptr;
- asymbol **symbols;
- bfd_size_type symcount ATTRIBUTE_UNUSED;
+static void
+NAME(lynx,swap_ext_reloc_in) (bfd *abfd,
+ struct reloc_ext_external *bytes,
+ arelent *cache_ptr,
+ asymbol **symbols,
+ bfd_size_type symcount ATTRIBUTE_UNUSED)
{
int r_index;
int r_extern;
MOVE_ADDRESS (GET_SWORD (abfd, bytes->r_addend));
}
-void
-NAME(lynx,swap_std_reloc_in) (abfd, bytes, cache_ptr, symbols, symcount)
- bfd *abfd;
- struct reloc_std_external *bytes;
- arelent *cache_ptr;
- asymbol **symbols;
- bfd_size_type symcount ATTRIBUTE_UNUSED;
+static void
+NAME(lynx,swap_std_reloc_in) (bfd *abfd,
+ struct reloc_std_external *bytes,
+ arelent *cache_ptr,
+ asymbol **symbols,
+ bfd_size_type symcount ATTRIBUTE_UNUSED)
{
int r_index;
int r_extern;
/* Reloc hackery */
-bfd_boolean
-NAME(lynx,slurp_reloc_table) (abfd, asect, symbols)
- bfd *abfd;
- sec_ptr asect;
- asymbol **symbols;
+static bfd_boolean
+NAME(lynx,slurp_reloc_table) (bfd *abfd,
+ sec_ptr asect,
+ asymbol **symbols)
{
bfd_size_type count;
bfd_size_type reloc_size;
- PTR relocs;
+ void * relocs;
arelent *reloc_cache;
size_t each_size;
if (!reloc_cache && count != 0)
return FALSE;
- relocs = (PTR) bfd_alloc (abfd, reloc_size);
+ relocs = bfd_alloc (abfd, reloc_size);
if (!relocs && reloc_size != 0)
{
free (reloc_cache);
if (each_size == RELOC_EXT_SIZE)
{
- register struct reloc_ext_external *rptr = (struct reloc_ext_external *) relocs;
+ struct reloc_ext_external *rptr = (struct reloc_ext_external *) relocs;
unsigned int counter = 0;
arelent *cache_ptr = reloc_cache;
}
else
{
- register struct reloc_std_external *rptr = (struct reloc_std_external *) relocs;
+ struct reloc_std_external *rptr = (struct reloc_std_external *) relocs;
unsigned int counter = 0;
arelent *cache_ptr = reloc_cache;
/* Write out a relocation section into an object file. */
-bfd_boolean
-NAME(lynx,squirt_out_relocs) (abfd, section)
- bfd *abfd;
- asection *section;
+static bfd_boolean
+NAME(lynx,squirt_out_relocs) (bfd *abfd, asection *section)
{
arelent **generic;
unsigned char *native, *natptr;
size_t each_size;
-
unsigned int count = section->reloc_count;
bfd_size_type natsize;
NAME(lynx,swap_std_reloc_out) (abfd, *generic, (struct reloc_std_external *) natptr);
}
- if (bfd_bwrite ((PTR) native, natsize, abfd) != natsize)
+ if (bfd_bwrite (native, natsize, abfd) != natsize)
{
bfd_release (abfd, native);
return FALSE;
}
/* This is stupid. This function should be a boolean predicate */
-long
-NAME(lynx,canonicalize_reloc) (abfd, section, relptr, symbols)
- bfd *abfd;
- sec_ptr section;
- arelent **relptr;
- asymbol **symbols;
+static long
+NAME(lynx,canonicalize_reloc) (bfd *abfd,
+ sec_ptr section,
+ arelent **relptr,
+ asymbol **symbols)
{
arelent *tblptr = section->relocation;
unsigned int count;
/* BFD back-end for i386 a.out binaries.
- Copyright 1990, 1991, 1993, 1994, 1995, 1997, 2001, 2002, 2003, 2005, 2007
- Free Software Foundation, Inc.
+ Copyright 1990, 1991, 1993, 1994, 1995, 1997, 2001, 2002, 2003, 2005, 2007,
+ 2012 Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library.
#define MY(OP) CONCAT2 (i386mach3_,OP)
#define TARGETNAME "a.out-mach3"
-static bfd_boolean MY (set_sizes) PARAMS ((bfd *));
+static bfd_boolean MY (set_sizes) (bfd *);
#define MY_backend_data &MY(backend_data)
-static const struct aout_backend_data MY(backend_data) = {
+
+static const struct aout_backend_data MY(backend_data) =
+{
0, /* zmagic contiguous */
1, /* text incl header */
0, /* entry is text address */
/* BFD back-end for MS-DOS executables.
Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2001, 2002,
- 2003, 2004, 2005, 2006, 2007, 2009, 2011 Free Software Foundation, Inc.
+ 2003, 2004, 2005, 2006, 2007, 2009, 2011, 2012
+ Free Software Foundation, Inc.
Written by Bryan Ford of the University of Utah.
Contributed by the Center for Software Science at the
NULL,
- (PTR) 0
+ NULL
};
/* BFD back-end for os9000 i386 binaries.
Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1998, 1999, 2001, 2002,
- 2004, 2005, 2006, 2007, 2009, 2011 Free Software Foundation, Inc.
+ 2004, 2005, 2006, 2007, 2009, 2011, 2012 Free Software Foundation, Inc.
Written by Cygnus Support.
This file is part of BFD, the Binary File Descriptor library.
struct internal_exec anexec;
mh_com exec_bytes;
- if (bfd_bread ((PTR) &exec_bytes, (bfd_size_type) MHCOM_BYTES_SIZE, abfd)
+ if (bfd_bread (&exec_bytes, (bfd_size_type) MHCOM_BYTES_SIZE, abfd)
!= MHCOM_BYTES_SIZE)
{
if (bfd_get_error () != bfd_error_system_call)
NULL,
- (PTR) 0,
+ NULL,
};
/* BFD back-end for Irix core files.
Copyright 1993, 1994, 1996, 1999, 2001, 2002, 2004, 2005, 2006, 2007,
- 2010, 2011 Free Software Foundation, Inc.
+ 2010, 2011, 2012 Free Software Foundation, Inc.
Written by Stu Grossman, Cygnus Support.
Converted to back-end form by Ian Lance Taylor, Cygnus Support
for (i = 0; i < coreout->c_nvmap; i++)
{
- val = bfd_bread ((PTR) &vmap, (bfd_size_type) sizeof vmap, abfd);
+ val = bfd_bread (&vmap, (bfd_size_type) sizeof vmap, abfd);
if (val != sizeof vmap)
break;
for (i = 0; i < coreout->c_nvmap; i++)
{
- val = bfd_bread ((PTR) &vmap, (bfd_size_type) sizeof vmap, abfd);
+ val = bfd_bread (&vmap, (bfd_size_type) sizeof vmap, abfd);
if (val != sizeof vmap)
break;
struct idesc *idg, *idf, *ids;
bfd_size_type amt;
- val = bfd_bread ((PTR) &coreout, (bfd_size_type) sizeof coreout, abfd);
+ val = bfd_bread (&coreout, (bfd_size_type) sizeof coreout, abfd);
if (val != sizeof coreout)
{
if (bfd_get_error () != bfd_error_system_call)
NULL,
- (PTR) 0 /* backend_data */
+ NULL /* backend_data */
};
#endif /* IRIX_CORE */
/* Handle Lynx core dump file. */
static asection *
-make_bfd_asection (abfd, name, flags, size, vma, filepos)
- bfd *abfd;
- const char *name;
- flagword flags;
- bfd_size_type size;
- bfd_vma vma;
- file_ptr filepos;
+make_bfd_asection (bfd *abfd,
+ const char *name,
+ flagword flags,
+ bfd_size_type size,
+ bfd_vma vma,
+ file_ptr filepos)
{
asection *asect;
char *newname;
}
const bfd_target *
-lynx_core_file_p (abfd)
- bfd *abfd;
+lynx_core_file_p (bfd *abfd)
{
int secnum;
struct pssentry pss;
}
char *
-lynx_core_file_failing_command (abfd)
- bfd *abfd;
+lynx_core_file_failing_command (bfd *abfd)
{
return core_command (abfd);
}
int
-lynx_core_file_failing_signal (abfd)
- bfd *abfd;
+lynx_core_file_failing_signal (bfd *abfd)
{
return core_signal (abfd);
}
/* BFD back-end for linux flavored m68k a.out binaries.
Copyright 1992, 1993, 1994, 1995, 1996, 1997, 1999, 2000, 2001, 2002,
- 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2011
+ 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2011, 2012
Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library.
becomes important. */
static void MY_final_link_callback
- PARAMS ((bfd *, file_ptr *, file_ptr *, file_ptr *));
-static bfd_boolean m68klinux_bfd_final_link
- PARAMS ((bfd *, struct bfd_link_info *));
-static bfd_boolean m68klinux_write_object_contents PARAMS ((bfd *));
+ (bfd *, file_ptr *, file_ptr *, file_ptr *);
static bfd_boolean
-m68klinux_bfd_final_link (abfd, info)
- bfd *abfd;
- struct bfd_link_info *info;
+m68klinux_bfd_final_link (bfd *abfd,
+ struct bfd_link_info *info)
{
obj_aout_subformat (abfd) = q_magic_format;
return NAME(aout,final_link) (abfd, info, MY_final_link_callback);
/* Set the machine type correctly. */
static bfd_boolean
-m68klinux_write_object_contents (abfd)
- bfd *abfd;
+m68klinux_write_object_contents (bfd *abfd)
{
struct external_exec exec_bytes;
struct internal_exec *execp = exec_hdr (abfd);
struct fixup *fixup_list;
};
-static struct bfd_hash_entry *linux_link_hash_newfunc
- PARAMS ((struct bfd_hash_entry *, struct bfd_hash_table *, const char *));
-static struct bfd_link_hash_table *linux_link_hash_table_create
- PARAMS ((bfd *));
-static struct fixup *new_fixup
- PARAMS ((struct bfd_link_info *, struct linux_link_hash_entry *,
- bfd_vma, int));
-static bfd_boolean linux_link_create_dynamic_sections
- PARAMS ((bfd *, struct bfd_link_info *));
-static bfd_boolean linux_add_one_symbol
- PARAMS ((struct bfd_link_info *, bfd *, const char *, flagword, asection *,
- bfd_vma, const char *, bfd_boolean, bfd_boolean,
- struct bfd_link_hash_entry **));
-static bfd_boolean linux_tally_symbols
- PARAMS ((struct linux_link_hash_entry *, PTR));
-static bfd_boolean linux_finish_dynamic_link
- PARAMS ((bfd *, struct bfd_link_info *));
-
/* Routine to create an entry in an Linux link hash table. */
static struct bfd_hash_entry *
-linux_link_hash_newfunc (entry, table, string)
- struct bfd_hash_entry *entry;
- struct bfd_hash_table *table;
- const char *string;
+linux_link_hash_newfunc (struct bfd_hash_entry *entry,
+ struct bfd_hash_table *table,
+ const char *string)
{
struct linux_link_hash_entry *ret = (struct linux_link_hash_entry *) entry;
/* Create a Linux link hash table. */
static struct bfd_link_hash_table *
-linux_link_hash_table_create (abfd)
- bfd *abfd;
+linux_link_hash_table_create (bfd *abfd)
{
struct linux_link_hash_table *ret;
bfd_size_type amt = sizeof (struct linux_link_hash_table);
#define linux_link_hash_traverse(table, func, info) \
(aout_link_hash_traverse \
(&(table)->root, \
- (bfd_boolean (*) PARAMS ((struct aout_link_hash_entry *, PTR))) (func), \
+ (bfd_boolean (*) (struct aout_link_hash_entry *, void *)) (func), \
(info)))
/* Get the Linux link hash table from the info structure. This is
/* Store the information for a new fixup. */
static struct fixup *
-new_fixup (info, h, value, builtin)
- struct bfd_link_info *info;
- struct linux_link_hash_entry *h;
- bfd_vma value;
- int builtin;
+new_fixup (struct bfd_link_info *info,
+ struct linux_link_hash_entry *h,
+ bfd_vma value,
+ int builtin)
{
struct fixup *f;
create it for now. */
static bfd_boolean
-linux_link_create_dynamic_sections (abfd, info)
- bfd *abfd;
- struct bfd_link_info *info ATTRIBUTE_UNUSED;
+linux_link_create_dynamic_sections (bfd *abfd,
+ struct bfd_link_info *info ATTRIBUTE_UNUSED)
{
flagword flags;
- register asection *s;
+ asection *s;
/* Note that we set the SEC_IN_MEMORY flag. */
flags = SEC_ALLOC | SEC_LOAD | SEC_HAS_CONTENTS | SEC_IN_MEMORY;
tweaking needed for dynamic linking support. */
static bfd_boolean
-linux_add_one_symbol (info, abfd, name, flags, section, value, string,
- copy, collect, hashp)
- struct bfd_link_info *info;
- bfd *abfd;
- const char *name;
- flagword flags;
- asection *section;
- bfd_vma value;
- const char *string;
- bfd_boolean copy;
- bfd_boolean collect;
- struct bfd_link_hash_entry **hashp;
+linux_add_one_symbol (struct bfd_link_info *info,
+ bfd *abfd,
+ const char *name,
+ flagword flags,
+ asection *section,
+ bfd_vma value,
+ const char *string,
+ bfd_boolean copy,
+ bfd_boolean collect,
+ struct bfd_link_hash_entry **hashp)
{
struct linux_link_hash_entry *h;
bfd_boolean insert;
This function is called via linux_link_hash_traverse. */
static bfd_boolean
-linux_tally_symbols (h, data)
- struct linux_link_hash_entry *h;
- PTR data;
+linux_tally_symbols (struct linux_link_hash_entry *h,
+ void * data)
{
struct bfd_link_info *info = (struct bfd_link_info *) data;
struct fixup *f, *f1;
are required. */
bfd_boolean
-bfd_m68klinux_size_dynamic_sections (output_bfd, info)
- bfd *output_bfd;
- struct bfd_link_info *info;
+bfd_m68klinux_size_dynamic_sections (bfd *output_bfd,
+ struct bfd_link_info *info)
{
struct fixup *f;
asection *s;
/* First find the fixups... */
linux_link_hash_traverse (linux_hash_table (info),
linux_tally_symbols,
- (PTR) info);
+ info);
/* If there are builtin fixups, leave room for a marker. This is
used by the dynamic linker so that it knows that all that follow
the stuff we need. */
static bfd_boolean
-linux_finish_dynamic_link (output_bfd, info)
- bfd *output_bfd;
- struct bfd_link_info *info;
+linux_finish_dynamic_link (bfd *output_bfd, struct bfd_link_info *info)
{
asection *s, *os, *is;
bfd_byte *fixup_table;
SEEK_SET) != 0)
return FALSE;
- if (bfd_bwrite ((PTR) s->contents, s->size, output_bfd) != s->size)
+ if (bfd_bwrite (s->contents, s->size, output_bfd) != s->size)
return FALSE;
return TRUE;
long bfd_mach_o_canonicalize_dynamic_reloc (bfd *, arelent **, asymbol **);
asymbol *bfd_mach_o_make_empty_symbol (bfd *);
void bfd_mach_o_get_symbol_info (bfd *, asymbol *, symbol_info *);
-void bfd_mach_o_print_symbol (bfd *, PTR, asymbol *, bfd_print_symbol_type);
+void bfd_mach_o_print_symbol (bfd *, void *, asymbol *, bfd_print_symbol_type);
int bfd_mach_o_sizeof_headers (bfd *, struct bfd_link_info *);
unsigned long bfd_mach_o_stack_addr (enum bfd_mach_o_cpu_type);
int bfd_mach_o_core_fetch_environment (bfd *, unsigned char **, unsigned int *);
/* BFD backend for MIPS BSD (a.out) binaries.
Copyright 1993, 1994, 1995, 1997, 1998, 1999, 2000, 2001, 2002, 2003,
- 2005, 2007, 2009, 2011 Free Software Foundation, Inc.
+ 2005, 2007, 2009, 2011, 2012 Free Software Foundation, Inc.
Written by Ralph Campbell.
This file is part of BFD, the Binary File Descriptor library.
#define SET_ARCH_MACH(ABFD, EXEC) \
MY(set_arch_mach) (ABFD, N_MACHTYPE (EXEC)); \
MY(choose_reloc_size) (ABFD);
-static void MY(set_arch_mach) PARAMS ((bfd *abfd, unsigned long machtype));
-static void MY(choose_reloc_size) PARAMS ((bfd *abfd));
+static void MY(set_arch_mach) (bfd *, unsigned long);
+static void MY(choose_reloc_size) (bfd *);
#define MY_write_object_contents MY(write_object_contents)
-static bfd_boolean MY(write_object_contents) PARAMS ((bfd *abfd));
+static bfd_boolean MY(write_object_contents) (bfd *);
/* We can't use MY(x) here because it leads to a recursive call to CONCAT2
when expanded inside JUMP_TABLE. */
#include "aout-target.h"
static bfd_reloc_status_type mips_fix_jmp_addr
- PARAMS ((bfd *, arelent *, struct bfd_symbol *, PTR, asection *,
- bfd *, char **));
+ (bfd *, arelent *, struct bfd_symbol *, void *, asection *,
+ bfd *, char **);
-long MY(canonicalize_reloc) PARAMS ((bfd *, sec_ptr, arelent **, asymbol **));
+long MY(canonicalize_reloc) (bfd *, sec_ptr, arelent **, asymbol **);
static void
-MY(set_arch_mach) (abfd, machtype)
- bfd *abfd;
- unsigned long machtype;
+MY(set_arch_mach) (bfd *abfd, unsigned long machtype)
{
enum bfd_architecture arch;
unsigned int machine;
/* Determine the size of a relocation entry, based on the architecture */
static void
-MY (choose_reloc_size) (abfd)
- bfd *abfd;
+MY (choose_reloc_size) (bfd *abfd)
{
switch (bfd_get_arch (abfd))
{
file header, symbols, and relocation. */
static bfd_boolean
-MY (write_object_contents) (abfd)
- bfd *abfd;
+MY (write_object_contents) (bfd *abfd)
{
struct external_exec exec_bytes;
struct internal_exec *execp = exec_hdr (abfd);
program counter, then we need to signal an error. */
static bfd_reloc_status_type
-mips_fix_jmp_addr (abfd, reloc_entry, symbol, data, input_section, output_bfd,
- error_message)
- bfd *abfd ATTRIBUTE_UNUSED;
- arelent *reloc_entry;
- struct bfd_symbol *symbol;
- PTR data ATTRIBUTE_UNUSED;
- asection *input_section;
- bfd *output_bfd;
- char **error_message ATTRIBUTE_UNUSED;
+mips_fix_jmp_addr (bfd *abfd ATTRIBUTE_UNUSED,
+ arelent *reloc_entry,
+ struct bfd_symbol *symbol,
+ void * data ATTRIBUTE_UNUSED,
+ asection *input_section,
+ bfd *output_bfd,
+ char **error_message ATTRIBUTE_UNUSED)
{
bfd_vma relocation, pc;
/* If this is a partial relocation, just continue. */
- if (output_bfd != (bfd *)NULL)
+ if (output_bfd != (bfd *) NULL)
return bfd_reloc_continue;
/* If this is an undefined symbol, return error */
when the low bits are added at run time. */
static bfd_reloc_status_type
-mips_fix_hi16_s PARAMS ((bfd *, arelent *, asymbol *, PTR,
- asection *, bfd *, char **));
-
-static bfd_reloc_status_type
-mips_fix_hi16_s (abfd, reloc_entry, symbol, data, input_section,
- output_bfd, error_message)
- bfd *abfd ATTRIBUTE_UNUSED;
- arelent *reloc_entry;
- asymbol *symbol;
- PTR data ATTRIBUTE_UNUSED;
- asection *input_section ATTRIBUTE_UNUSED;
- bfd *output_bfd;
- char **error_message ATTRIBUTE_UNUSED;
+mips_fix_hi16_s (bfd *abfd ATTRIBUTE_UNUSED,
+ arelent *reloc_entry,
+ asymbol *symbol,
+ void * data ATTRIBUTE_UNUSED,
+ asection *input_section ATTRIBUTE_UNUSED,
+ bfd *output_bfd,
+ char **error_message ATTRIBUTE_UNUSED)
{
bfd_vma relocation;
return bfd_reloc_continue;
}
-static reloc_howto_type mips_howto_table_ext[] = {
+static reloc_howto_type mips_howto_table_ext[] =
+{
{MIPS_RELOC_32, 0, 2, 32, FALSE, 0, complain_overflow_bitfield, 0,
"32", FALSE, 0, 0xffffffff, FALSE},
{MIPS_RELOC_JMP, 2, 2, 26, FALSE, 0, complain_overflow_dont,
static reloc_howto_type *
MY(reloc_type_lookup) (bfd *abfd, bfd_reloc_code_real_type code)
{
-
if (bfd_get_arch (abfd) != bfd_arch_mips)
- return 0;
+ return NULL;
switch (code)
{
case BFD_RELOC_LO16:
return (&mips_howto_table_ext[MIPS_RELOC_LO16]);
default:
- return 0;
+ return NULL;
}
}
static reloc_howto_type *
MY(reloc_name_lookup) (bfd *abfd ATTRIBUTE_UNUSED,
- const char *r_name)
+ const char *r_name)
{
unsigned int i;
/* This is just like the standard aoutx.h version but we need to do our
own mapping of external reloc type values to howto entries. */
long
-MY(canonicalize_reloc) (abfd, section, relptr, symbols)
- bfd *abfd;
- sec_ptr section;
- arelent **relptr;
- asymbol **symbols;
+MY(canonicalize_reloc) (bfd *abfd,
+ sec_ptr section,
+ arelent **relptr,
+ asymbol **symbols)
{
arelent *tblptr = section->relocation;
unsigned int count, c;
return section->reloc_count;
}
-static const struct aout_backend_data MY(backend_data) = {
+static const struct aout_backend_data MY(backend_data) =
+{
0, /* zmagic contiguous */
1, /* text incl header */
0, /* entry is text address */
extern const bfd_target aout_mips_big_vec;
const bfd_target aout_mips_little_vec =
- {
+{
"a.out-mips-little", /* name */
bfd_target_aout_flavour,
BFD_ENDIAN_LITTLE, /* target byte order (little) */
& aout_mips_big_vec,
- (PTR) MY_backend_data
+ MY_backend_data
};
const bfd_target aout_mips_big_vec =
& aout_mips_little_vec,
- (PTR) MY_backend_data
+ MY_backend_data
};
/* BFD back end for NetBSD style core files
Copyright 1988, 1989, 1991, 1992, 1993, 1996, 1998, 1999, 2000, 2001,
- 2002, 2003, 2004, 2005, 2006, 2007
+ 2002, 2003, 2004, 2005, 2006, 2007, 2012
Free Software Foundation, Inc.
Written by Paul Kranenburg, EUR
NULL,
- (PTR) 0 /* Backend_data. */
+ NULL /* Backend_data. */
};
/* Support for 32-bit i386 NLM (NetWare Loadable Module)
- Copyright 1993, 1994, 2000, 2001, 2002, 2003, 2005, 2007
+ Copyright 1993, 1994, 2000, 2001, 2002, 2003, 2005, 2007, 2012
Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library.
static bfd_boolean
nlm_i386_mangle_relocs (bfd *abfd,
asection *sec,
- const PTR data,
+ const void * data,
bfd_vma offset,
bfd_size_type count)
{
/* BFD back-end for OSF/1 core files.
Copyright 1993, 1994, 1995, 1998, 1999, 2001, 2002, 2003, 2004, 2005, 2006,
- 2007, 2010, 2011 Free Software Foundation, Inc.
+ 2007, 2010, 2011, 2012 Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library.
/* forward declarations */
-static asection *make_bfd_asection
- PARAMS ((bfd *, const char *, flagword, bfd_size_type, bfd_vma, file_ptr));
-static const bfd_target *osf_core_core_file_p
- PARAMS ((bfd *));
-static char *osf_core_core_file_failing_command
- PARAMS ((bfd *));
-static int osf_core_core_file_failing_signal
- PARAMS ((bfd *));
#define osf_core_core_file_matches_executable_p generic_core_file_matches_executable_p
#define osf_core_core_file_pid _bfd_nocore_core_file_pid
-static void swap_abort
- PARAMS ((void));
/* These are stored in the bfd's tdata */
};
#define core_hdr(bfd) ((bfd)->tdata.osf_core_data)
-#define core_signal(bfd) (core_hdr(bfd)->sig)
+#define core_signal(bfd) (core_hdr(bfd)->sig)
#define core_command(bfd) (core_hdr(bfd)->cmd)
static asection *
-make_bfd_asection (abfd, name, flags, size, vma, filepos)
- bfd *abfd;
- const char *name;
- flagword flags;
- bfd_size_type size;
- bfd_vma vma;
- file_ptr filepos;
+make_bfd_asection (bfd *abfd,
+ const char *name,
+ flagword flags,
+ bfd_size_type size,
+ bfd_vma vma,
+ file_ptr filepos)
{
asection *asect;
}
static const bfd_target *
-osf_core_core_file_p (abfd)
- bfd *abfd;
+osf_core_core_file_p (bfd *abfd)
{
int val;
int i;
bfd_size_type amt;
amt = sizeof core_header;
- val = bfd_bread ((PTR) &core_header, amt, abfd);
+ val = bfd_bread (& core_header, amt, abfd);
if (val != sizeof core_header)
return NULL;
flagword flags;
amt = sizeof core_scnhdr;
- val = bfd_bread ((PTR) &core_scnhdr, amt, abfd);
+ val = bfd_bread (& core_scnhdr, amt, abfd);
if (val != sizeof core_scnhdr)
break;
}
static char *
-osf_core_core_file_failing_command (abfd)
- bfd *abfd;
+osf_core_core_file_failing_command (bfd *abfd)
{
return core_command (abfd);
}
static int
-osf_core_core_file_failing_signal (abfd)
- bfd *abfd;
+osf_core_core_file_failing_signal (bfd *abfd)
{
return core_signal (abfd);
}
\f
/* If somebody calls any byte-swapping routines, shoot them. */
static void
-swap_abort()
+swap_abort (void)
{
- abort(); /* This way doesn't require any declaration for ANSI to fuck up */
+ abort (); /* This way doesn't require any declaration for ANSI to fuck up */
}
#define NO_GET ((bfd_vma (*) (const void *)) swap_abort)
NULL,
- (PTR) 0 /* backend_data */
+ NULL /* backend_data */
};
#define MY_exec_header_not_counted 1
reloc_howto_type *ns32kaout_bfd_reloc_type_lookup
- PARAMS ((bfd *abfd, bfd_reloc_code_real_type code));
-
-static bfd_boolean MY(write_object_contents)
- PARAMS ((bfd *abfd));
+ (bfd *abfd, bfd_reloc_code_real_type code);
static bfd_boolean
-MY(write_object_contents) (abfd)
- bfd *abfd;
+MY(write_object_contents) (bfd *abfd)
{
struct external_exec exec_bytes;
struct internal_exec *execp = exec_hdr (abfd);
}
int
-bfd_pef_scan (abfd, header, mdata)
- bfd *abfd;
- bfd_pef_header *header;
- bfd_pef_data_struct *mdata;
+bfd_pef_scan (bfd *abfd,
+ bfd_pef_header *header,
+ bfd_pef_data_struct *mdata)
{
unsigned int i;
enum bfd_architecture cputype;
/* BFD back-end for PPCbug boot records.
Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006,
- 2007, 2008, 2009, 2011 Free Software Foundation, Inc.
+ 2007, 2008, 2009, 2011, 2012 Free Software Foundation, Inc.
Written by Michael Meissner, Cygnus Support, <meissner@cygnus.com>
This file is part of BFD, the Binary File Descriptor library.
#include "libbfd.h"
/* PPCbug location structure */
-typedef struct ppcboot_location {
+typedef struct ppcboot_location
+{
bfd_byte ind;
bfd_byte head;
bfd_byte sector;
} ppcboot_location_t;
/* PPCbug partition table layout */
-typedef struct ppcboot_partition {
+typedef struct ppcboot_partition
+{
ppcboot_location_t partition_begin; /* partition begin */
ppcboot_location_t partition_end; /* partition end */
bfd_byte sector_begin[4]; /* 32-bit start RBA (zero-based), little endian */
} ppcboot_partition_t;
/* PPCbug boot layout. */
-typedef struct ppcboot_hdr {
+typedef struct ppcboot_hdr
+{
bfd_byte pc_compatibility[446]; /* x86 instruction field */
ppcboot_partition_t partition[4]; /* partition information */
bfd_byte signature[2]; /* 0x55 and 0xaa */
#define PPC_IND 0x41
/* Information needed for ppcboot header */
-typedef struct ppcboot_data {
+typedef struct ppcboot_data
+{
ppcboot_hdr_t header; /* raw header */
asection *sec; /* single section */
} ppcboot_data_t;
a start symbol, an end symbol, and an absolute length symbol. */
#define PPCBOOT_SYMS 3
-static bfd_boolean ppcboot_mkobject PARAMS ((bfd *));
-static const bfd_target *ppcboot_object_p PARAMS ((bfd *));
-static bfd_boolean ppcboot_set_arch_mach
- PARAMS ((bfd *, enum bfd_architecture, unsigned long));
-static bfd_boolean ppcboot_get_section_contents
- PARAMS ((bfd *, asection *, PTR, file_ptr, bfd_size_type));
-static long ppcboot_get_symtab_upper_bound PARAMS ((bfd *));
-static char *mangle_name PARAMS ((bfd *, char *));
-static long ppcboot_canonicalize_symtab PARAMS ((bfd *, asymbol **));
-static void ppcboot_get_symbol_info PARAMS ((bfd *, asymbol *, symbol_info *));
-static bfd_boolean ppcboot_set_section_contents
- PARAMS ((bfd *, asection *, const PTR, file_ptr, bfd_size_type));
-static bfd_boolean ppcboot_bfd_print_private_bfd_data PARAMS ((bfd *, PTR));
-
-#define ppcboot_set_tdata(abfd, ptr) ((abfd)->tdata.any = (PTR) (ptr))
+#define ppcboot_set_tdata(abfd, ptr) ((abfd)->tdata.any = (ptr))
#define ppcboot_get_tdata(abfd) ((ppcboot_data_t *) ((abfd)->tdata.any))
\f
/* Create a ppcboot object. Invoked via bfd_set_format. */
static bfd_boolean
-ppcboot_mkobject (abfd)
- bfd *abfd;
+ppcboot_mkobject (bfd *abfd)
{
if (!ppcboot_get_tdata (abfd))
{
\f
/* Set the architecture to PowerPC */
static bfd_boolean
-ppcboot_set_arch_mach (abfd, arch, machine)
- bfd *abfd;
- enum bfd_architecture arch;
- unsigned long machine;
+ppcboot_set_arch_mach (bfd *abfd,
+ enum bfd_architecture arch,
+ unsigned long machine)
{
if (arch == bfd_arch_unknown)
arch = bfd_arch_powerpc;
being ppcboot. */
static const bfd_target *
-ppcboot_object_p (abfd)
- bfd *abfd;
+ppcboot_object_p (bfd *abfd)
{
struct stat statbuf;
asection *sec;
return NULL;
}
- if (bfd_bread ((PTR) &hdr, (bfd_size_type) sizeof (hdr), abfd)
+ if (bfd_bread (&hdr, (bfd_size_type) sizeof (hdr), abfd)
!= sizeof (hdr))
{
if (bfd_get_error () != bfd_error_system_call)
ppcboot_mkobject (abfd);
tdata = ppcboot_get_tdata (abfd);
tdata->sec = sec;
- memcpy ((PTR) &tdata->header, (PTR) &hdr, sizeof (ppcboot_hdr_t));
+ memcpy (&tdata->header, &hdr, sizeof (ppcboot_hdr_t));
ppcboot_set_arch_mach (abfd, bfd_arch_powerpc, 0L);
return abfd->xvec;
/* Get contents of the only section. */
static bfd_boolean
-ppcboot_get_section_contents (abfd, section, location, offset, count)
- bfd *abfd;
- asection *section ATTRIBUTE_UNUSED;
- PTR location;
- file_ptr offset;
- bfd_size_type count;
+ppcboot_get_section_contents (bfd *abfd,
+ asection *section ATTRIBUTE_UNUSED,
+ void * location,
+ file_ptr offset,
+ bfd_size_type count)
{
if (bfd_seek (abfd, offset + (file_ptr) sizeof (ppcboot_hdr_t), SEEK_SET) != 0
|| bfd_bread (location, count, abfd) != count)
/* Return the amount of memory needed to read the symbol table. */
static long
-ppcboot_get_symtab_upper_bound (abfd)
- bfd *abfd ATTRIBUTE_UNUSED;
+ppcboot_get_symtab_upper_bound (bfd *abfd ATTRIBUTE_UNUSED)
{
return (PPCBOOT_SYMS + 1) * sizeof (asymbol *);
}
/* Create a symbol name based on the bfd's filename. */
static char *
-mangle_name (abfd, suffix)
- bfd *abfd;
- char *suffix;
+mangle_name (bfd *abfd, char *suffix)
{
bfd_size_type size;
char *buf;
/* Return the symbol table. */
static long
-ppcboot_canonicalize_symtab (abfd, alocation)
- bfd *abfd;
- asymbol **alocation;
+ppcboot_canonicalize_symtab (bfd *abfd, asymbol **alocation)
{
asection *sec = ppcboot_get_tdata (abfd)->sec;
asymbol *syms;
/* Get information about a symbol. */
static void
-ppcboot_get_symbol_info (ignore_abfd, symbol, ret)
- bfd *ignore_abfd ATTRIBUTE_UNUSED;
- asymbol *symbol;
- symbol_info *ret;
+ppcboot_get_symbol_info (bfd *ignore_abfd ATTRIBUTE_UNUSED,
+ asymbol *symbol,
+ symbol_info *ret)
{
bfd_symbol_info (symbol, ret);
}
/* Write section contents of a ppcboot file. */
static bfd_boolean
-ppcboot_set_section_contents (abfd, sec, data, offset, size)
- bfd *abfd;
- asection *sec;
- const PTR data;
- file_ptr offset;
- bfd_size_type size;
+ppcboot_set_section_contents (bfd *abfd,
+ asection *sec,
+ const void * data,
+ file_ptr offset,
+ bfd_size_type size)
{
if (! abfd->output_has_begun)
{
/* Print out the program headers. */
static bfd_boolean
-ppcboot_bfd_print_private_bfd_data (abfd, farg)
- bfd *abfd;
- PTR farg;
+ppcboot_bfd_print_private_bfd_data (bfd *abfd, void * farg)
{
FILE *f = (FILE *)farg;
ppcboot_data_t *tdata = ppcboot_get_tdata (abfd);
- long entry_offset = bfd_getl_signed_32 ((PTR) tdata->header.entry_offset);
- long length = bfd_getl_signed_32 ((PTR) tdata->header.length);
+ long entry_offset = bfd_getl_signed_32 (tdata->header.entry_offset);
+ long length = bfd_getl_signed_32 (tdata->header.length);
int i;
fprintf (f, _("\nppcboot header:\n"));
for (i = 0; i < 4; i++)
{
- long sector_begin = bfd_getl_signed_32 ((PTR) tdata->header.partition[i].sector_begin);
- long sector_length = bfd_getl_signed_32 ((PTR) tdata->header.partition[i].sector_length);
+ long sector_begin = bfd_getl_signed_32 (tdata->header.partition[i].sector_begin);
+ long sector_length = bfd_getl_signed_32 (tdata->header.partition[i].sector_length);
/* Skip all 0 entries */
if (!tdata->header.partition[i].partition_begin.ind
/* BFD backend for core files which use the ptrace_user structure
Copyright 1993, 1994, 1995, 1996, 1998, 1999, 2001, 2002, 2003, 2004,
- 2005, 2006, 2007 Free Software Foundation, Inc.
+ 2005, 2006, 2007, 2012 Free Software Foundation, Inc.
The structure of this file is based on trad-core.c written by John Gilmore
of Cygnus Support.
Modified to work with the ptrace_user structure by Kevin A. Buettner.
#include <sys/ptrace.h>
struct trad_core_struct
- {
- asection *data_section;
- asection *stack_section;
- asection *reg_section;
- struct ptrace_user u;
- };
+{
+ asection *data_section;
+ asection *stack_section;
+ asection *reg_section;
+ struct ptrace_user u;
+};
-#define core_upage(bfd) (&((bfd)->tdata.trad_core_data->u))
-#define core_datasec(bfd) ((bfd)->tdata.trad_core_data->data_section)
+#define core_upage(bfd) (&((bfd)->tdata.trad_core_data->u))
+#define core_datasec(bfd) ((bfd)->tdata.trad_core_data->data_section)
#define core_stacksec(bfd) ((bfd)->tdata.trad_core_data->stack_section)
-#define core_regsec(bfd) ((bfd)->tdata.trad_core_data->reg_section)
+#define core_regsec(bfd) ((bfd)->tdata.trad_core_data->reg_section)
/* forward declarations */
-const bfd_target *ptrace_unix_core_file_p PARAMS ((bfd *abfd));
-char * ptrace_unix_core_file_failing_command PARAMS ((bfd *abfd));
-int ptrace_unix_core_file_failing_signal PARAMS ((bfd *abfd));
+const bfd_target *ptrace_unix_core_file_p (bfd *abfd);
+char * ptrace_unix_core_file_failing_command (bfd *abfd);
+int ptrace_unix_core_file_failing_signal (bfd *abfd);
#define ptrace_unix_core_file_matches_executable_p generic_core_file_matches_executable_p
#define ptrace_unix_core_file_pid _bfd_nocore_core_file_pid
-static void swap_abort PARAMS ((void));
+static void swap_abort (void);
const bfd_target *
-ptrace_unix_core_file_p (abfd)
- bfd *abfd;
-
+ptrace_unix_core_file_p (bfd *abfd)
{
int val;
struct ptrace_user u;
}
char *
-ptrace_unix_core_file_failing_command (abfd)
- bfd *abfd;
+ptrace_unix_core_file_failing_command (bfd *abfd)
{
char *com = abfd->tdata.trad_core_data->u.pt_comm;
+
if (*com)
return com;
else
}
int
-ptrace_unix_core_file_failing_signal (abfd)
- bfd *abfd;
+ptrace_unix_core_file_failing_signal (bfd *abfd)
{
return abfd->tdata.trad_core_data->u.pt_sigframe.sig_num;
}
\f
/* If somebody calls any byte-swapping routines, shoot them. */
static void
-swap_abort ()
+swap_abort (void)
{
abort (); /* This way doesn't require any declaration for ANSI to fuck up */
}
NULL,
- (PTR) 0 /* backend_data */
+ NULL /* backend_data */
};
#endif /* PTRACE_CORE */
/* 8 and 16 bit COFF relocation functions, for BFD.
Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1998, 2000, 2001,
- 2002, 2003, 2004, 2005, 2007, 2008, 2009 Free Software Foundation, Inc.
+ 2002, 2003, 2004, 2005, 2007, 2008, 2009, 2012
+ Free Software Foundation, Inc.
Written by Cygnus Support.
This file is part of BFD, the Binary File Descriptor library.
#include "libcoff.h"
bfd_vma
-bfd_coff_reloc16_get_value (reloc, link_info, input_section)
- arelent *reloc;
- struct bfd_link_info *link_info;
- asection *input_section;
+bfd_coff_reloc16_get_value (arelent *reloc,
+ struct bfd_link_info *link_info,
+ asection *input_section)
{
bfd_vma value;
asymbol *symbol = *(reloc->sym_ptr_ptr);
}
void
-bfd_perform_slip (abfd, slip, input_section, value)
- bfd *abfd;
- unsigned int slip;
- asection *input_section;
- bfd_vma value;
+bfd_perform_slip (bfd *abfd,
+ unsigned int slip,
+ asection *input_section,
+ bfd_vma value)
{
asymbol **s;
}
bfd_boolean
-bfd_coff_reloc16_relax_section (abfd, input_section, link_info, again)
- bfd *abfd;
- asection *input_section;
- struct bfd_link_info *link_info;
- bfd_boolean *again;
+bfd_coff_reloc16_relax_section (bfd *abfd,
+ asection *input_section,
+ struct bfd_link_info *link_info,
+ bfd_boolean *again)
{
/* Get enough memory to hold the stuff. */
bfd *input_bfd = input_section->owner;
}
bfd_byte *
-bfd_coff_reloc16_get_relocated_section_contents (in_abfd,
- link_info,
- link_order,
- data,
- relocatable,
- symbols)
- bfd *in_abfd;
- struct bfd_link_info *link_info;
- struct bfd_link_order *link_order;
- bfd_byte *data;
- bfd_boolean relocatable;
- asymbol **symbols;
+bfd_coff_reloc16_get_relocated_section_contents
+ (bfd *in_abfd,
+ struct bfd_link_info *link_info,
+ struct bfd_link_order *link_order,
+ bfd_byte *data,
+ bfd_boolean relocatable,
+ asymbol **symbols)
{
/* Get enough memory to hold the stuff. */
bfd *input_bfd = link_order->u.indirect.section->owner;
/* BFD back end for SCO5 core files (U-area and raw sections)
Copyright 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007,
- 2010, 2011
+ 2010, 2011, 2012
Free Software Foundation, Inc.
Written by Jouke Numan <jnuman@hiscom.nl>
/* forward declarations */
-static asection *make_bfd_asection
- PARAMS ((bfd *, const char *, flagword, bfd_size_type, bfd_vma, file_ptr));
-static struct user *read_uarea PARAMS ((bfd *, int));
-const bfd_target *sco5_core_file_p PARAMS ((bfd *abfd));
-char *sco5_core_file_failing_command PARAMS ((bfd *abfd));
-int sco5_core_file_failing_signal PARAMS ((bfd *abfd));
#define sco5_core_file_matches_executable_p generic_core_file_matches_executable_p
#define sco5_core_file_pid _bfd_nocore_core_file_pid
-static void swap_abort PARAMS ((void));
static asection *
-make_bfd_asection (abfd, name, flags, size, vma, filepos)
- bfd *abfd;
- const char *name;
- flagword flags;
- bfd_size_type size;
- bfd_vma vma;
- file_ptr filepos;
+make_bfd_asection (bfd *abfd,
+ const char *name,
+ flagword flags,
+ bfd_size_type size,
+ bfd_vma vma,
+ file_ptr filepos)
{
asection *asect;
}
static struct user *
-read_uarea(abfd, filepos)
- bfd *abfd;
- int filepos;
-
+read_uarea (bfd *abfd, int filepos)
{
struct sco5_core_struct *rawptr;
bfd_size_type amt = sizeof (struct sco5_core_struct);
}
const bfd_target *
-sco5_core_file_p (abfd)
- bfd *abfd;
+sco5_core_file_p (bfd *abfd)
{
int coffset_siz, val, nsecs, cheadoffs;
int coresize;
}
char *
-sco5_core_file_failing_command (abfd)
- bfd *abfd;
+sco5_core_file_failing_command (bfd *abfd)
{
char *com = abfd->tdata.sco5_core_data->u.u_comm;
if (*com)
}
int
-sco5_core_file_failing_signal (ignore_abfd)
- bfd *ignore_abfd;
+sco5_core_file_failing_signal (bfd *ignore_abfd)
{
return ((ignore_abfd->tdata.sco5_core_data->u.u_sysabort != 0)
? ignore_abfd->tdata.sco5_core_data->u.u_sysabort
/* If somebody calls any byte-swapping routines, shoot them. */
static void
-swap_abort ()
+swap_abort (void)
{
abort (); /* This way doesn't require any declaration for ANSI to fuck up */
}
NULL,
- (PTR) 0 /* backend_data */
+ NULL /* backend_data */
};
/* HP PA-RISC SOM object file format: definitions internal to BFD.
Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1998, 2000, 2001,
- 2002, 2003, 2004, 2005, 2007, 2008 Free Software Foundation, Inc.
+ 2002, 2003, 2004, 2005, 2007, 2008, 2012 Free Software Foundation, Inc.
Contributed by the Center for Software Science at the
University of Utah (pa-gdb-bugs@cs.utah.edu).
unsigned int hppa_arg_reloc;
unsigned int hppa_priv_level;
} ap;
- PTR any;
+ void * any;
}
tc_data;
/* BFD back-end for linux flavored sparc a.out binaries.
Copyright 1992, 1993, 1994, 1995, 1996, 1997, 1999, 2000, 2001, 2002,
- 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2011
+ 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2011, 2012
Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library.
becomes important. */
static void MY_final_link_callback
- PARAMS ((bfd *, file_ptr *, file_ptr *, file_ptr *));
-
-static bfd_boolean sparclinux_bfd_final_link
- PARAMS ((bfd *abfd, struct bfd_link_info *info));
+ (bfd *, file_ptr *, file_ptr *, file_ptr *);
static bfd_boolean
-sparclinux_bfd_final_link (abfd, info)
- bfd *abfd;
- struct bfd_link_info *info;
+sparclinux_bfd_final_link (bfd *abfd, struct bfd_link_info *info)
{
obj_aout_subformat (abfd) = q_magic_format;
return NAME(aout,final_link) (abfd, info, MY_final_link_callback);
/* Set the machine type correctly. */
-static bfd_boolean sparclinux_write_object_contents PARAMS ((bfd *abfd));
-
static bfd_boolean
-sparclinux_write_object_contents (abfd)
- bfd *abfd;
+sparclinux_write_object_contents (bfd *abfd)
{
struct external_exec exec_bytes;
struct internal_exec *execp = exec_hdr (abfd);
struct fixup *fixup_list;
};
-static struct bfd_hash_entry *linux_link_hash_newfunc
- PARAMS ((struct bfd_hash_entry *, struct bfd_hash_table *, const char *));
-static struct bfd_link_hash_table *linux_link_hash_table_create
- PARAMS ((bfd *));
-static struct fixup *new_fixup
- PARAMS ((struct bfd_link_info *, struct linux_link_hash_entry *,
- bfd_vma, int));
-static bfd_boolean linux_link_create_dynamic_sections
- PARAMS ((bfd *, struct bfd_link_info *));
-static bfd_boolean linux_add_one_symbol
- PARAMS ((struct bfd_link_info *, bfd *, const char *, flagword, asection *,
- bfd_vma, const char *, bfd_boolean, bfd_boolean,
- struct bfd_link_hash_entry **));
-static bfd_boolean linux_tally_symbols
- PARAMS ((struct linux_link_hash_entry *, PTR));
-static bfd_boolean linux_finish_dynamic_link
- PARAMS ((bfd *, struct bfd_link_info *));
/* Routine to create an entry in an Linux link hash table. */
static struct bfd_hash_entry *
-linux_link_hash_newfunc (entry, table, string)
- struct bfd_hash_entry *entry;
- struct bfd_hash_table *table;
- const char *string;
+linux_link_hash_newfunc (struct bfd_hash_entry *entry,
+ struct bfd_hash_table *table,
+ const char *string)
{
struct linux_link_hash_entry *ret = (struct linux_link_hash_entry *) entry;
/* Create a Linux link hash table. */
static struct bfd_link_hash_table *
-linux_link_hash_table_create (abfd)
- bfd *abfd;
+linux_link_hash_table_create (bfd *abfd)
{
struct linux_link_hash_table *ret;
bfd_size_type amt = sizeof (struct linux_link_hash_table);
#define linux_link_hash_traverse(table, func, info) \
(aout_link_hash_traverse \
(&(table)->root, \
- (bfd_boolean (*) PARAMS ((struct aout_link_hash_entry *, PTR))) (func), \
+ (bfd_boolean (*) (struct aout_link_hash_entry *, void *)) (func), \
(info)))
/* Get the Linux link hash table from the info structure. This is
/* Store the information for a new fixup. */
static struct fixup *
-new_fixup (info, h, value, builtin)
- struct bfd_link_info *info;
- struct linux_link_hash_entry *h;
- bfd_vma value;
- int builtin;
+new_fixup (struct bfd_link_info *info,
+ struct linux_link_hash_entry *h,
+ bfd_vma value,
+ int builtin)
{
struct fixup *f;
create it for now. */
static bfd_boolean
-linux_link_create_dynamic_sections (abfd, info)
- bfd *abfd;
- struct bfd_link_info *info ATTRIBUTE_UNUSED;
+linux_link_create_dynamic_sections (bfd *abfd,
+ struct bfd_link_info *info ATTRIBUTE_UNUSED)
{
flagword flags;
- register asection *s;
+ asection *s;
/* Note that we set the SEC_IN_MEMORY flag. */
flags = SEC_ALLOC | SEC_LOAD | SEC_HAS_CONTENTS | SEC_IN_MEMORY;
tweaking needed for dynamic linking support. */
static bfd_boolean
-linux_add_one_symbol (info, abfd, name, flags, section, value, string,
- copy, collect, hashp)
- struct bfd_link_info *info;
- bfd *abfd;
- const char *name;
- flagword flags;
- asection *section;
- bfd_vma value;
- const char *string;
- bfd_boolean copy;
- bfd_boolean collect;
- struct bfd_link_hash_entry **hashp;
+linux_add_one_symbol (struct bfd_link_info *info,
+ bfd *abfd,
+ const char *name,
+ flagword flags,
+ asection *section,
+ bfd_vma value,
+ const char *string,
+ bfd_boolean copy,
+ bfd_boolean collect,
+ struct bfd_link_hash_entry **hashp)
{
struct linux_link_hash_entry *h;
bfd_boolean insert;
are required. */
bfd_boolean
-bfd_sparclinux_size_dynamic_sections (output_bfd, info)
- bfd *output_bfd;
- struct bfd_link_info *info;
+bfd_sparclinux_size_dynamic_sections (bfd *output_bfd,
+ struct bfd_link_info *info)
{
struct fixup *f;
asection *s;
/* First find the fixups... */
linux_link_hash_traverse (linux_hash_table (info),
linux_tally_symbols,
- (PTR) info);
+ info);
/* If there are builtin fixups, leave room for a marker. This is
used by the dynamic linker so that it knows that all that follow
the stuff we need. */
static bfd_boolean
-linux_finish_dynamic_link (output_bfd, info)
- bfd *output_bfd;
- struct bfd_link_info *info;
+linux_finish_dynamic_link (bfd *output_bfd, struct bfd_link_info *info)
{
asection *s, *os, *is;
bfd_byte *fixup_table;
SEEK_SET) != 0)
return FALSE;
- if (bfd_bwrite ((PTR) s->contents, s->size, output_bfd) != s->size)
+ if (bfd_bwrite (s->contents, s->size, output_bfd) != s->size)
return FALSE;
return TRUE;
/* BFD support for Sparc binaries under LynxOS.
Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1997, 1998, 2000,
- 2001, 2002, 2003, 2005, 2007 Free Software Foundation, Inc.
+ 2001, 2002, 2003, 2005, 2007, 2012 Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library.
#include "aout/stab_gnu.h"
#include "aout/ar.h"
-void NAME (lynx,set_arch_mach) PARAMS ((bfd *, unsigned long));
-static void choose_reloc_size PARAMS ((bfd *));
-static bfd_boolean NAME (aout,sparclynx_write_object_contents) PARAMS ((bfd *));
+void NAME (lynx,set_arch_mach) (bfd *, unsigned long);
+static void choose_reloc_size (bfd *);
+static bfd_boolean NAME (aout,sparclynx_write_object_contents) (bfd *);
/* This is needed to reject a NewsOS file, e.g. in
gdb/testsuite/gdb.t10/crossload.exp. <kingdon@cygnus.com>
I needed to add M_UNKNOWN to recognize a 68000 object, so this will
probably no longer reject a NewsOS object. <ian@cygnus.com>. */
-#define MACHTYPE_OK(mtype) ((mtype) == M_UNKNOWN \
+#define MACHTYPE_OK(mtype) ( (mtype) == M_UNKNOWN \
|| (mtype) == M_68010 \
|| (mtype) == M_68020 \
|| (mtype) == M_SPARC)
@end table */
void
-NAME(lynx,set_arch_mach) (abfd, machtype)
- bfd *abfd;
- unsigned long machtype;
+NAME(lynx,set_arch_mach) (bfd *abfd, unsigned long machtype)
{
/* Determine the architecture and machine type of the object file. */
enum bfd_architecture arch;
/* Determine the size of a relocation entry, based on the architecture. */
static void
-choose_reloc_size (abfd)
- bfd *abfd;
+choose_reloc_size (bfd *abfd)
{
switch (bfd_get_arch (abfd))
{
file header, symbols, and relocation. */
static bfd_boolean
-NAME(aout,sparclynx_write_object_contents) (abfd)
- bfd *abfd;
+NAME(aout,sparclynx_write_object_contents) (bfd *abfd)
{
struct external_exec exec_bytes;
struct internal_exec *execp = exec_hdr (abfd);
}
#define MY_set_sizes sparclynx_set_sizes
-static bfd_boolean sparclynx_set_sizes PARAMS ((bfd *));
+static bfd_boolean sparclynx_set_sizes (bfd *);
static bfd_boolean
-sparclynx_set_sizes (abfd)
- bfd *abfd;
+sparclynx_set_sizes (bfd *abfd)
{
switch (bfd_get_arch (abfd))
{
#define MY_bfd_debug_info_start bfd_void
#define MY_bfd_debug_info_end bfd_void
#define MY_bfd_debug_info_accumulate \
- (void (*) PARAMS ((bfd *, struct bfd_section *))) bfd_void
+ (void (*) (bfd *, struct bfd_section *)) bfd_void
#define MY_write_object_contents NAME(aout,sparclynx_write_object_contents)
#define MY_backend_data &sparclynx_aout_backend
#define F_LSYMS F_LSYMS_TICOFF
static bfd_boolean
-ticoff0_bad_format_hook (abfd, filehdr)
- bfd *abfd;
- PTR filehdr;
+ticoff0_bad_format_hook (bfd * abfd,
+ void * filehdr)
{
struct internal_filehdr *internal_f = (struct internal_filehdr *) filehdr;
}
static bfd_boolean
-ticoff1_bad_format_hook (abfd, filehdr)
- bfd *abfd ATTRIBUTE_UNUSED;
- PTR filehdr;
+ticoff1_bad_format_hook (bfd * abfd ATTRIBUTE_UNUSED,
+ void * filehdr)
{
struct internal_filehdr *internal_f = (struct internal_filehdr *) filehdr;
/* Replace the stock _bfd_coff_is_local_label_name
to recognize TI COFF local labels. */
static bfd_boolean
-ticoff_bfd_is_local_label_name (abfd, name)
- bfd *abfd ATTRIBUTE_UNUSED;
- const char *name;
+ticoff_bfd_is_local_label_name (bfd *abfd ATTRIBUTE_UNUSED,
+ const char *name)
{
if (TICOFF_LOCAL_LABEL_P(name))
return TRUE;
/* BFD back end for traditional Unix core files (U-area and raw sections)
Copyright 1988, 1989, 1991, 1992, 1993, 1994, 1995, 1996, 1998, 1999,
- 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2011
+ 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2011, 2012
Free Software Foundation, Inc.
Written by John Gilmore of Cygnus Support.
struct user u;
};
-#define core_upage(bfd) (&((bfd)->tdata.trad_core_data->u))
-#define core_datasec(bfd) ((bfd)->tdata.trad_core_data->data_section)
+#define core_upage(bfd) (&((bfd)->tdata.trad_core_data->u))
+#define core_datasec(bfd) ((bfd)->tdata.trad_core_data->data_section)
#define core_stacksec(bfd) ((bfd)->tdata.trad_core_data->stack_section)
-#define core_regsec(bfd) ((bfd)->tdata.trad_core_data->reg_section)
+#define core_regsec(bfd) ((bfd)->tdata.trad_core_data->reg_section)
/* forward declarations */
-const bfd_target *trad_unix_core_file_p PARAMS ((bfd *abfd));
-char * trad_unix_core_file_failing_command PARAMS ((bfd *abfd));
-int trad_unix_core_file_failing_signal PARAMS ((bfd *abfd));
#define trad_unix_core_file_matches_executable_p generic_core_file_matches_executable_p
#define trad_unix_core_file_pid _bfd_nocore_core_file_pid
-static void swap_abort PARAMS ((void));
-/* Handle 4.2-style (and perhaps also sysV-style) core dump file. */
-const bfd_target *
-trad_unix_core_file_p (abfd)
- bfd *abfd;
+/* Handle 4.2-style (and perhaps also sysV-style) core dump file. */
+static const bfd_target *
+trad_unix_core_file_p (bfd *abfd)
{
int val;
struct user u;
return NULL;
}
-char *
-trad_unix_core_file_failing_command (abfd)
- bfd *abfd;
+static char *
+trad_unix_core_file_failing_command (bfd *abfd)
{
#ifndef NO_CORE_COMMAND
char *com = abfd->tdata.trad_core_data->u.u_comm;
return 0;
}
-int
-trad_unix_core_file_failing_signal (ignore_abfd)
- bfd *ignore_abfd ATTRIBUTE_UNUSED;
+static int
+trad_unix_core_file_failing_signal (bfd *ignore_abfd ATTRIBUTE_UNUSED)
{
#ifdef TRAD_UNIX_CORE_FILE_FAILING_SIGNAL
return TRAD_UNIX_CORE_FILE_FAILING_SIGNAL(ignore_abfd);
\f
/* If somebody calls any byte-swapping routines, shoot them. */
static void
-swap_abort ()
+swap_abort (void)
{
abort (); /* This way doesn't require any declaration for ANSI to fuck up */
}
NULL,
- (PTR) 0 /* backend_data */
+ NULL /* backend_data */
};
NULL,
- (PTR) 0
+ NULL
};
extern bfd_boolean bfd_sym_mkobject
(bfd *);
extern void bfd_sym_print_symbol
- (bfd *, PTR, asymbol *, bfd_print_symbol_type);
+ (bfd *, void *, asymbol *, bfd_print_symbol_type);
extern bfd_boolean bfd_sym_valid
(bfd *);
extern unsigned char * bfd_sym_read_name_table