* 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.
This commit is contained in:
@@ -1,3 +1,102 @@
|
||||
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
|
||||
|
||||
+14
-16
@@ -2,7 +2,7 @@
|
||||
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>.
|
||||
@@ -59,32 +59,31 @@
|
||||
(((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);
|
||||
@@ -104,7 +103,7 @@ aix386_core_file_p (abfd)
|
||||
|
||||
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);
|
||||
@@ -196,15 +195,13 @@ aix386_core_file_p (abfd)
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
@@ -216,7 +213,7 @@ aix386_core_file_failing_signal (abfd)
|
||||
/* 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 ();
|
||||
@@ -229,7 +226,8 @@ swap_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 */
|
||||
@@ -269,5 +267,5 @@ const bfd_target aix386_core_vec = {
|
||||
|
||||
NULL,
|
||||
|
||||
(PTR) 0
|
||||
NULL
|
||||
};
|
||||
|
||||
+6
-3
@@ -147,7 +147,8 @@ extern int errno;
|
||||
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;
|
||||
};
|
||||
@@ -168,6 +169,7 @@ _bfd_ar_spacepad (char *p, size_t n, const char *fmt, long val)
|
||||
{
|
||||
static char buf[20];
|
||||
size_t len;
|
||||
|
||||
snprintf (buf, sizeof (buf), fmt, val);
|
||||
len = strlen (buf);
|
||||
if (len < n)
|
||||
@@ -296,6 +298,7 @@ _bfd_look_for_bfd_in_cache (bfd *arch_bfd, file_ptr filepos)
|
||||
{
|
||||
htab_t hash_table = bfd_ardata (arch_bfd)->cache;
|
||||
struct ar_cache m;
|
||||
|
||||
m.ptr = filepos;
|
||||
|
||||
if (hash_table)
|
||||
@@ -311,7 +314,7 @@ _bfd_look_for_bfd_in_cache (bfd *arch_bfd, file_ptr filepos)
|
||||
}
|
||||
|
||||
static hashval_t
|
||||
hash_file_ptr (const PTR p)
|
||||
hash_file_ptr (const void * p)
|
||||
{
|
||||
return (hashval_t) (((struct ar_cache *) p)->ptr);
|
||||
}
|
||||
@@ -319,7 +322,7 @@ hash_file_ptr (const PTR p)
|
||||
/* 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;
|
||||
|
||||
+4
-4
@@ -563,15 +563,15 @@ bfd_open_file (bfd *abfd)
|
||||
{
|
||||
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
|
||||
{
|
||||
@@ -601,7 +601,7 @@ bfd_open_file (bfd *abfd)
|
||||
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;
|
||||
|
||||
+18
-24
@@ -1,6 +1,6 @@
|
||||
/* 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.
|
||||
@@ -38,7 +38,8 @@
|
||||
# define SIGBUS 10
|
||||
#endif
|
||||
|
||||
int crash_info_locs[] = {
|
||||
int crash_info_locs[] =
|
||||
{
|
||||
0x0250, /* mips, ppc, x86, i960 */
|
||||
0x0400, /* m68k, mips, x86, i960 */
|
||||
0x0FFC, /* m68k, mips, ppc, x86, i960 */
|
||||
@@ -50,13 +51,15 @@ int crash_info_locs[] = {
|
||||
#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 */
|
||||
@@ -73,10 +76,6 @@ struct cisco_core_struct
|
||||
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
|
||||
|
||||
@@ -84,9 +83,7 @@ int cisco_core_file_failing_signal PARAMS ((bfd *));
|
||||
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;
|
||||
@@ -292,8 +289,7 @@ cisco_core_file_validate (abfd, crash_info_loc)
|
||||
}
|
||||
|
||||
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;
|
||||
@@ -308,15 +304,13 @@ cisco_core_file_p (abfd)
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
@@ -324,7 +318,7 @@ cisco_core_file_failing_signal (abfd)
|
||||
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 */
|
||||
@@ -371,11 +365,11 @@ const bfd_target cisco_core_big_vec =
|
||||
|
||||
& 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 */
|
||||
@@ -422,5 +416,5 @@ const bfd_target cisco_core_little_vec =
|
||||
|
||||
&cisco_core_big_vec,
|
||||
|
||||
(PTR) 0 /* backend_data */
|
||||
NULL /* backend_data */
|
||||
};
|
||||
|
||||
+63
-121
@@ -1,6 +1,6 @@
|
||||
/* 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>.
|
||||
@@ -37,40 +37,7 @@
|
||||
|
||||
/* 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));
|
||||
|
||||
|
||||
/* ECOFF has COFF sections, but the debugging information is stored in
|
||||
a completely different format. ECOFF targets use some of the
|
||||
@@ -128,18 +95,14 @@ static bfd *alpha_ecoff_get_elt_at_index
|
||||
|
||||
/* 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;
|
||||
}
|
||||
@@ -438,8 +401,7 @@ static reloc_howto_type alpha_howto_table[] =
|
||||
/* 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;
|
||||
|
||||
@@ -477,9 +439,8 @@ alpha_ecoff_object_p (abfd)
|
||||
/* 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;
|
||||
|
||||
@@ -498,13 +459,10 @@ alpha_ecoff_bad_format_hook (abfd, 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);
|
||||
|
||||
@@ -534,10 +492,9 @@ alpha_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;
|
||||
|
||||
@@ -582,10 +539,9 @@ alpha_ecoff_swap_reloc_in (abfd, ext_ptr, intern)
|
||||
/* 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;
|
||||
@@ -637,10 +593,9 @@ alpha_ecoff_swap_reloc_out (abfd, intern, dst)
|
||||
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)
|
||||
{
|
||||
@@ -729,10 +684,9 @@ alpha_adjust_reloc_in (abfd, intern, rptr)
|
||||
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)
|
||||
{
|
||||
@@ -771,14 +725,12 @@ alpha_adjust_reloc_out (abfd, rel, intern)
|
||||
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;
|
||||
@@ -1195,9 +1147,8 @@ alpha_ecoff_get_relocated_section_contents (abfd, link_info, link_order,
|
||||
/* 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;
|
||||
|
||||
@@ -1268,12 +1219,11 @@ alpha_bfd_reloc_name_lookup (bfd *abfd ATTRIBUTE_UNUSED,
|
||||
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;
|
||||
@@ -1385,14 +1335,12 @@ alpha_convert_external_reloc (output_bfd, info, input_bfd, ext_rel, h)
|
||||
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;
|
||||
@@ -2042,10 +1990,9 @@ alpha_relocate_section (output_bfd, info, input_bfd, input_section,
|
||||
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;
|
||||
@@ -2077,9 +2024,8 @@ alpha_adjust_headers (abfd, fhdr, ahdr)
|
||||
/* 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;
|
||||
@@ -2103,16 +2049,14 @@ alpha_ecoff_read_ar_hdr (abfd)
|
||||
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;
|
||||
@@ -2225,7 +2169,7 @@ alpha_ecoff_get_elt_at_filepos (archive, filepos)
|
||||
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);
|
||||
@@ -2243,9 +2187,7 @@ alpha_ecoff_get_elt_at_filepos (archive, filepos)
|
||||
/* 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;
|
||||
|
||||
@@ -2291,13 +2233,13 @@ static const struct ecoff_backend_data alpha_ecoff_backend_data =
|
||||
{
|
||||
/* 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,
|
||||
@@ -2448,5 +2390,5 @@ const bfd_target ecoffalpha_little_vec =
|
||||
|
||||
NULL,
|
||||
|
||||
(PTR) &alpha_ecoff_backend_data
|
||||
& alpha_ecoff_backend_data
|
||||
};
|
||||
|
||||
+5
-8
@@ -1,6 +1,6 @@
|
||||
/* 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.
|
||||
|
||||
@@ -52,14 +52,12 @@ reloc_howto_type apollocoff_howto_table[] =
|
||||
|
||||
/* 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)
|
||||
{
|
||||
@@ -74,8 +72,7 @@ apollo_rtype2howto (internal, relocentry)
|
||||
}
|
||||
|
||||
int
|
||||
apollo_howto2rtype (internal)
|
||||
reloc_howto_type *internal;
|
||||
apollo_howto2rtype (reloc_howto_type *internal)
|
||||
{
|
||||
if (internal->pc_relative)
|
||||
{
|
||||
|
||||
+16
-18
@@ -1,5 +1,5 @@
|
||||
/* 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>.
|
||||
|
||||
@@ -42,12 +42,12 @@
|
||||
#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
|
||||
@@ -63,18 +63,16 @@ static bfd_boolean coff_m68k_aux_link_add_one_symbol
|
||||
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;
|
||||
|
||||
|
||||
+10
-31
@@ -1,6 +1,6 @@
|
||||
/* 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>.
|
||||
|
||||
@@ -60,28 +60,6 @@ struct funcvec_hash_table
|
||||
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) \
|
||||
@@ -224,13 +202,13 @@ h8300_coff_link_hash_table_create (bfd *abfd)
|
||||
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;
|
||||
@@ -240,7 +218,8 @@ special (bfd *abfd ATTRIBUTE_UNUSED,
|
||||
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),
|
||||
|
||||
+16
-24
@@ -1,6 +1,6 @@
|
||||
/* 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>.
|
||||
|
||||
@@ -29,10 +29,6 @@
|
||||
#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)
|
||||
|
||||
@@ -73,8 +69,7 @@ HOWTO (R_H8500_HIGH16, 0, 1, 8, FALSE, 0,
|
||||
/* 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;
|
||||
}
|
||||
@@ -96,9 +91,7 @@ coff_h8500_select_reloc (howto)
|
||||
/* Code to turn a r_type into a howto ptr, uses the above howto table. */
|
||||
|
||||
static void
|
||||
rtype2howto (internal, dst)
|
||||
arelent * internal;
|
||||
struct internal_reloc *dst;
|
||||
rtype2howto (arelent * internal, struct internal_reloc *dst)
|
||||
{
|
||||
switch (dst->r_type)
|
||||
{
|
||||
@@ -145,12 +138,12 @@ rtype2howto (internal, dst)
|
||||
#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);
|
||||
@@ -165,14 +158,13 @@ static void reloc_processing (relent, reloc, symbols, abfd, section)
|
||||
}
|
||||
|
||||
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;
|
||||
|
||||
+27
-48
@@ -1,6 +1,6 @@
|
||||
/* 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.
|
||||
|
||||
@@ -43,8 +43,6 @@
|
||||
|
||||
#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 *,
|
||||
@@ -67,15 +65,13 @@ static reloc_howto_type *coff_i386_reloc_type_lookup
|
||||
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;
|
||||
|
||||
@@ -189,11 +185,8 @@ coff_i386_reloc (abfd, reloc_entry, symbol, data, input_section, output_bfd,
|
||||
/* 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;
|
||||
@@ -413,22 +406,15 @@ static reloc_howto_type howto_table[] =
|
||||
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;
|
||||
@@ -445,13 +431,12 @@ coff_pe_i386_relocate_section (output_bfd, info, input_bfd,
|
||||
/* 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;
|
||||
|
||||
@@ -556,9 +541,8 @@ coff_i386_rtype_to_howto (abfd, sec, rel, h, sym, addendp)
|
||||
#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)
|
||||
{
|
||||
@@ -608,13 +592,8 @@ coff_i386_reloc_name_lookup (bfd *abfd ATTRIBUTE_UNUSED,
|
||||
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;
|
||||
|
||||
+38
-66
@@ -1,6 +1,6 @@
|
||||
/* 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.
|
||||
|
||||
@@ -36,22 +36,6 @@
|
||||
|
||||
#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
|
||||
@@ -68,9 +52,7 @@ static bfd_boolean coff_i960_adjust_symndx
|
||||
/* 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] == '.'
|
||||
@@ -108,15 +90,13 @@ coff_i960_is_local_label_name (abfd, name)
|
||||
#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
|
||||
@@ -198,15 +178,13 @@ optcall_callback (abfd, reloc_entry, symbol_in, data,
|
||||
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;
|
||||
|
||||
@@ -261,11 +239,11 @@ coff_i960_relocate (abfd, reloc_entry, symbol, data, input_section,
|
||||
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
|
||||
@@ -285,9 +263,8 @@ static reloc_howto_type howto_optcall =
|
||||
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)
|
||||
{
|
||||
@@ -341,9 +318,7 @@ coff_i960_reloc_name_lookup (bfd *abfd ATTRIBUTE_UNUSED,
|
||||
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;
|
||||
@@ -370,7 +345,7 @@ coff_i960_start_final_link (abfd, info)
|
||||
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)
|
||||
{
|
||||
@@ -389,16 +364,14 @@ coff_i960_start_final_link (abfd, info)
|
||||
/* 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;
|
||||
@@ -530,9 +503,9 @@ coff_i960_relocate_section (output_bfd, info, input_bfd, input_section,
|
||||
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;
|
||||
}
|
||||
|
||||
@@ -601,13 +574,12 @@ coff_i960_relocate_section (output_bfd, info, input_bfd, input_section,
|
||||
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;
|
||||
|
||||
|
||||
+4
-10
@@ -1,5 +1,5 @@
|
||||
/* 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>
|
||||
|
||||
@@ -54,12 +54,9 @@ static reloc_howto_type howto_table[] =
|
||||
/* 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... */
|
||||
}
|
||||
@@ -71,11 +68,8 @@ in_reloc_p(abfd, howto)
|
||||
|
||||
#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
|
||||
{
|
||||
|
||||
+42
-64
@@ -1,6 +1,6 @@
|
||||
/* 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.
|
||||
|
||||
@@ -60,25 +60,19 @@
|
||||
#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;
|
||||
@@ -121,12 +115,11 @@ reloc_howto_type m68kcoff_howto_table[] =
|
||||
/* 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
|
||||
@@ -135,16 +128,13 @@ extern reloc_howto_type *m68k_reloc_name_lookup
|
||||
#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)
|
||||
{
|
||||
@@ -159,8 +149,7 @@ m68k_rtype2howto(internal, relocentry)
|
||||
}
|
||||
|
||||
STAT_REL int
|
||||
m68k_howto2rtype (internal)
|
||||
reloc_howto_type *internal;
|
||||
m68k_howto2rtype (reloc_howto_type * internal)
|
||||
{
|
||||
if (internal->pc_relative)
|
||||
{
|
||||
@@ -184,9 +173,8 @@ m68k_howto2rtype (internal)
|
||||
}
|
||||
|
||||
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)
|
||||
{
|
||||
@@ -235,19 +223,13 @@ m68k_reloc_name_lookup (bfd *abfd ATTRIBUTE_UNUSED,
|
||||
|
||||
#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;
|
||||
@@ -279,15 +261,13 @@ m68kcoff_rtype_to_howto (abfd, sec, rel, h, sym, addendp)
|
||||
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;
|
||||
|
||||
@@ -402,13 +382,12 @@ m68kcoff_common_addend_special_fn (abfd, reloc_entry, symbol, data,
|
||||
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;
|
||||
@@ -456,12 +435,11 @@ m68kcoff_common_addend_rtype_to_howto (abfd, sec, rel, h, sym, addendp)
|
||||
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;
|
||||
|
||||
+16
-27
@@ -1,6 +1,6 @@
|
||||
/* 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.
|
||||
@@ -28,12 +28,8 @@
|
||||
#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)
|
||||
|
||||
@@ -45,23 +41,19 @@ static void reloc_processing
|
||||
#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;
|
||||
|
||||
@@ -236,9 +228,7 @@ static reloc_howto_type howto_table[] =
|
||||
/* 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)
|
||||
{
|
||||
@@ -260,12 +250,11 @@ rtype2howto (cache_ptr, dst)
|
||||
reloc_processing(relent, reloc, symbols, abfd, section)
|
||||
|
||||
static void
|
||||
reloc_processing (relent, reloc, symbols, abfd, section)
|
||||
arelent *relent;
|
||||
struct internal_reloc *reloc;
|
||||
asymbol **symbols;
|
||||
bfd *abfd;
|
||||
asection *section;
|
||||
reloc_processing (arelent *relent,
|
||||
struct internal_reloc *reloc,
|
||||
asymbol **symbols,
|
||||
bfd *abfd,
|
||||
asection *section)
|
||||
{
|
||||
relent->address = reloc->r_vaddr;
|
||||
rtype2howto (relent, reloc);
|
||||
|
||||
+28
-45
@@ -1,5 +1,5 @@
|
||||
/* 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.
|
||||
@@ -39,19 +39,10 @@
|
||||
/* 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 **);
|
||||
|
||||
|
||||
/* 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
|
||||
@@ -241,15 +232,13 @@ mcore_emit_base_file_entry (struct bfd_link_info *info,
|
||||
}
|
||||
|
||||
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);
|
||||
|
||||
@@ -266,9 +255,8 @@ mcore_coff_unsupported_reloc (abfd, reloc_entry, symbol, data, input_section,
|
||||
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)
|
||||
{
|
||||
@@ -307,13 +295,12 @@ mcore_coff_reloc_name_lookup (bfd *abfd ATTRIBUTE_UNUSED,
|
||||
(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;
|
||||
|
||||
@@ -348,25 +335,21 @@ coff_mcore_rtype_to_howto (abfd, sec, rel, h, sym, addendp)
|
||||
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;
|
||||
}
|
||||
|
||||
/* 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;
|
||||
|
||||
+85
-142
@@ -1,6 +1,6 @@
|
||||
/* 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.
|
||||
@@ -35,37 +35,19 @@
|
||||
#include "libecoff.h"
|
||||
|
||||
/* 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));
|
||||
|
||||
/* ECOFF has COFF sections, but the debugging information is stored in
|
||||
a completely different format. ECOFF targets use some of the
|
||||
@@ -79,12 +61,12 @@ static reloc_howto_type *mips_bfd_reloc_type_lookup
|
||||
#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"
|
||||
|
||||
@@ -253,9 +235,7 @@ static reloc_howto_type mips_howto_table[] =
|
||||
/* 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;
|
||||
|
||||
@@ -287,10 +267,9 @@ mips_ecoff_bad_format_hook (abfd, 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;
|
||||
|
||||
@@ -326,10 +305,9 @@ mips_ecoff_swap_reloc_in (abfd, ext_ptr, intern)
|
||||
/* 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;
|
||||
@@ -367,10 +345,9 @@ mips_ecoff_swap_reloc_out (abfd, intern, dst)
|
||||
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 ();
|
||||
@@ -392,10 +369,9 @@ mips_adjust_reloc_in (abfd, intern, rptr)
|
||||
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)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -411,20 +387,13 @@ mips_adjust_reloc_out (abfd, rel, intern)
|
||||
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
|
||||
@@ -458,20 +427,13 @@ struct mips_hi
|
||||
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;
|
||||
@@ -524,20 +486,13 @@ mips_refhi_reloc (abfd,
|
||||
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)
|
||||
{
|
||||
@@ -592,20 +547,13 @@ mips_reflo_reloc (abfd,
|
||||
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;
|
||||
@@ -732,9 +680,8 @@ mips_gprel_reloc (abfd,
|
||||
/* 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;
|
||||
|
||||
@@ -794,14 +741,12 @@ mips_bfd_reloc_name_lookup (bfd *abfd ATTRIBUTE_UNUSED,
|
||||
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;
|
||||
@@ -841,14 +786,12 @@ mips_relocate_hi (refhi, reflo, input_bfd, input_section, contents,
|
||||
/* 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;
|
||||
@@ -928,7 +871,7 @@ mips_relocate_section (output_bfd, info, input_bfd, input_section,
|
||||
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;
|
||||
@@ -951,7 +894,7 @@ mips_relocate_section (output_bfd, info, input_bfd, input_section,
|
||||
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;
|
||||
@@ -1190,7 +1133,7 @@ mips_relocate_section (output_bfd, info, input_bfd, input_section,
|
||||
- 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
|
||||
{
|
||||
@@ -1303,13 +1246,13 @@ static const struct ecoff_backend_data mips_ecoff_backend_data =
|
||||
{
|
||||
/* 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,
|
||||
@@ -1466,7 +1409,7 @@ const bfd_target ecoff_little_vec =
|
||||
|
||||
& ecoff_big_vec,
|
||||
|
||||
(PTR) &mips_ecoff_backend_data
|
||||
& mips_ecoff_backend_data
|
||||
};
|
||||
|
||||
const bfd_target ecoff_big_vec =
|
||||
@@ -1510,7 +1453,7 @@ const bfd_target ecoff_big_vec =
|
||||
|
||||
& ecoff_little_vec,
|
||||
|
||||
(PTR) &mips_ecoff_backend_data
|
||||
& mips_ecoff_backend_data
|
||||
};
|
||||
|
||||
const bfd_target ecoff_biglittle_vec =
|
||||
@@ -1555,5 +1498,5 @@ const bfd_target ecoff_biglittle_vec =
|
||||
|
||||
NULL,
|
||||
|
||||
(PTR) &mips_ecoff_backend_data
|
||||
& mips_ecoff_backend_data
|
||||
};
|
||||
|
||||
+29
-46
@@ -1,5 +1,5 @@
|
||||
/* 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>
|
||||
|
||||
@@ -29,18 +29,8 @@
|
||||
#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)
|
||||
|
||||
@@ -61,8 +51,7 @@ static void reloc_processing
|
||||
/* Provided the symbol, returns the value reffed. */
|
||||
|
||||
static long
|
||||
get_symbol_value (symbol)
|
||||
asymbol *symbol;
|
||||
get_symbol_value (asymbol *symbol)
|
||||
{
|
||||
long relocation = 0;
|
||||
|
||||
@@ -79,15 +68,13 @@ get_symbol_value (symbol)
|
||||
/* 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. */
|
||||
@@ -289,12 +276,11 @@ static reloc_howto_type howto_table[] =
|
||||
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;
|
||||
|
||||
@@ -333,16 +319,14 @@ reloc_processing (relent,reloc, symbols, abfd, section)
|
||||
/* 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;
|
||||
@@ -554,13 +538,12 @@ coff_or32_relocate_section (output_bfd, info, input_bfd, input_section,
|
||||
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;
|
||||
|
||||
+111
-203
@@ -1,7 +1,7 @@
|
||||
/* 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)
|
||||
|
||||
@@ -52,9 +52,8 @@
|
||||
|
||||
/* 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
|
||||
@@ -123,26 +122,12 @@ struct ppc_coff_link_hash_table
|
||||
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;
|
||||
@@ -180,9 +165,10 @@ ppc_coff_link_hash_newfunc (entry, table, string)
|
||||
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);
|
||||
@@ -191,8 +177,7 @@ ppc_coff_link_hash_table_init (struct ppc_coff_link_hash_table *table,
|
||||
/* 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);
|
||||
@@ -314,55 +299,19 @@ ppc_coff_link_hash_table_create (abfd)
|
||||
/* 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));
|
||||
|
||||
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_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 **);
|
||||
|
||||
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));
|
||||
|
||||
/* 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. */
|
||||
@@ -816,15 +765,11 @@ struct list_ele
|
||||
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);
|
||||
@@ -852,19 +797,13 @@ record_toc (toc_section, our_toc_offset, cat, name)
|
||||
|
||||
#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;
|
||||
@@ -937,10 +876,9 @@ ppc_record_toc_entry(abfd, info, sec, sym, toc_kind)
|
||||
|
||||
/* 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;
|
||||
|
||||
@@ -959,9 +897,9 @@ ppc_mark_symbol_as_glue(abfd, sym, rel)
|
||||
/* 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)
|
||||
@@ -993,16 +931,14 @@ write_base_file_entry (bfd *obfd, struct bfd_link_info *info, bfd_vma addr)
|
||||
/* 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;
|
||||
@@ -1523,8 +1459,7 @@ static char *
|
||||
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;
|
||||
@@ -1570,8 +1505,7 @@ dump_toc (vfile)
|
||||
}
|
||||
|
||||
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;
|
||||
@@ -1601,9 +1535,8 @@ ppc_allocate_toc_section (info)
|
||||
}
|
||||
|
||||
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;
|
||||
@@ -1664,15 +1597,13 @@ ppc_process_before_allocation (abfd, info)
|
||||
#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);
|
||||
@@ -1684,15 +1615,13 @@ ppc_refhi_reloc (abfd, reloc_entry, symbol, data,
|
||||
}
|
||||
|
||||
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);
|
||||
@@ -1702,17 +1631,15 @@ ppc_pair_reloc (abfd, reloc_entry, symbol, data,
|
||||
|
||||
return bfd_reloc_undefined;
|
||||
}
|
||||
|
||||
|
||||
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);
|
||||
@@ -1724,15 +1651,13 @@ ppc_toc16_reloc (abfd, reloc_entry, symbol, data,
|
||||
}
|
||||
|
||||
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);
|
||||
@@ -1744,15 +1669,13 @@ ppc_secrel_reloc (abfd, reloc_entry, symbol, data,
|
||||
}
|
||||
|
||||
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);
|
||||
@@ -1764,15 +1687,14 @@ ppc_section_reloc (abfd, reloc_entry, symbol, data,
|
||||
}
|
||||
|
||||
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);
|
||||
@@ -1789,12 +1711,9 @@ ppc_imglue_reloc (abfd, reloc_entry, symbol, data,
|
||||
/* 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:
|
||||
@@ -1854,13 +1773,12 @@ ppc_coff_rtype2howto (relent, internal)
|
||||
}
|
||||
|
||||
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;
|
||||
|
||||
@@ -1929,13 +1847,9 @@ coff_ppc_rtype_to_howto (abfd, sec, rel, h, sym, addendp)
|
||||
#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)
|
||||
{
|
||||
@@ -2012,12 +1926,8 @@ ppc_coff_reloc_name_lookup (bfd *abfd ATTRIBUTE_UNUSED,
|
||||
|
||||
#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;
|
||||
@@ -2026,7 +1936,7 @@ ppc_do_last (abfd)
|
||||
}
|
||||
|
||||
static bfd *
|
||||
ppc_get_last()
|
||||
ppc_get_last (void)
|
||||
{
|
||||
return bfd_of_toc_owner;
|
||||
}
|
||||
@@ -2045,9 +1955,7 @@ ppc_get_last()
|
||||
/* 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;
|
||||
@@ -2391,8 +2299,8 @@ ppc_bfd_coff_final_link (abfd, info)
|
||||
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)
|
||||
@@ -2443,12 +2351,12 @@ ppc_bfd_coff_final_link (abfd, info)
|
||||
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;
|
||||
}
|
||||
|
||||
|
||||
+52
-52
@@ -1,6 +1,6 @@
|
||||
/* 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.
|
||||
@@ -40,20 +40,20 @@ extern reloc_howto_type *_bfd_xcoff_reloc_type_lookup
|
||||
(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 *);
|
||||
@@ -129,12 +129,12 @@ static bfd_boolean xcoff_write_armap_big
|
||||
(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 **);
|
||||
@@ -451,7 +451,7 @@ xcoff_find_nearest_line (bfd *abfd,
|
||||
|
||||
|
||||
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;
|
||||
@@ -474,7 +474,7 @@ _bfd_xcoff_swap_sym_in (bfd *abfd, PTR ext1, PTR 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;
|
||||
@@ -498,8 +498,8 @@ _bfd_xcoff_swap_sym_out (bfd *abfd, PTR inp, PTR 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;
|
||||
@@ -608,15 +608,15 @@ _bfd_xcoff_swap_aux_in (bfd *abfd, PTR ext1, int type, int in_class,
|
||||
}
|
||||
|
||||
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:
|
||||
@@ -1263,7 +1263,7 @@ _bfd_xcoff_slurp_armap (bfd *abfd)
|
||||
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;
|
||||
|
||||
@@ -1279,7 +1279,7 @@ _bfd_xcoff_slurp_armap (bfd *abfd)
|
||||
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. */
|
||||
@@ -1318,7 +1318,7 @@ _bfd_xcoff_slurp_armap (bfd *abfd)
|
||||
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;
|
||||
|
||||
@@ -1337,7 +1337,7 @@ _bfd_xcoff_slurp_armap (bfd *abfd)
|
||||
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. */
|
||||
@@ -1390,7 +1390,7 @@ _bfd_xcoff_archive_p (bfd *abfd)
|
||||
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);
|
||||
@@ -1429,7 +1429,7 @@ _bfd_xcoff_archive_p (bfd *abfd)
|
||||
|
||||
/* 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);
|
||||
@@ -1456,7 +1456,7 @@ _bfd_xcoff_archive_p (bfd *abfd)
|
||||
|
||||
/* 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);
|
||||
@@ -1489,7 +1489,7 @@ _bfd_xcoff_archive_p (bfd *abfd)
|
||||
|
||||
/* Read the archive header in an XCOFF archive. */
|
||||
|
||||
PTR
|
||||
void *
|
||||
_bfd_xcoff_read_ar_hdr (bfd *abfd)
|
||||
{
|
||||
bfd_size_type namlen;
|
||||
@@ -1505,7 +1505,7 @@ _bfd_xcoff_read_ar_hdr (bfd *abfd)
|
||||
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);
|
||||
@@ -1537,7 +1537,7 @@ _bfd_xcoff_read_ar_hdr (bfd *abfd)
|
||||
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);
|
||||
@@ -1572,7 +1572,7 @@ _bfd_xcoff_read_ar_hdr (bfd *abfd)
|
||||
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. */
|
||||
@@ -1713,7 +1713,7 @@ xcoff_write_armap_old (bfd *abfd, unsigned int elength ATTRIBUTE_UNUSED,
|
||||
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))
|
||||
@@ -2230,20 +2230,20 @@ xcoff_write_archive_contents_old (bfd *abfd)
|
||||
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;
|
||||
}
|
||||
@@ -2254,7 +2254,7 @@ xcoff_write_archive_contents_old (bfd *abfd)
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
@@ -2268,7 +2268,7 @@ xcoff_write_archive_contents_old (bfd *abfd)
|
||||
{
|
||||
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;
|
||||
}
|
||||
@@ -2281,7 +2281,7 @@ xcoff_write_archive_contents_old (bfd *abfd)
|
||||
*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;
|
||||
|
||||
@@ -2509,7 +2509,7 @@ xcoff_write_archive_contents_big (bfd *abfd)
|
||||
/* 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;
|
||||
}
|
||||
@@ -2517,7 +2517,7 @@ xcoff_write_archive_contents_big (bfd *abfd)
|
||||
/* 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;
|
||||
|
||||
@@ -2559,7 +2559,7 @@ _bfd_xcoff_sizeof_headers (bfd *abfd,
|
||||
/* 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;
|
||||
|
||||
@@ -2576,7 +2576,7 @@ xcoff_swap_ldhdr_in (bfd *abfd, const PTR s, struct internal_ldhdr *dst)
|
||||
/* 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;
|
||||
|
||||
@@ -2593,7 +2593,7 @@ xcoff_swap_ldhdr_out (bfd *abfd, const struct internal_ldhdr *src, PTR 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;
|
||||
|
||||
@@ -2614,7 +2614,7 @@ xcoff_swap_ldsym_in (bfd *abfd, const PTR s, struct internal_ldsym *dst)
|
||||
/* 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;
|
||||
|
||||
@@ -2635,7 +2635,7 @@ xcoff_swap_ldsym_out (bfd *abfd, const struct internal_ldsym *src, PTR 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;
|
||||
@@ -2649,7 +2649,7 @@ xcoff_swap_reloc_in (bfd *abfd, PTR s, PTR 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;
|
||||
@@ -2665,7 +2665,7 @@ xcoff_swap_reloc_out (bfd *abfd, PTR s, PTR 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;
|
||||
|
||||
@@ -2678,7 +2678,7 @@ xcoff_swap_ldrel_in (bfd *abfd, const PTR s, struct internal_ldrel *dst)
|
||||
/* 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;
|
||||
|
||||
@@ -4163,7 +4163,7 @@ const bfd_target rs6000coff_vec =
|
||||
/* Opposite endian version, none exists */
|
||||
NULL,
|
||||
|
||||
(void *) &bfd_xcoff_backend_data,
|
||||
& bfd_xcoff_backend_data,
|
||||
};
|
||||
|
||||
/* xcoff-powermac target
|
||||
@@ -4418,5 +4418,5 @@ const bfd_target pmac_xcoff_vec =
|
||||
/* Opposite endian version, none exists */
|
||||
NULL,
|
||||
|
||||
(void *) &bfd_pmac_xcoff_backend_data,
|
||||
& bfd_pmac_xcoff_backend_data,
|
||||
};
|
||||
|
||||
+199
-254
@@ -1,6 +1,6 @@
|
||||
/* 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>.
|
||||
@@ -38,9 +38,9 @@
|
||||
|
||||
#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
|
||||
@@ -56,28 +56,6 @@ static bfd_boolean sh_align_load_span
|
||||
#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. */
|
||||
@@ -96,17 +74,27 @@ static reloc_howto_type * sh_coff_reloc_type_lookup PARAMS ((bfd *, bfd_reloc_co
|
||||
#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[] =
|
||||
@@ -407,8 +395,7 @@ 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;
|
||||
|
||||
@@ -426,16 +413,15 @@ get_symbol_value (symbol)
|
||||
/* 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;
|
||||
|
||||
@@ -508,9 +494,8 @@ static const struct shcoff_reloc_map sh_reloc_map[] =
|
||||
#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;
|
||||
|
||||
@@ -575,15 +560,13 @@ sh_coff_reloc_name_lookup (bfd *abfd ATTRIBUTE_UNUSED,
|
||||
/* 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;
|
||||
@@ -673,6 +656,9 @@ sh_reloc (abfd, reloc_entry, symbol_in, data, input_section, output_bfd,
|
||||
|
||||
#include "coffcode.h"
|
||||
|
||||
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:
|
||||
@@ -717,11 +703,10 @@ sh_reloc (abfd, reloc_entry, symbol_in, data, input_section, output_bfd,
|
||||
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;
|
||||
@@ -738,7 +723,7 @@ sh_relax_section (abfd, sec, link_info, again)
|
||||
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;
|
||||
}
|
||||
@@ -1074,11 +1059,10 @@ sh_relax_section (abfd, sec, link_info, again)
|
||||
/* 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;
|
||||
@@ -1470,7 +1454,7 @@ sh_relax_delete_bytes (abfd, sec, addr, count)
|
||||
{
|
||||
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
|
||||
@@ -1478,7 +1462,7 @@ sh_relax_delete_bytes (abfd, sec, addr, count)
|
||||
{
|
||||
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)
|
||||
{
|
||||
@@ -1628,24 +1612,6 @@ struct sh_opcode
|
||||
#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. */
|
||||
|
||||
@@ -2054,8 +2020,7 @@ static const struct sh_minor_opcode sh_dsp_opcodef[] =
|
||||
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;
|
||||
@@ -2082,27 +2047,12 @@ sh_insn_info (insn)
|
||||
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;
|
||||
|
||||
@@ -2128,10 +2078,9 @@ sh_insn_uses_reg (insn, op, reg)
|
||||
/* 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;
|
||||
|
||||
@@ -2152,27 +2101,25 @@ sh_insn_sets_reg (insn, op, reg)
|
||||
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;
|
||||
|
||||
@@ -2203,10 +2150,9 @@ sh_insn_uses_freg (insn, op, freg)
|
||||
/* 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;
|
||||
|
||||
@@ -2228,17 +2174,29 @@ sh_insn_sets_freg (insn, op, freg)
|
||||
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;
|
||||
|
||||
@@ -2300,11 +2258,10 @@ sh_insns_conflict (i1, op1, i2, op2)
|
||||
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;
|
||||
|
||||
@@ -2346,18 +2303,16 @@ sh_load_use (i1, op1, i2, op2)
|
||||
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);
|
||||
@@ -2557,91 +2512,14 @@ _bfd_sh_align_load_span (abfd, sec, contents, swap, relocs,
|
||||
}
|
||||
#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;
|
||||
@@ -2764,21 +2642,94 @@ sh_swap_insns (abfd, sec, relocs, contents, addr)
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
/* 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;
|
||||
@@ -2942,14 +2893,12 @@ sh_relocate_section (output_bfd, info, input_bfd, input_section, contents,
|
||||
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;
|
||||
@@ -3006,7 +2955,7 @@ sh_coff_get_relocated_section_contents (output_bfd, link_info, link_order,
|
||||
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);
|
||||
@@ -3073,8 +3022,7 @@ CREATE_LITTLE_COFF_TARGET_VEC (TARGET_SYM, TARGET_SHL_NAME, BFD_IS_RELAXABLE,
|
||||
#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
|
||||
@@ -3090,8 +3038,7 @@ static bfd_boolean coff_small_new_section_hook PARAMS ((bfd *, asection *));
|
||||
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)
|
||||
{
|
||||
@@ -3104,9 +3051,7 @@ coff_small_object_p (abfd)
|
||||
/* 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;
|
||||
@@ -3212,7 +3157,7 @@ const bfd_target shcoff_small_vec =
|
||||
|
||||
& shlcoff_small_vec,
|
||||
|
||||
(PTR) &bfd_coff_small_swap_table
|
||||
& bfd_coff_small_swap_table
|
||||
};
|
||||
|
||||
const bfd_target shlcoff_small_vec =
|
||||
@@ -3257,6 +3202,6 @@ const bfd_target shlcoff_small_vec =
|
||||
|
||||
& shcoff_small_vec,
|
||||
|
||||
(PTR) &bfd_coff_small_swap_table
|
||||
& bfd_coff_small_swap_table
|
||||
};
|
||||
#endif
|
||||
|
||||
+13
-25
@@ -1,6 +1,6 @@
|
||||
/* 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.
|
||||
@@ -34,11 +34,6 @@
|
||||
/* 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,
|
||||
@@ -58,20 +53,15 @@ enum reloc_type
|
||||
};
|
||||
|
||||
/* 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)
|
||||
@@ -111,7 +101,8 @@ static reloc_howto_type coff_sparc_howto_table[] =
|
||||
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;
|
||||
};
|
||||
@@ -145,9 +136,8 @@ static const struct coff_reloc_map sparc_reloc_map[] =
|
||||
};
|
||||
|
||||
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++)
|
||||
@@ -178,9 +168,7 @@ coff_sparc_reloc_name_lookup (bfd *abfd ATTRIBUTE_UNUSED,
|
||||
#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];
|
||||
|
||||
+62
-78
@@ -57,33 +57,31 @@
|
||||
#include "sysdep.h"
|
||||
#include "bfd.h"
|
||||
|
||||
/* At first the prototypes. */
|
||||
|
||||
static void
|
||||
adjust_filehdr_in_post PARAMS ((bfd *, PTR, PTR));
|
||||
static void
|
||||
adjust_filehdr_out_pre PARAMS ((bfd *, PTR, PTR));
|
||||
static void
|
||||
adjust_filehdr_out_post PARAMS ((bfd *, PTR, PTR));
|
||||
static void
|
||||
adjust_scnhdr_in_post PARAMS ((bfd *, PTR, PTR));
|
||||
static void
|
||||
adjust_scnhdr_out_pre PARAMS ((bfd *, PTR, PTR));
|
||||
static void
|
||||
adjust_scnhdr_out_post PARAMS ((bfd *, PTR, PTR));
|
||||
static void
|
||||
adjust_aux_in_post PARAMS ((bfd *, PTR, int, int, int, int, PTR));
|
||||
static void
|
||||
adjust_aux_out_pre PARAMS ((bfd *, PTR, int, int, int, int, PTR));
|
||||
static void
|
||||
adjust_aux_out_post PARAMS ((bfd *, PTR, int, int, int, int, PTR));
|
||||
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. */
|
||||
|
||||
static void
|
||||
adjust_filehdr_in_post (bfd *, void *, void *);
|
||||
static void
|
||||
adjust_filehdr_out_pre (bfd *, void *, void *);
|
||||
static void
|
||||
adjust_filehdr_out_post (bfd *, void *, void *);
|
||||
static void
|
||||
adjust_scnhdr_in_post (bfd *, void *, void *);
|
||||
static void
|
||||
adjust_scnhdr_out_pre (bfd *, void *, void *);
|
||||
static void
|
||||
adjust_scnhdr_out_post (bfd *, void *, void *);
|
||||
static void
|
||||
adjust_aux_in_post (bfd *, void *, int, int, int, int, void *);
|
||||
static void
|
||||
adjust_aux_out_pre (bfd *, void *, int, int, int, int, void *);
|
||||
static void
|
||||
adjust_aux_out_post (bfd *, void *, int, int, int, int, void *);
|
||||
static void
|
||||
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_FILEHDR_OUT_POST adjust_filehdr_out_post
|
||||
@@ -96,12 +94,12 @@ create_go32_stub PARAMS ((bfd *));
|
||||
#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
|
||||
|
||||
@@ -133,10 +131,9 @@ static const unsigned char stub_bytes[GO32_STUBSIZE] =
|
||||
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;
|
||||
@@ -151,10 +148,7 @@ adjust_filehdr_in_post (abfd, src, 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;
|
||||
@@ -173,10 +167,9 @@ adjust_filehdr_out_pre (abfd, in, 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. */
|
||||
@@ -184,10 +177,9 @@ adjust_filehdr_out_post (abfd, in, out)
|
||||
}
|
||||
|
||||
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;
|
||||
|
||||
@@ -197,10 +189,9 @@ adjust_scnhdr_in_post (abfd, ext, 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;
|
||||
|
||||
@@ -210,10 +201,9 @@ adjust_scnhdr_out_pre (abfd, in, out)
|
||||
}
|
||||
|
||||
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;
|
||||
|
||||
@@ -223,14 +213,13 @@ adjust_scnhdr_out_post (abfd, in, out)
|
||||
}
|
||||
|
||||
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;
|
||||
|
||||
@@ -242,14 +231,13 @@ adjust_aux_in_post (abfd, ext1, type, in_class, indx, numaux, 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;
|
||||
|
||||
@@ -261,14 +249,13 @@ adjust_aux_out_pre (abfd, inp, type, in_class, indx, numaux, extp)
|
||||
}
|
||||
|
||||
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;
|
||||
|
||||
@@ -292,8 +279,7 @@ adjust_aux_out_post (abfd, inp, type, in_class, indx, numaux, extp)
|
||||
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)
|
||||
@@ -394,9 +380,7 @@ stub_end:
|
||||
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)
|
||||
|
||||
+11
-22
@@ -1,5 +1,5 @@
|
||||
/* 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)
|
||||
|
||||
@@ -28,12 +28,6 @@
|
||||
#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[] =
|
||||
@@ -59,10 +53,9 @@ 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)
|
||||
{
|
||||
@@ -104,8 +97,7 @@ tic30_coff_reloc_name_lookup (bfd *abfd ATTRIBUTE_UNUSED,
|
||||
/* 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;
|
||||
}
|
||||
@@ -125,9 +117,7 @@ dst->r_stuff[1] = 'C';
|
||||
/* 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)
|
||||
{
|
||||
@@ -163,12 +153,11 @@ rtype2howto (internal, dst)
|
||||
reloc_processing(relent, reloc, symbols, abfd, section)
|
||||
|
||||
static void
|
||||
reloc_processing (relent, reloc, symbols, abfd, section)
|
||||
arelent *relent;
|
||||
struct internal_reloc *reloc;
|
||||
asymbol **symbols;
|
||||
bfd *abfd;
|
||||
asection *section;
|
||||
reloc_processing (arelent *relent,
|
||||
struct internal_reloc *reloc,
|
||||
asymbol **symbols,
|
||||
bfd *abfd,
|
||||
asection *section)
|
||||
{
|
||||
relent->address = reloc->r_vaddr;
|
||||
rtype2howto (relent, reloc);
|
||||
|
||||
+36
-49
@@ -1,6 +1,6 @@
|
||||
/* 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)
|
||||
|
||||
@@ -32,26 +32,19 @@
|
||||
#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;
|
||||
@@ -79,15 +72,13 @@ ticoff_bfd_is_local_label_name (abfd, name)
|
||||
#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)
|
||||
{
|
||||
@@ -128,9 +119,8 @@ reloc_howto_type tic4x_howto_table[] =
|
||||
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;
|
||||
@@ -176,9 +166,8 @@ tic4x_coff_reloc_name_lookup (bfd *abfd ATTRIBUTE_UNUSED,
|
||||
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;
|
||||
@@ -198,13 +187,12 @@ tic4x_lookup_howto (internal, dst)
|
||||
}
|
||||
|
||||
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;
|
||||
|
||||
@@ -221,12 +209,11 @@ coff_tic4x_rtype_to_howto (abfd, sec, rel, h, sym, addendp)
|
||||
|
||||
|
||||
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;
|
||||
|
||||
@@ -274,16 +261,16 @@ tic4x_reloc_processing (relent, reloc, symbols, abfd, section)
|
||||
|
||||
|
||||
/* 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);
|
||||
|
||||
+43
-67
@@ -31,22 +31,9 @@
|
||||
#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
|
||||
@@ -97,16 +84,14 @@ tic54x_getl_signed_32 (const void *p)
|
||||
#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;
|
||||
|
||||
@@ -129,10 +114,9 @@ bfd_ticoff_get_section_load_page (sect)
|
||||
(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;
|
||||
@@ -144,15 +128,13 @@ tic54x_set_arch_mach (abfd, arch, machine)
|
||||
}
|
||||
|
||||
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)
|
||||
{
|
||||
@@ -234,10 +216,9 @@ reloc_howto_type tic54x_howto_table[] =
|
||||
/* 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)
|
||||
{
|
||||
@@ -280,9 +261,8 @@ tic54x_coff_reloc_name_lookup (bfd *abfd ATTRIBUTE_UNUSED,
|
||||
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;
|
||||
@@ -307,13 +287,12 @@ tic54x_lookup_howto (internal, dst)
|
||||
#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;
|
||||
|
||||
@@ -334,9 +313,8 @@ coff_tic54x_rtype_to_howto (abfd, sec, rel, h, sym, addendp)
|
||||
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;
|
||||
@@ -367,24 +345,22 @@ ticoff_bfd_is_local_label_name (abfd, name)
|
||||
#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;
|
||||
|
||||
@@ -472,7 +448,7 @@ const bfd_target tic54x_coff0_vec =
|
||||
BFD_JUMP_TABLE_DYNAMIC (_bfd_nodynamic),
|
||||
NULL,
|
||||
|
||||
(PTR) & ticoff0_swap_table
|
||||
& ticoff0_swap_table
|
||||
};
|
||||
|
||||
/* TI COFF v0, SPARC tools (big-endian headers). */
|
||||
@@ -518,7 +494,7 @@ const bfd_target tic54x_coff0_beh_vec =
|
||||
|
||||
& tic54x_coff0_vec,
|
||||
|
||||
(PTR) & ticoff0_swap_table
|
||||
& ticoff0_swap_table
|
||||
};
|
||||
|
||||
/* TI COFF v1, DOS tools (little-endian headers). */
|
||||
@@ -564,7 +540,7 @@ const bfd_target tic54x_coff1_vec =
|
||||
|
||||
& tic54x_coff0_beh_vec,
|
||||
|
||||
(PTR) & ticoff1_swap_table
|
||||
& ticoff1_swap_table
|
||||
};
|
||||
|
||||
/* TI COFF v1, SPARC tools (big-endian headers). */
|
||||
@@ -610,7 +586,7 @@ const bfd_target tic54x_coff1_beh_vec =
|
||||
|
||||
& tic54x_coff1_vec,
|
||||
|
||||
(PTR) & ticoff1_swap_table
|
||||
& ticoff1_swap_table
|
||||
};
|
||||
|
||||
/* TI COFF v2, TI DOS tools output (little-endian headers). */
|
||||
|
||||
+50
-72
@@ -1,6 +1,6 @@
|
||||
/* 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)
|
||||
|
||||
@@ -47,23 +47,15 @@
|
||||
#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[] =
|
||||
{
|
||||
@@ -370,15 +362,13 @@ 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 ();
|
||||
@@ -387,15 +377,13 @@ ppbase_reloc (abfd, reloc_entry, symbol_in, data, input_section, output_bfd,
|
||||
/* 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 ();
|
||||
@@ -404,15 +392,13 @@ glob15_reloc (abfd, reloc_entry, symbol_in, data, input_section, output_bfd,
|
||||
/* 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 ();
|
||||
@@ -421,15 +407,13 @@ glob16_reloc (abfd, reloc_entry, symbol_in, data, input_section, output_bfd,
|
||||
/* 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 ();
|
||||
@@ -440,9 +424,7 @@ local16_reloc (abfd, reloc_entry, symbol_in, data, input_section, output_bfd,
|
||||
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;
|
||||
|
||||
@@ -464,13 +446,12 @@ rtype2howto (cache_ptr, dst)
|
||||
#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;
|
||||
|
||||
@@ -495,17 +476,14 @@ coff_tic80_rtype_to_howto (abfd, sec, rel, h, sym, addendp)
|
||||
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;
|
||||
|
||||
+26
-38
@@ -1,6 +1,6 @@
|
||||
/* 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.
|
||||
@@ -28,16 +28,10 @@
|
||||
#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),
|
||||
@@ -66,8 +60,7 @@ static reloc_howto_type howto_table[] =
|
||||
dst->r_stuff[1] = 'C';
|
||||
|
||||
static int
|
||||
select_reloc (howto)
|
||||
reloc_howto_type *howto;
|
||||
select_reloc (reloc_howto_type *howto)
|
||||
{
|
||||
return howto->type ;
|
||||
}
|
||||
@@ -75,9 +68,8 @@ select_reloc (howto)
|
||||
/* Code to turn a r_type into a howto ptr, uses the above howto table. */
|
||||
|
||||
static void
|
||||
rtype2howto (internal, dst)
|
||||
arelent *internal;
|
||||
struct internal_reloc *dst;
|
||||
rtype2howto (arelent *internal,
|
||||
struct internal_reloc *dst)
|
||||
{
|
||||
internal->howto = howto_table + dst->r_type - 1;
|
||||
}
|
||||
@@ -93,12 +85,11 @@ rtype2howto (internal, dst)
|
||||
reloc_processing(relent, reloc, symbols, abfd, section)
|
||||
|
||||
static void
|
||||
reloc_processing (relent, reloc, symbols, abfd, section)
|
||||
arelent * relent;
|
||||
struct internal_reloc *reloc;
|
||||
asymbol ** symbols;
|
||||
bfd * abfd;
|
||||
asection * section;
|
||||
reloc_processing (arelent * relent,
|
||||
struct internal_reloc *reloc,
|
||||
asymbol ** symbols,
|
||||
bfd * abfd,
|
||||
asection * section)
|
||||
{
|
||||
relent->address = reloc->r_vaddr;
|
||||
rtype2howto (relent, reloc);
|
||||
@@ -115,21 +106,20 @@ reloc_processing (relent, reloc, symbols, abfd, section)
|
||||
}
|
||||
|
||||
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 */
|
||||
|
||||
@@ -222,15 +212,13 @@ w65_reloc16_estimate (abfd, input_section, reloc, shrink, link_info)
|
||||
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;
|
||||
|
||||
+1
-1
@@ -1162,7 +1162,7 @@ _bfd_coff_final_link (bfd *abfd,
|
||||
|
||||
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;
|
||||
|
||||
+3
-4
@@ -1,5 +1,5 @@
|
||||
/* 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).
|
||||
|
||||
@@ -58,11 +58,10 @@ const bfd_arch_info_type bfd_arc_arch =
|
||||
/* 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;
|
||||
|
||||
|
||||
+4
-5
@@ -1,5 +1,5 @@
|
||||
/* 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.
|
||||
@@ -30,12 +30,11 @@
|
||||
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)
|
||||
|
||||
+4
-5
@@ -1,5 +1,5 @@
|
||||
/* 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.
|
||||
|
||||
@@ -25,12 +25,11 @@
|
||||
#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;
|
||||
|
||||
+7
-18
@@ -1,6 +1,6 @@
|
||||
/* 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.
|
||||
@@ -24,19 +24,13 @@
|
||||
#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;
|
||||
@@ -117,9 +111,8 @@ scan_960_mach (ap, string)
|
||||
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:
|
||||
@@ -156,13 +149,9 @@ compatible (a,b)
|
||||
};
|
||||
|
||||
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) \
|
||||
|
||||
+19
-21
@@ -1,5 +1,6 @@
|
||||
/* 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.
|
||||
@@ -23,8 +24,23 @@
|
||||
#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) \
|
||||
{ \
|
||||
@@ -94,21 +110,3 @@ static const bfd_arch_info_type arch_info_struct[] =
|
||||
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;
|
||||
}
|
||||
|
||||
+40
-66
@@ -38,16 +38,8 @@ static const bfd_arch_info_type arch_info_struct[] =
|
||||
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;
|
||||
|
||||
@@ -78,10 +70,7 @@ _bfd_ns32k_get_displacement (buffer, size)
|
||||
}
|
||||
|
||||
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)
|
||||
{
|
||||
@@ -109,9 +98,7 @@ _bfd_ns32k_put_displacement (value, buffer, 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;
|
||||
|
||||
@@ -132,10 +119,7 @@ _bfd_ns32k_get_immediate (buffer, size)
|
||||
}
|
||||
|
||||
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)
|
||||
@@ -156,17 +140,15 @@ _bfd_ns32k_put_immediate (value, buffer, 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;
|
||||
@@ -583,14 +565,12 @@ do_ns32k_reloc (abfd, reloc_entry, symbol, data, input_section, output_bfd,
|
||||
/* 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;
|
||||
@@ -758,15 +738,13 @@ _bfd_do_ns32k_reloc_contents (howto, input_bfd, relocation, location,
|
||||
}
|
||||
|
||||
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,
|
||||
@@ -775,15 +753,13 @@ _bfd_ns32k_reloc_disp (abfd, reloc_entry, symbol, data, input_section,
|
||||
}
|
||||
|
||||
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,
|
||||
@@ -791,15 +767,13 @@ _bfd_ns32k_reloc_imm (abfd, reloc_entry, symbol, data, input_section,
|
||||
}
|
||||
|
||||
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;
|
||||
|
||||
|
||||
+2
-6
@@ -26,13 +26,9 @@
|
||||
|
||||
/* 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)
|
||||
|
||||
+3
-7
@@ -1,5 +1,5 @@
|
||||
/* 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.
|
||||
@@ -28,13 +28,9 @@
|
||||
/* 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)
|
||||
|
||||
+4
-8
@@ -1,5 +1,6 @@
|
||||
/* 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)
|
||||
|
||||
@@ -24,14 +25,9 @@
|
||||
#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. */
|
||||
|
||||
+3
-7
@@ -1,5 +1,5 @@
|
||||
/* 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.
|
||||
|
||||
@@ -24,13 +24,9 @@
|
||||
#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;
|
||||
|
||||
+2
-4
@@ -1,6 +1,6 @@
|
||||
/* 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.
|
||||
@@ -234,9 +234,7 @@ _bfd_ecoff_set_arch_mach_hook (bfd *abfd, void * filehdr)
|
||||
}
|
||||
|
||||
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;
|
||||
|
||||
+243
-315
File diff suppressed because it is too large
Load Diff
+124
-151
@@ -25,29 +25,13 @@
|
||||
#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 **));
|
||||
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 {
|
||||
enum reloc_type
|
||||
{
|
||||
R_MN10200_NONE = 0,
|
||||
R_MN10200_32,
|
||||
R_MN10200_16,
|
||||
@@ -59,7 +43,8 @@ enum reloc_type {
|
||||
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,
|
||||
@@ -175,12 +160,14 @@ static reloc_howto_type elf_mn10200_howto_table[] = {
|
||||
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 , },
|
||||
@@ -192,9 +179,8 @@ static const struct mn10200_reloc_map mn10200_reloc_map[] = {
|
||||
};
|
||||
|
||||
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;
|
||||
|
||||
@@ -229,10 +215,9 @@ bfd_elf32_bfd_reloc_name_lookup (bfd *abfd ATTRIBUTE_UNUSED,
|
||||
/* 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;
|
||||
|
||||
@@ -244,20 +229,17 @@ mn10200_info_to_howto (abfd, cache_ptr, dst)
|
||||
/* 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;
|
||||
@@ -347,16 +329,14 @@ mn10200_elf_final_link_relocate (howto, input_bfd, output_bfd,
|
||||
|
||||
/* 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;
|
||||
@@ -475,6 +455,78 @@ mn10200_elf_relocate_section (output_bfd, info, input_bfd, input_section,
|
||||
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:
|
||||
@@ -505,11 +557,10 @@ mn10200_elf_relocate_section (output_bfd, info, input_bfd, input_section,
|
||||
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;
|
||||
@@ -533,7 +584,7 @@ mn10200_elf_relax_section (abfd, sec, link_info, again)
|
||||
|
||||
/* 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;
|
||||
@@ -1174,89 +1225,13 @@ mn10200_elf_relax_section (abfd, sec, link_info, again)
|
||||
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;
|
||||
@@ -1297,14 +1272,12 @@ mn10200_elf_symbol_address_p (abfd, sec, isym, addr)
|
||||
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;
|
||||
@@ -1336,7 +1309,7 @@ mn10200_elf_get_relocated_section_contents (output_bfd, link_info, link_order,
|
||||
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;
|
||||
|
||||
+34
-42
@@ -34,7 +34,7 @@ bfin_pltpc_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)
|
||||
@@ -48,7 +48,7 @@ static bfd_reloc_status_type
|
||||
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)
|
||||
@@ -145,7 +145,7 @@ static bfd_reloc_status_type
|
||||
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)
|
||||
@@ -217,7 +217,7 @@ static bfd_reloc_status_type
|
||||
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)
|
||||
@@ -283,7 +283,7 @@ static bfd_reloc_status_type
|
||||
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)
|
||||
@@ -1109,7 +1109,7 @@ bfin_bfd_reloc_name_lookup (bfd *abfd 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];
|
||||
@@ -1139,9 +1139,7 @@ elf32_bfin_final_write_processing (bfd *abfd,
|
||||
/* 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;
|
||||
@@ -1167,6 +1165,7 @@ bfin_check_relocs (bfd * abfd,
|
||||
const Elf_Internal_Rela *rel_end;
|
||||
asection *sgot;
|
||||
asection *srelgot;
|
||||
|
||||
if (info->relocatable)
|
||||
return TRUE;
|
||||
|
||||
@@ -1997,10 +1996,10 @@ bfinfdpic_relocs_info_find (struct htab *ht,
|
||||
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;
|
||||
|
||||
@@ -2035,7 +2034,7 @@ bfinfdpic_relocs_info_for_local (struct htab *ht,
|
||||
|
||||
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;
|
||||
@@ -2101,7 +2100,7 @@ _bfinfdpic_add_dyn_reloc (bfd *output_bfd, asection *sreloc, bfd_vma offset,
|
||||
|
||||
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;
|
||||
|
||||
@@ -2156,9 +2155,8 @@ _bfinfdpic_emit_got_relocs_plt_entries (struct bfinfdpic_relocs_info *entry,
|
||||
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)
|
||||
@@ -4350,9 +4348,8 @@ elf32_bfinfdpic_always_size_sections (bfd *output_bfd,
|
||||
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;
|
||||
@@ -4600,9 +4597,8 @@ elf32_bfinfdpic_finish_dynamic_sections (bfd *output_bfd,
|
||||
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;
|
||||
|
||||
@@ -5065,7 +5061,7 @@ elf32_bfinfdpic_copy_private_bfd_data (bfd *ibfd, bfd *obfd)
|
||||
|
||||
/* 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;
|
||||
@@ -5213,7 +5209,7 @@ bfin_link_hash_table_create (bfd * abfd)
|
||||
|
||||
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;
|
||||
@@ -5247,9 +5243,9 @@ bfin_finish_dynamic_sections (bfd * output_bfd ATTRIBUTE_UNUSED,
|
||||
|
||||
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;
|
||||
|
||||
@@ -5324,7 +5320,7 @@ bfin_finish_dynamic_symbol (bfd * output_bfd,
|
||||
|
||||
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;
|
||||
@@ -5452,7 +5448,7 @@ struct bfin_pcrel_relocs_copied
|
||||
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;
|
||||
@@ -5483,7 +5479,7 @@ bfin_discard_copies (struct elf_link_hash_entry *h, PTR inf)
|
||||
|
||||
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;
|
||||
@@ -5523,7 +5519,7 @@ bfin_size_dynamic_sections (bfd * output_bfd ATTRIBUTE_UNUSED,
|
||||
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
|
||||
@@ -5634,16 +5630,12 @@ bfin_size_dynamic_sections (bfd * output_bfd ATTRIBUTE_UNUSED,
|
||||
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;
|
||||
@@ -5663,7 +5655,7 @@ bfd_bfin_elf32_create_embedded_relocs (
|
||||
|
||||
/* 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;
|
||||
|
||||
+53
-134
@@ -29,73 +29,13 @@
|
||||
#include "elf/cris.h"
|
||||
#include <limits.h>
|
||||
|
||||
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_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 *));
|
||||
|
||||
static reloc_howto_type cris_elf_howto_table [] =
|
||||
{
|
||||
/* This reloc does nothing. */
|
||||
@@ -485,9 +425,8 @@ static const struct cris_reloc_map cris_reloc_map [] =
|
||||
};
|
||||
|
||||
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;
|
||||
|
||||
@@ -516,10 +455,9 @@ cris_reloc_name_lookup (bfd *abfd ATTRIBUTE_UNUSED, const char *r_name)
|
||||
/* 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;
|
||||
|
||||
@@ -529,15 +467,13 @@ cris_info_to_howto_rela (abfd, cache_ptr, dst)
|
||||
}
|
||||
|
||||
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
|
||||
@@ -562,9 +498,7 @@ cris_elf_pcrel_reloc (abfd, reloc_entry, symbol, data, input_section,
|
||||
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;
|
||||
@@ -614,9 +548,7 @@ cris_elf_grok_prstatus (abfd, note)
|
||||
}
|
||||
|
||||
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)
|
||||
@@ -848,6 +780,13 @@ struct elf_cris_link_hash_entry
|
||||
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
|
||||
@@ -972,14 +911,12 @@ elf_cris_link_hash_table_create (bfd *abfd)
|
||||
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);
|
||||
@@ -2363,9 +2300,8 @@ elf_cris_finish_dynamic_symbol (bfd *output_bfd,
|
||||
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;
|
||||
@@ -2786,9 +2722,7 @@ cris_elf_plt_sym_val (bfd_vma i ATTRIBUTE_UNUSED, const asection *plt,
|
||||
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;
|
||||
|
||||
@@ -2866,9 +2800,7 @@ elf_cris_adjust_gotplt_to_got (h, 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;
|
||||
|
||||
@@ -2900,10 +2832,9 @@ elf_cris_try_fold_plt_to_got (h, 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);
|
||||
|
||||
@@ -4002,9 +3933,8 @@ elf_cris_size_dynamic_sections (bfd *output_bfd ATTRIBUTE_UNUSED,
|
||||
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;
|
||||
@@ -4058,9 +3988,8 @@ elf_cris_discard_excess_dso_dynamics (h, 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;
|
||||
|
||||
@@ -4113,8 +4042,7 @@ elf_cris_discard_excess_program_dynamics (h, 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;
|
||||
@@ -4129,9 +4057,8 @@ cris_elf_object_p (abfd)
|
||||
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;
|
||||
|
||||
@@ -4164,9 +4091,8 @@ cris_elf_final_write_processing (abfd, linker)
|
||||
/* 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)
|
||||
{
|
||||
@@ -4196,9 +4122,7 @@ cris_elf_set_mach_from_flags (abfd, flags)
|
||||
/* 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;
|
||||
|
||||
@@ -4224,9 +4148,7 @@ cris_elf_print_private_bfd_data (abfd, 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;
|
||||
|
||||
@@ -4303,9 +4225,7 @@ cris_elf_merge_private_bfd_data (ibfd, obfd)
|
||||
/* 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))
|
||||
@@ -4324,8 +4244,7 @@ cris_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)
|
||||
|
||||
+2
-2
@@ -754,7 +754,7 @@ elf32_crx_get_relocated_section_contents (bfd *output_bfd,
|
||||
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;
|
||||
@@ -984,7 +984,7 @@ elf32_crx_relax_section (bfd *abfd, asection *sec,
|
||||
|
||||
/* 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;
|
||||
|
||||
+43
-65
@@ -27,23 +27,12 @@
|
||||
#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 [] =
|
||||
{
|
||||
@@ -245,15 +234,13 @@ 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;
|
||||
@@ -291,15 +278,13 @@ fr30_elf_i20_reloc (abfd, reloc_entry, symbol, data,
|
||||
/* 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;
|
||||
|
||||
@@ -354,9 +339,8 @@ static const struct fr30_reloc_map fr30_reloc_map [] =
|
||||
};
|
||||
|
||||
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;
|
||||
|
||||
@@ -386,10 +370,9 @@ fr30_reloc_name_lookup (bfd *abfd ATTRIBUTE_UNUSED, const char *r_name)
|
||||
/* 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;
|
||||
|
||||
@@ -402,14 +385,12 @@ fr30_info_to_howto_rela (abfd, cache_ptr, dst)
|
||||
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;
|
||||
@@ -511,16 +492,14 @@ fr30_final_link_relocate (howto, input_bfd, input_section, contents, rel,
|
||||
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;
|
||||
@@ -661,11 +640,10 @@ fr30_elf_gc_mark_hook (asection *sec,
|
||||
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;
|
||||
|
||||
+75
-153
@@ -28,56 +28,7 @@
|
||||
#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 [] =
|
||||
{
|
||||
@@ -2176,14 +2127,12 @@ _frvfdpic_emit_got_relocs_plt_entries (struct frvfdpic_relocs_info *entry,
|
||||
/* 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;
|
||||
@@ -2215,14 +2164,12 @@ elf32_frv_relocate_gprel12 (info, input_bfd, input_section, relocation,
|
||||
/* 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;
|
||||
@@ -2257,11 +2204,10 @@ elf32_frv_relocate_gprelu12 (info, input_bfd, input_section, relocation,
|
||||
/* 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;
|
||||
|
||||
@@ -2280,11 +2226,10 @@ elf32_frv_relocate_hi16 (input_bfd, relhi, contents, value)
|
||||
|
||||
}
|
||||
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;
|
||||
|
||||
@@ -2305,12 +2250,11 @@ elf32_frv_relocate_lo16 (input_bfd, rello, contents, value)
|
||||
/* 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;
|
||||
@@ -2348,14 +2292,12 @@ elf32_frv_relocate_label24 (input_bfd, input_section, rello, contents, value)
|
||||
}
|
||||
|
||||
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;
|
||||
@@ -2383,14 +2325,12 @@ elf32_frv_relocate_gprelhi (info, input_bfd, input_section, relocation,
|
||||
}
|
||||
|
||||
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;
|
||||
@@ -2419,9 +2359,8 @@ elf32_frv_relocate_gprello (info, input_bfd, input_section, relocation,
|
||||
}
|
||||
|
||||
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)
|
||||
{
|
||||
@@ -2601,10 +2540,9 @@ frv_reloc_name_lookup (bfd *abfd ATTRIBUTE_UNUSED, const char *r_name)
|
||||
/* 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;
|
||||
|
||||
@@ -2665,14 +2603,12 @@ frvfdpic_info_to_howto_rel (bfd *abfd ATTRIBUTE_UNUSED,
|
||||
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,
|
||||
@@ -2711,16 +2647,14 @@ frv_final_link_relocate (howto, input_bfd, input_section, contents, rel,
|
||||
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;
|
||||
@@ -4159,14 +4093,13 @@ elf32_frv_gc_mark_hook (asection *sec,
|
||||
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
|
||||
@@ -6150,11 +6083,10 @@ frvfdpic_elf_encode_eh_address (bfd *abfd,
|
||||
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;
|
||||
@@ -6410,8 +6342,7 @@ elf32_frv_check_relocs (abfd, info, sec, relocs)
|
||||
/* 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)
|
||||
{
|
||||
@@ -6432,8 +6363,7 @@ elf32_frv_machine (abfd)
|
||||
/* 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)
|
||||
@@ -6443,9 +6373,7 @@ elf32_frv_object_p (abfd)
|
||||
/* 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;
|
||||
@@ -6455,9 +6383,7 @@ frv_elf_set_private_flags (abfd, flags)
|
||||
/* 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)
|
||||
@@ -6550,9 +6476,7 @@ elf32_frvfdpic_copy_private_bfd_data (bfd *ibfd, bfd *obfd)
|
||||
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;
|
||||
@@ -6820,10 +6744,8 @@ frv_elf_merge_private_bfd_data (ibfd, obfd)
|
||||
}
|
||||
|
||||
|
||||
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;
|
||||
|
||||
+6
-5
@@ -52,12 +52,13 @@ static bfd_boolean elf32_h8_relocate_section
|
||||
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 */
|
||||
@@ -304,7 +305,7 @@ static bfd_reloc_status_type
|
||||
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)
|
||||
@@ -699,7 +700,7 @@ elf32_h8_relax_section (bfd *abfd, asection *sec,
|
||||
|
||||
/* 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;
|
||||
@@ -1523,7 +1524,7 @@ elf32_h8_get_relocated_section_contents (bfd *output_bfd,
|
||||
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;
|
||||
|
||||
+2
-2
@@ -1,5 +1,5 @@
|
||||
/* 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.
|
||||
@@ -47,7 +47,7 @@ static bfd_reloc_status_type
|
||||
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)
|
||||
|
||||
+5
-7
@@ -830,7 +830,7 @@ m32c_elf_merge_private_bfd_data (bfd *ibfd, bfd *obfd)
|
||||
|
||||
|
||||
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;
|
||||
@@ -985,8 +985,7 @@ struct relax_plt_data
|
||||
};
|
||||
|
||||
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;
|
||||
|
||||
@@ -1017,8 +1016,7 @@ m32c_relax_plt_check (struct elf_link_hash_entry *h,
|
||||
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;
|
||||
|
||||
@@ -1382,14 +1380,14 @@ m32c_elf_relax_section
|
||||
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;
|
||||
|
||||
+1
-1
@@ -703,7 +703,7 @@ m68hc11_elf_relax_section (bfd *abfd, asection *sec,
|
||||
|
||||
/* 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;
|
||||
|
||||
@@ -37,14 +37,7 @@ static void m68hc11_info_to_howto_rel
|
||||
(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
|
||||
|
||||
+1
-1
@@ -50,7 +50,7 @@ static void m68hc11_elf_set_symbol (bfd* abfd, struct bfd_link_info *info,
|
||||
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
|
||||
{
|
||||
|
||||
+34
-80
@@ -28,42 +28,11 @@
|
||||
#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
|
||||
elf_m68k_discard_copies (struct elf_link_hash_entry *, void *);
|
||||
|
||||
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 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),
|
||||
@@ -441,9 +410,8 @@ static const struct
|
||||
};
|
||||
|
||||
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++)
|
||||
@@ -1145,9 +1113,7 @@ elf_m68k_final_write_processing (bfd *abfd,
|
||||
/* 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;
|
||||
@@ -1157,9 +1123,7 @@ elf32_m68k_set_private_flags (abfd, flags)
|
||||
/* 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;
|
||||
@@ -2581,11 +2545,10 @@ elf_m68k_copy_indirect_symbol (struct bfd_link_info *info,
|
||||
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;
|
||||
@@ -3128,9 +3091,8 @@ elf_m68k_always_size_sections (bfd *output_bfd, struct bfd_link_info *info)
|
||||
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;
|
||||
@@ -3283,9 +3245,8 @@ elf_m68k_adjust_dynamic_symbol (info, h)
|
||||
/* 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;
|
||||
@@ -3327,7 +3288,7 @@ elf_m68k_size_dynamic_sections (output_bfd, info)
|
||||
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
|
||||
@@ -3455,9 +3416,8 @@ elf_m68k_size_dynamic_sections (output_bfd, info)
|
||||
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;
|
||||
@@ -3642,16 +3602,14 @@ elf_m68k_init_got_entry_local_shared (struct bfd_link_info *info,
|
||||
/* 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;
|
||||
@@ -4267,11 +4225,10 @@ elf_m68k_install_pc32 (asection *sec, bfd_vma offset, bfd_vma value)
|
||||
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;
|
||||
|
||||
@@ -4503,9 +4460,7 @@ elf_m68k_finish_dynamic_symbol (output_bfd, info, h, sym)
|
||||
/* 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;
|
||||
@@ -4649,7 +4604,7 @@ bfd_m68k_elf32_create_embedded_relocs (abfd, info, datasec, relsec, errmsg)
|
||||
|
||||
/* 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;
|
||||
@@ -4787,8 +4742,7 @@ bfd_elf_m68k_set_target_options (struct bfd_link_info *info, int got_handling)
|
||||
}
|
||||
|
||||
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))
|
||||
{
|
||||
|
||||
+1
-1
@@ -89,7 +89,7 @@ static bfd_reloc_status_type
|
||||
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)
|
||||
|
||||
+4
-6
@@ -1326,8 +1326,7 @@ struct relax_plt_data
|
||||
};
|
||||
|
||||
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;
|
||||
|
||||
@@ -1358,8 +1357,7 @@ rl78_relax_plt_check (struct elf_link_hash_entry *h,
|
||||
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;
|
||||
|
||||
@@ -2056,14 +2054,14 @@ rl78_elf_relax_section
|
||||
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;
|
||||
|
||||
+2
-2
@@ -1926,14 +1926,14 @@ elf32_rx_relax_section (bfd * abfd,
|
||||
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;
|
||||
|
||||
+76
-163
@@ -25,67 +25,15 @@
|
||||
#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[] =
|
||||
@@ -220,9 +168,8 @@ static reloc_howto_type elf32_s390_vtentry_howto =
|
||||
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)
|
||||
{
|
||||
@@ -357,10 +304,9 @@ elf_s390_reloc_name_lookup (bfd *abfd ATTRIBUTE_UNUSED,
|
||||
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)
|
||||
@@ -386,15 +332,13 @@ elf_s390_info_to_howto (abfd, cache_ptr, dst)
|
||||
|
||||
/* 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;
|
||||
@@ -403,15 +347,13 @@ s390_tls_reloc (abfd, reloc_entry, symbol, data, input_section,
|
||||
|
||||
/* 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;
|
||||
@@ -455,9 +397,7 @@ s390_elf_ldisp_reloc (abfd, reloc_entry, symbol, data, input_section,
|
||||
}
|
||||
|
||||
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;
|
||||
@@ -733,8 +673,7 @@ elf_s390_mkobject (bfd *abfd)
|
||||
}
|
||||
|
||||
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);
|
||||
@@ -750,7 +689,8 @@ struct elf_s390_link_hash_table
|
||||
asection *sdynbss;
|
||||
asection *srelbss;
|
||||
|
||||
union {
|
||||
union
|
||||
{
|
||||
bfd_signed_vma refcount;
|
||||
bfd_vma offset;
|
||||
} tls_ldm_got;
|
||||
@@ -768,10 +708,9 @@ struct elf_s390_link_hash_table
|
||||
/* 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. */
|
||||
@@ -801,8 +740,7 @@ link_hash_newfunc (entry, table, string)
|
||||
/* 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);
|
||||
@@ -836,9 +774,7 @@ elf_s390_link_hash_table_create (abfd)
|
||||
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;
|
||||
|
||||
@@ -860,9 +796,7 @@ create_got_section (dynobj, info)
|
||||
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;
|
||||
|
||||
@@ -889,9 +823,9 @@ elf_s390_create_dynamic_sections (dynobj, info)
|
||||
/* 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;
|
||||
|
||||
@@ -953,10 +887,9 @@ elf_s390_copy_indirect_symbol (info, dir, ind)
|
||||
}
|
||||
|
||||
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;
|
||||
@@ -984,11 +917,10 @@ elf_s390_tls_transition (info, r_type, is_local)
|
||||
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;
|
||||
@@ -1554,8 +1486,7 @@ elf_s390_gc_sweep_hook (bfd *abfd,
|
||||
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;
|
||||
@@ -1576,9 +1507,8 @@ elf_s390_adjust_gotplt (h)
|
||||
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;
|
||||
@@ -1702,9 +1632,7 @@ elf_s390_adjust_dynamic_symbol (info, h)
|
||||
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;
|
||||
@@ -1927,9 +1855,7 @@ allocate_dynrelocs (h, inf)
|
||||
/* 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;
|
||||
@@ -1955,9 +1881,8 @@ readonly_dynrelocs (h, inf)
|
||||
/* 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;
|
||||
@@ -2060,7 +1985,7 @@ elf_s390_size_dynamic_sections (output_bfd, info)
|
||||
|
||||
/* 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. */
|
||||
@@ -2157,8 +2082,7 @@ elf_s390_size_dynamic_sections (output_bfd, 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) != 0)
|
||||
{
|
||||
@@ -2177,8 +2101,7 @@ elf_s390_size_dynamic_sections (output_bfd, info)
|
||||
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)
|
||||
@@ -2190,9 +2113,7 @@ dtpoff_base (info)
|
||||
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);
|
||||
|
||||
@@ -2206,10 +2127,9 @@ tpoff (info, address)
|
||||
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;
|
||||
|
||||
@@ -2226,16 +2146,14 @@ invalid_tls_insn (input_bfd, input_section, rel)
|
||||
/* 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;
|
||||
@@ -3105,11 +3023,10 @@ elf_s390_relocate_section (output_bfd, info, input_bfd, input_section,
|
||||
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;
|
||||
|
||||
@@ -3330,8 +3247,7 @@ elf_s390_finish_dynamic_symbol (output_bfd, info, h, sym)
|
||||
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))
|
||||
{
|
||||
@@ -3349,9 +3265,8 @@ elf_s390_reloc_type_class (rela)
|
||||
/* 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;
|
||||
@@ -3445,9 +3360,7 @@ elf_s390_finish_dynamic_sections (output_bfd, info)
|
||||
}
|
||||
|
||||
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;
|
||||
|
||||
+6
-6
@@ -53,7 +53,7 @@ static bfd_vma elf_vax_plt_sym_val (bfd_vma, const asection *,
|
||||
|
||||
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 */
|
||||
@@ -423,7 +423,7 @@ static bfd_boolean elf_vax_instantiate_got_entries (struct elf_link_hash_entry *
|
||||
#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. */
|
||||
@@ -514,7 +514,7 @@ elf32_vax_merge_private_bfd_data (bfd *ibfd, bfd *obfd)
|
||||
|
||||
/* 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;
|
||||
|
||||
@@ -1122,7 +1122,7 @@ elf_vax_size_dynamic_sections (bfd *output_bfd, struct bfd_link_info *info)
|
||||
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
|
||||
@@ -1261,7 +1261,7 @@ elf_vax_size_dynamic_sections (bfd *output_bfd, struct bfd_link_info *info)
|
||||
|
||||
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;
|
||||
|
||||
@@ -1283,7 +1283,7 @@ elf_vax_discard_copies (struct elf_vax_link_hash_entry *h,
|
||||
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;
|
||||
|
||||
+21
-20
@@ -211,7 +211,7 @@ struct alpha_elf_link_hash_table
|
||||
#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. */
|
||||
@@ -357,7 +357,7 @@ elf64_alpha_object_p (bfd *abfd)
|
||||
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)
|
||||
@@ -370,7 +370,7 @@ elf64_alpha_reloc_nil (bfd *abfd ATTRIBUTE_UNUSED, arelent *reloc,
|
||||
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)
|
||||
@@ -422,7 +422,7 @@ elf64_alpha_do_reloc_gpdisp (bfd *abfd, bfd_vma gpdisp, bfd_byte *p_ldah,
|
||||
|
||||
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)
|
||||
{
|
||||
@@ -1377,17 +1377,17 @@ elf64_alpha_read_ecoff_info (bfd *abfd, asection *section,
|
||||
}
|
||||
|
||||
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;
|
||||
@@ -1507,7 +1507,7 @@ elf64_alpha_find_nearest_line (bfd *abfd, asection *section, asymbol **symbols,
|
||||
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;
|
||||
|
||||
@@ -1549,7 +1549,7 @@ struct extsym_info
|
||||
};
|
||||
|
||||
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;
|
||||
@@ -2392,7 +2392,7 @@ elf64_alpha_merge_gots (bfd *a, bfd *b)
|
||||
|
||||
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;
|
||||
|
||||
@@ -2544,7 +2544,8 @@ elf64_alpha_size_got_sections (struct bfd_link_info *info)
|
||||
}
|
||||
|
||||
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;
|
||||
@@ -3170,7 +3171,7 @@ elf64_alpha_relax_opt_call (struct alpha_relax_info *info, bfd_vma symval)
|
||||
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)
|
||||
@@ -3755,7 +3756,7 @@ elf64_alpha_relax_section (bfd *abfd, asection *sec,
|
||||
|
||||
/* 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;
|
||||
@@ -5103,7 +5104,7 @@ elf64_alpha_final_link (bfd *abfd, struct bfd_link_info *info)
|
||||
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)
|
||||
@@ -5207,7 +5208,7 @@ elf64_alpha_final_link (bfd *abfd, struct bfd_link_info *info)
|
||||
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)
|
||||
@@ -5254,7 +5255,7 @@ elf64_alpha_final_link (bfd *abfd, struct bfd_link_info *info)
|
||||
einfo.failed = FALSE;
|
||||
elf_link_hash_traverse (elf_hash_table (info),
|
||||
elf64_alpha_output_extsym,
|
||||
(PTR) &einfo);
|
||||
&einfo);
|
||||
if (einfo.failed)
|
||||
return FALSE;
|
||||
|
||||
|
||||
+78
-151
@@ -167,70 +167,24 @@ struct bpo_greg_section_info
|
||||
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
|
||||
@@ -841,9 +795,8 @@ static const struct mmix_reloc_map mmix_reloc_map[] =
|
||||
};
|
||||
|
||||
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;
|
||||
|
||||
@@ -875,9 +828,7 @@ bfd_elf64_bfd_reloc_name_lookup (bfd *abfd ATTRIBUTE_UNUSED,
|
||||
}
|
||||
|
||||
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)
|
||||
{
|
||||
@@ -1303,10 +1254,9 @@ mmix_elf_perform_relocation (asection *isec, reloc_howto_type *howto,
|
||||
/* 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;
|
||||
|
||||
@@ -1320,15 +1270,13 @@ mmix_info_to_howto_rela (abfd, cache_ptr, dst)
|
||||
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;
|
||||
@@ -1398,16 +1346,14 @@ mmix_elf_reloc (abfd, reloc_entry, symbol, data, input_section,
|
||||
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;
|
||||
@@ -1858,9 +1804,7 @@ mmix_elf_gc_sweep_hook (bfd *abfd ATTRIBUTE_UNUSED,
|
||||
/* 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;
|
||||
@@ -1893,11 +1837,10 @@ mmix_elf_sort_relocs (p1, 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;
|
||||
@@ -1930,7 +1873,7 @@ mmix_elf_check_common_relocs (abfd, info, sec, relocs)
|
||||
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)
|
||||
@@ -2026,11 +1969,10 @@ mmix_elf_check_common_relocs (abfd, info, sec, relocs)
|
||||
/* 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;
|
||||
@@ -2042,7 +1984,7 @@ mmix_elf_check_relocs (abfd, info, sec, relocs)
|
||||
|
||||
/* 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. */
|
||||
@@ -2096,9 +2038,7 @@ mmix_elf_check_relocs (abfd, info, sec, relocs)
|
||||
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;
|
||||
|
||||
@@ -2115,7 +2055,7 @@ _bfd_mmix_check_all_relocs (abfd, info)
|
||||
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)
|
||||
@@ -2138,12 +2078,11 @@ _bfd_mmix_check_all_relocs (abfd, info)
|
||||
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
|
||||
@@ -2203,10 +2142,9 @@ mmix_elf_symbol_processing (abfd, asym)
|
||||
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;
|
||||
@@ -2223,15 +2161,14 @@ mmix_elf_section_from_bfd_section (abfd, sec, retval)
|
||||
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)
|
||||
{
|
||||
@@ -2266,10 +2203,8 @@ mmix_elf_add_symbol_hook (abfd, info, sym, namep, flagsp, secp, valp)
|
||||
|
||||
/* 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;
|
||||
@@ -2297,9 +2232,7 @@ mmix_elf_is_local_label_name (abfd, name)
|
||||
/* 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. */
|
||||
@@ -2346,10 +2279,9 @@ mmix_elf_final_link (abfd, info)
|
||||
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;
|
||||
|
||||
@@ -2374,9 +2306,8 @@ mmix_set_relaxable_size (abfd, sec, 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;
|
||||
@@ -2453,9 +2384,8 @@ _bfd_mmix_before_linker_allocation (abfd, info)
|
||||
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;
|
||||
@@ -2526,9 +2456,7 @@ _bfd_mmix_after_linker_allocation (abfd, link_info)
|
||||
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;
|
||||
@@ -2619,11 +2547,10 @@ mmix_dump_bpo_gregs (link_info, pf)
|
||||
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;
|
||||
@@ -2669,7 +2596,7 @@ mmix_elf_relax_section (abfd, sec, link_info, again)
|
||||
|
||||
/* 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)
|
||||
@@ -2873,7 +2800,7 @@ mmix_elf_relax_section (abfd, sec, link_info, again)
|
||||
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);
|
||||
|
||||
+63
-118
@@ -25,69 +25,19 @@
|
||||
#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[] =
|
||||
{
|
||||
@@ -228,9 +178,8 @@ static reloc_howto_type elf64_s390_vtentry_howto =
|
||||
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)
|
||||
{
|
||||
@@ -381,10 +330,9 @@ elf_s390_reloc_name_lookup (bfd *abfd ATTRIBUTE_UNUSED,
|
||||
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)
|
||||
@@ -410,15 +358,13 @@ elf_s390_info_to_howto (abfd, cache_ptr, dst)
|
||||
|
||||
/* 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;
|
||||
@@ -427,15 +373,13 @@ s390_tls_reloc (abfd, reloc_entry, symbol, data, input_section,
|
||||
|
||||
/* 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;
|
||||
@@ -478,9 +422,7 @@ s390_elf_ldisp_reloc (abfd, reloc_entry, symbol, data, input_section,
|
||||
}
|
||||
|
||||
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;
|
||||
@@ -644,8 +586,7 @@ elf_s390_mkobject (bfd *abfd)
|
||||
}
|
||||
|
||||
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);
|
||||
@@ -679,10 +620,9 @@ struct elf_s390_link_hash_table
|
||||
/* 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. */
|
||||
@@ -712,8 +652,7 @@ link_hash_newfunc (entry, table, string)
|
||||
/* 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);
|
||||
@@ -803,9 +742,9 @@ elf_s390_create_dynamic_sections (bfd *dynobj,
|
||||
/* 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;
|
||||
|
||||
@@ -867,10 +806,9 @@ elf_s390_copy_indirect_symbol (info, dir, ind)
|
||||
}
|
||||
|
||||
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;
|
||||
@@ -1494,8 +1432,7 @@ elf_s390_gc_sweep_hook (bfd *abfd,
|
||||
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;
|
||||
@@ -1868,9 +1805,7 @@ allocate_dynrelocs (struct elf_link_hash_entry *h,
|
||||
/* 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;
|
||||
@@ -2003,7 +1938,7 @@ elf_s390_size_dynamic_sections (bfd *output_bfd ATTRIBUTE_UNUSED,
|
||||
|
||||
/* 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. */
|
||||
@@ -2101,7 +2036,7 @@ elf_s390_size_dynamic_sections (bfd *output_bfd ATTRIBUTE_UNUSED,
|
||||
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)
|
||||
{
|
||||
@@ -2120,8 +2055,7 @@ elf_s390_size_dynamic_sections (bfd *output_bfd ATTRIBUTE_UNUSED,
|
||||
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)
|
||||
@@ -2133,9 +2067,7 @@ dtpoff_base (info)
|
||||
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);
|
||||
|
||||
@@ -2149,10 +2081,9 @@ tpoff (info, address)
|
||||
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;
|
||||
|
||||
@@ -3180,8 +3111,7 @@ elf_s390_finish_dynamic_symbol (bfd *output_bfd,
|
||||
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))
|
||||
{
|
||||
@@ -3390,4 +3320,19 @@ const struct elf_size_info s390_elf64_size_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"
|
||||
|
||||
+7
-7
@@ -57,7 +57,7 @@ elf64_sparc_slurp_one_reloc_table (bfd *abfd, asection *asect,
|
||||
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;
|
||||
@@ -65,7 +65,7 @@ elf64_sparc_slurp_one_reloc_table (bfd *abfd, asection *asect,
|
||||
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;
|
||||
|
||||
@@ -279,7 +279,7 @@ elf64_sparc_canonicalize_dynamic_reloc (bfd *abfd, arelent **storage,
|
||||
/* 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;
|
||||
@@ -330,7 +330,7 @@ elf64_sparc_write_relocs (bfd *abfd, asection *sec, PTR data)
|
||||
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;
|
||||
@@ -545,8 +545,8 @@ elf64_sparc_add_symbol_hook (bfd *abfd, struct bfd_link_info *info,
|
||||
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 *))
|
||||
@@ -741,7 +741,7 @@ elf64_sparc_fake_sections (bfd *abfd ATTRIBUTE_UNUSED,
|
||||
/* 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;
|
||||
|
||||
+22
-22
@@ -178,18 +178,18 @@ static bfd_boolean elfNN_ia64_choose_gp
|
||||
(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);
|
||||
@@ -1408,7 +1408,7 @@ elfNN_ia64_hash_table_create (bfd *abfd)
|
||||
|
||||
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;
|
||||
@@ -1429,7 +1429,7 @@ elfNN_ia64_global_dyn_info_free (void **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;
|
||||
@@ -1470,13 +1470,13 @@ elfNN_ia64_hash_table_free (struct bfd_link_hash_table *hash)
|
||||
|
||||
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;
|
||||
@@ -1494,7 +1494,7 @@ elfNN_ia64_global_dyn_sym_thunk (struct bfd_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;
|
||||
@@ -1513,8 +1513,8 @@ elfNN_ia64_local_dyn_sym_thunk (void **slot, PTR xdata)
|
||||
|
||||
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;
|
||||
|
||||
@@ -2659,7 +2659,7 @@ allocate_global_fptr_got (struct elfNN_ia64_dyn_sym_info *dyn_i,
|
||||
|
||||
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;
|
||||
|
||||
@@ -2694,7 +2694,7 @@ global_sym_index (struct elf_link_hash_entry *h)
|
||||
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;
|
||||
|
||||
@@ -2741,7 +2741,7 @@ allocate_fptr (struct elfNN_ia64_dyn_sym_info *dyn_i, PTR 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;
|
||||
|
||||
@@ -2778,7 +2778,7 @@ allocate_plt_entries (struct elfNN_ia64_dyn_sym_info *dyn_i,
|
||||
|
||||
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;
|
||||
|
||||
@@ -2805,7 +2805,7 @@ allocate_plt2_entries (struct elfNN_ia64_dyn_sym_info *dyn_i,
|
||||
|
||||
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;
|
||||
|
||||
@@ -2822,7 +2822,7 @@ allocate_pltoff_entries (struct elfNN_ia64_dyn_sym_info *dyn_i,
|
||||
|
||||
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;
|
||||
@@ -3537,7 +3537,7 @@ elfNN_ia64_dtprel_base (struct bfd_link_info *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;
|
||||
|
||||
@@ -4786,7 +4786,7 @@ elfNN_ia64_merge_private_bfd_data (bfd *ibfd, bfd *obfd)
|
||||
}
|
||||
|
||||
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;
|
||||
|
||||
+2
-2
@@ -9055,7 +9055,7 @@ _bfd_mips_elf_size_dynamic_sections (bfd *output_bfd,
|
||||
}
|
||||
|
||||
/* 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);
|
||||
|
||||
@@ -12464,7 +12464,7 @@ _bfd_mips_elf_relax_section (bfd *abfd, asection *sec,
|
||||
|
||||
/* 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;
|
||||
|
||||
+10
-11
@@ -53,7 +53,7 @@
|
||||
|
||||
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;
|
||||
@@ -97,7 +97,7 @@ static bfd_reloc_status_type
|
||||
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)
|
||||
@@ -109,7 +109,7 @@ sparc_elf_notsup_reloc (bfd *abfd 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;
|
||||
@@ -136,7 +136,7 @@ sparc_elf_wdisp16_reloc (bfd *abfd, arelent *reloc_entry, asymbol *symbol,
|
||||
|
||||
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;
|
||||
@@ -164,7 +164,7 @@ sparc_elf_wdisp10_reloc (bfd *abfd, arelent *reloc_entry, asymbol *symbol,
|
||||
|
||||
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;
|
||||
@@ -190,7 +190,7 @@ sparc_elf_hix22_reloc (bfd *abfd, arelent *reloc_entry, asymbol *symbol,
|
||||
|
||||
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;
|
||||
@@ -2191,7 +2191,7 @@ _bfd_sparc_elf_adjust_dynamic_symbol (struct bfd_link_info *info,
|
||||
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;
|
||||
@@ -2471,7 +2471,7 @@ allocate_local_dynrelocs (void **slot, void *inf)
|
||||
/* 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;
|
||||
@@ -2627,7 +2627,7 @@ _bfd_sparc_elf_size_dynamic_sections (bfd *output_bfd,
|
||||
|
||||
/* 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);
|
||||
@@ -2742,8 +2742,7 @@ _bfd_sparc_elf_size_dynamic_sections (bfd *output_bfd,
|
||||
/* 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)
|
||||
{
|
||||
|
||||
+2
-2
@@ -1,6 +1,6 @@
|
||||
/* 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.
|
||||
@@ -538,7 +538,7 @@ bfd_hash_insert (struct bfd_hash_table *table,
|
||||
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])
|
||||
|
||||
+42
-66
@@ -1,6 +1,6 @@
|
||||
/* 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.
|
||||
@@ -195,26 +195,19 @@
|
||||
|
||||
#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
|
||||
@@ -227,8 +220,7 @@ long MY (canonicalize_reloc)
|
||||
/* 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);
|
||||
|
||||
@@ -282,12 +274,10 @@ MY (callback) (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);
|
||||
@@ -320,7 +310,7 @@ MY (write_object_contents) (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;
|
||||
|
||||
@@ -353,14 +343,13 @@ MY (write_object_contents) (abfd)
|
||||
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;
|
||||
@@ -452,10 +441,9 @@ DESCRIPTION
|
||||
*/
|
||||
|
||||
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;
|
||||
|
||||
@@ -536,8 +524,7 @@ NAME (aout,swap_exec_header_in) (abfd, raw_bytes, execp)
|
||||
*/
|
||||
|
||||
bfd_boolean
|
||||
MY (slurp_symbol_table) (abfd)
|
||||
bfd *abfd;
|
||||
MY (slurp_symbol_table) (bfd *abfd)
|
||||
{
|
||||
bfd_size_type symbol_bytes;
|
||||
struct external_nlist *syms;
|
||||
@@ -559,7 +546,7 @@ MY (slurp_symbol_table) (abfd)
|
||||
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;
|
||||
@@ -640,12 +627,11 @@ MY (slurp_symbol_table) (abfd)
|
||||
}
|
||||
|
||||
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;
|
||||
@@ -719,14 +705,11 @@ MY (swap_std_reloc_in) (abfd, bytes, cache_ptr, symbols, symcount)
|
||||
}
|
||||
|
||||
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;
|
||||
@@ -765,7 +748,7 @@ doit:
|
||||
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);
|
||||
@@ -801,18 +784,12 @@ doit:
|
||||
/* 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;
|
||||
@@ -830,8 +807,7 @@ MY (canonicalize_symtab) (abfd, location)
|
||||
}
|
||||
|
||||
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);
|
||||
@@ -842,14 +818,14 @@ MY (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);
|
||||
|
||||
|
||||
+23
-38
@@ -1,6 +1,6 @@
|
||||
/* 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.
|
||||
|
||||
@@ -49,46 +49,34 @@
|
||||
#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;
|
||||
|
||||
@@ -104,8 +92,7 @@ make_bfd_asection (abfd, name, flags, size, offset, alignment_power)
|
||||
}
|
||||
|
||||
static const bfd_target *
|
||||
hppabsd_core_core_file_p (abfd)
|
||||
bfd *abfd;
|
||||
hppabsd_core_core_file_p (bfd *abfd)
|
||||
{
|
||||
int val;
|
||||
struct user u;
|
||||
@@ -205,22 +192,20 @@ hppabsd_core_core_file_p (abfd)
|
||||
}
|
||||
|
||||
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);
|
||||
}
|
||||
|
||||
/* 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 ();
|
||||
@@ -280,6 +265,6 @@ const bfd_target hppabsd_core_vec =
|
||||
|
||||
NULL,
|
||||
|
||||
(PTR) 0 /* backend_data */
|
||||
NULL /* backend_data */
|
||||
};
|
||||
#endif
|
||||
|
||||
+2
-2
@@ -1,6 +1,6 @@
|
||||
/* 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
|
||||
|
||||
@@ -425,5 +425,5 @@ const bfd_target hpux_core_vec =
|
||||
|
||||
NULL,
|
||||
|
||||
(PTR) 0 /* backend_data */
|
||||
NULL /* backend_data */
|
||||
};
|
||||
|
||||
+6
-6
@@ -1,5 +1,6 @@
|
||||
/* 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.
|
||||
|
||||
@@ -55,10 +56,9 @@
|
||||
#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;
|
||||
|
||||
@@ -66,7 +66,7 @@ i386dynix_32_swap_exec_header_in (abfd, raw_bytes, execp)
|
||||
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);
|
||||
|
||||
+36
-66
@@ -1,6 +1,7 @@
|
||||
/* 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.
|
||||
|
||||
@@ -49,15 +50,13 @@ extern const bfd_target MY(vec);
|
||||
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);
|
||||
@@ -68,8 +67,7 @@ i386linux_bfd_final_link (abfd, info)
|
||||
/* 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);
|
||||
@@ -169,31 +167,12 @@ struct linux_link_hash_table
|
||||
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;
|
||||
|
||||
@@ -220,8 +199,7 @@ linux_link_hash_newfunc (entry, table, string)
|
||||
/* 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);
|
||||
@@ -257,7 +235,7 @@ linux_link_hash_table_create (abfd)
|
||||
#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
|
||||
@@ -268,11 +246,10 @@ linux_link_hash_table_create (abfd)
|
||||
/* 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;
|
||||
|
||||
@@ -298,12 +275,11 @@ new_fixup (info, h, value, builtin)
|
||||
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;
|
||||
@@ -325,18 +301,16 @@ linux_link_create_dynamic_sections (abfd, info)
|
||||
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;
|
||||
@@ -425,9 +399,7 @@ linux_add_one_symbol (info, abfd, name, flags, section, value, string,
|
||||
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;
|
||||
@@ -548,9 +520,8 @@ linux_tally_symbols (h, data)
|
||||
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;
|
||||
@@ -561,7 +532,7 @@ bfd_i386linux_size_dynamic_sections (output_bfd, info)
|
||||
/* 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
|
||||
@@ -603,9 +574,8 @@ bfd_i386linux_size_dynamic_sections (output_bfd, info)
|
||||
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;
|
||||
@@ -755,7 +725,7 @@ linux_finish_dynamic_link (output_bfd, info)
|
||||
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;
|
||||
|
||||
+43
-66
@@ -1,6 +1,6 @@
|
||||
/* 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.
|
||||
|
||||
@@ -52,7 +52,7 @@
|
||||
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 */ \
|
||||
@@ -84,22 +84,6 @@
|
||||
#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
|
||||
|
||||
@@ -124,11 +108,10 @@ extern reloc_howto_type aout_32_std_howto_table[];
|
||||
/* 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);
|
||||
@@ -157,7 +140,6 @@ NAME(lynx,swap_std_reloc_out) (abfd, g, natptr)
|
||||
check for that here
|
||||
*/
|
||||
|
||||
|
||||
if (bfd_is_com_section (output_section)
|
||||
|| bfd_is_abs_section (output_section)
|
||||
|| bfd_is_und_section (output_section))
|
||||
@@ -216,11 +198,10 @@ NAME(lynx,swap_std_reloc_out) (abfd, g, natptr)
|
||||
/* 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;
|
||||
@@ -302,11 +283,14 @@ NAME(lynx,swap_ext_reloc_out) (abfd, g, natptr)
|
||||
|
||||
|
||||
#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) { \
|
||||
@@ -334,13 +318,12 @@ NAME(lynx,swap_ext_reloc_out) (abfd, g, natptr)
|
||||
} \
|
||||
} \
|
||||
|
||||
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;
|
||||
@@ -358,13 +341,12 @@ NAME(lynx,swap_ext_reloc_in) (abfd, bytes, cache_ptr, symbols, symcount)
|
||||
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;
|
||||
@@ -388,15 +370,14 @@ NAME(lynx,swap_std_reloc_in) (abfd, bytes, cache_ptr, symbols, symcount)
|
||||
|
||||
/* 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;
|
||||
|
||||
@@ -433,7 +414,7 @@ doit:
|
||||
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);
|
||||
@@ -449,7 +430,7 @@ doit:
|
||||
|
||||
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;
|
||||
|
||||
@@ -461,7 +442,7 @@ doit:
|
||||
}
|
||||
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;
|
||||
|
||||
@@ -483,15 +464,12 @@ doit:
|
||||
|
||||
/* 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;
|
||||
|
||||
@@ -522,7 +500,7 @@ NAME(lynx,squirt_out_relocs) (abfd, section)
|
||||
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;
|
||||
@@ -533,12 +511,11 @@ NAME(lynx,squirt_out_relocs) (abfd, section)
|
||||
}
|
||||
|
||||
/* 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;
|
||||
|
||||
+6
-4
@@ -1,6 +1,6 @@
|
||||
/* 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.
|
||||
|
||||
@@ -51,9 +51,11 @@
|
||||
#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 */
|
||||
|
||||
+3
-2
@@ -1,6 +1,7 @@
|
||||
/* 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
|
||||
@@ -228,7 +229,7 @@ const bfd_target i386msdos_vec =
|
||||
|
||||
NULL,
|
||||
|
||||
(PTR) 0
|
||||
NULL
|
||||
};
|
||||
|
||||
|
||||
|
||||
+3
-3
@@ -1,6 +1,6 @@
|
||||
/* 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.
|
||||
@@ -120,7 +120,7 @@ os9k_object_p (bfd *abfd)
|
||||
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)
|
||||
@@ -221,5 +221,5 @@ const bfd_target i386os9k_vec =
|
||||
|
||||
NULL,
|
||||
|
||||
(PTR) 0,
|
||||
NULL,
|
||||
};
|
||||
|
||||
+5
-5
@@ -1,6 +1,6 @@
|
||||
/* 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
|
||||
|
||||
@@ -62,7 +62,7 @@ do_sections64 (bfd *abfd, struct coreout *coreout)
|
||||
|
||||
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;
|
||||
|
||||
@@ -110,7 +110,7 @@ do_sections (bfd *abfd, struct coreout *coreout)
|
||||
|
||||
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;
|
||||
|
||||
@@ -175,7 +175,7 @@ irix_core_core_file_p (bfd *abfd)
|
||||
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)
|
||||
@@ -328,7 +328,7 @@ const bfd_target irix_core_vec =
|
||||
|
||||
NULL,
|
||||
|
||||
(PTR) 0 /* backend_data */
|
||||
NULL /* backend_data */
|
||||
};
|
||||
|
||||
#endif /* IRIX_CORE */
|
||||
|
||||
+9
-13
@@ -58,13 +58,12 @@ struct lynx_core_struct
|
||||
/* 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;
|
||||
@@ -88,8 +87,7 @@ make_bfd_asection (abfd, name, flags, size, vma, filepos)
|
||||
}
|
||||
|
||||
const bfd_target *
|
||||
lynx_core_file_p (abfd)
|
||||
bfd *abfd;
|
||||
lynx_core_file_p (bfd *abfd)
|
||||
{
|
||||
int secnum;
|
||||
struct pssentry pss;
|
||||
@@ -215,15 +213,13 @@ lynx_core_file_p (abfd)
|
||||
}
|
||||
|
||||
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);
|
||||
}
|
||||
|
||||
+34
-67
@@ -1,6 +1,6 @@
|
||||
/* 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.
|
||||
@@ -51,15 +51,11 @@ extern const bfd_target MY(vec);
|
||||
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);
|
||||
@@ -70,8 +66,7 @@ m68klinux_bfd_final_link (abfd, info)
|
||||
/* 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);
|
||||
@@ -171,31 +166,12 @@ struct linux_link_hash_table
|
||||
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;
|
||||
|
||||
@@ -222,8 +198,7 @@ linux_link_hash_newfunc (entry, table, string)
|
||||
/* 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);
|
||||
@@ -262,7 +237,7 @@ linux_link_hash_table_create (abfd)
|
||||
#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
|
||||
@@ -273,11 +248,10 @@ linux_link_hash_table_create (abfd)
|
||||
/* 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;
|
||||
|
||||
@@ -303,12 +277,11 @@ new_fixup (info, h, value, builtin)
|
||||
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;
|
||||
@@ -330,18 +303,16 @@ linux_link_create_dynamic_sections (abfd, info)
|
||||
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;
|
||||
@@ -430,9 +401,8 @@ linux_add_one_symbol (info, abfd, name, flags, section, value, string,
|
||||
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;
|
||||
@@ -553,9 +523,8 @@ linux_tally_symbols (h, data)
|
||||
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;
|
||||
@@ -566,7 +535,7 @@ bfd_m68klinux_size_dynamic_sections (output_bfd, info)
|
||||
/* 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
|
||||
@@ -611,9 +580,7 @@ bfd_m68klinux_size_dynamic_sections (output_bfd, info)
|
||||
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;
|
||||
@@ -761,7 +728,7 @@ linux_finish_dynamic_link (output_bfd, info)
|
||||
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;
|
||||
|
||||
+1
-1
@@ -608,7 +608,7 @@ long bfd_mach_o_get_dynamic_reloc_upper_bound (bfd *);
|
||||
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 *);
|
||||
|
||||
+39
-51
@@ -1,6 +1,6 @@
|
||||
/* 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.
|
||||
@@ -49,11 +49,11 @@
|
||||
#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. */
|
||||
@@ -72,15 +72,13 @@ static bfd_boolean MY(write_object_contents) PARAMS ((bfd *abfd));
|
||||
#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;
|
||||
@@ -109,8 +107,7 @@ MY(set_arch_mach) (abfd, machtype)
|
||||
|
||||
/* 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))
|
||||
{
|
||||
@@ -129,8 +126,7 @@ MY (choose_reloc_size) (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);
|
||||
@@ -195,20 +191,18 @@ MY (write_object_contents) (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 */
|
||||
@@ -242,19 +236,13 @@ mips_fix_jmp_addr (abfd, reloc_entry, symbol, data, input_section, output_bfd,
|
||||
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;
|
||||
|
||||
@@ -284,7 +272,8 @@ mips_fix_hi16_s (abfd, reloc_entry, symbol, data, input_section,
|
||||
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,
|
||||
@@ -304,9 +293,8 @@ static reloc_howto_type mips_howto_table_ext[] = {
|
||||
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)
|
||||
{
|
||||
@@ -324,13 +312,13 @@ MY(reloc_type_lookup) (bfd *abfd, bfd_reloc_code_real_type 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;
|
||||
|
||||
@@ -347,11 +335,10 @@ MY(reloc_name_lookup) (bfd *abfd ATTRIBUTE_UNUSED,
|
||||
/* 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;
|
||||
@@ -395,7 +382,8 @@ MY(canonicalize_reloc) (abfd, section, relptr, symbols)
|
||||
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 */
|
||||
@@ -414,7 +402,7 @@ static const struct aout_backend_data MY(backend_data) = {
|
||||
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) */
|
||||
@@ -452,7 +440,7 @@ const bfd_target aout_mips_little_vec =
|
||||
|
||||
& aout_mips_big_vec,
|
||||
|
||||
(PTR) MY_backend_data
|
||||
MY_backend_data
|
||||
};
|
||||
|
||||
const bfd_target aout_mips_big_vec =
|
||||
@@ -494,5 +482,5 @@ const bfd_target aout_mips_big_vec =
|
||||
|
||||
& aout_mips_little_vec,
|
||||
|
||||
(PTR) MY_backend_data
|
||||
MY_backend_data
|
||||
};
|
||||
|
||||
+2
-2
@@ -1,6 +1,6 @@
|
||||
/* 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
|
||||
|
||||
@@ -316,5 +316,5 @@ const bfd_target netbsd_core_vec =
|
||||
|
||||
NULL,
|
||||
|
||||
(PTR) 0 /* Backend_data. */
|
||||
NULL /* Backend_data. */
|
||||
};
|
||||
|
||||
+2
-2
@@ -1,5 +1,5 @@
|
||||
/* 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.
|
||||
@@ -233,7 +233,7 @@ nlm_i386_write_import (bfd * abfd, asection * sec, arelent * rel)
|
||||
static bfd_boolean
|
||||
nlm_i386_mangle_relocs (bfd *abfd,
|
||||
asection *sec,
|
||||
const PTR data,
|
||||
const void * data,
|
||||
bfd_vma offset,
|
||||
bfd_size_type count)
|
||||
{
|
||||
|
||||
+16
-30
@@ -1,6 +1,6 @@
|
||||
/* 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.
|
||||
|
||||
@@ -34,18 +34,8 @@
|
||||
|
||||
/* 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 */
|
||||
|
||||
@@ -56,17 +46,16 @@ struct osf_core_struct
|
||||
};
|
||||
|
||||
#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;
|
||||
|
||||
@@ -83,8 +72,7 @@ make_bfd_asection (abfd, name, flags, size, vma, filepos)
|
||||
}
|
||||
|
||||
static const bfd_target *
|
||||
osf_core_core_file_p (abfd)
|
||||
bfd *abfd;
|
||||
osf_core_core_file_p (bfd *abfd)
|
||||
{
|
||||
int val;
|
||||
int i;
|
||||
@@ -93,7 +81,7 @@ osf_core_core_file_p (abfd)
|
||||
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;
|
||||
|
||||
@@ -114,7 +102,7 @@ osf_core_core_file_p (abfd)
|
||||
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;
|
||||
|
||||
@@ -161,24 +149,22 @@ osf_core_core_file_p (abfd)
|
||||
}
|
||||
|
||||
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);
|
||||
}
|
||||
|
||||
/* 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)
|
||||
@@ -236,5 +222,5 @@ const bfd_target osf_core_vec =
|
||||
|
||||
NULL,
|
||||
|
||||
(PTR) 0 /* backend_data */
|
||||
NULL /* backend_data */
|
||||
};
|
||||
|
||||
+2
-6
@@ -76,14 +76,10 @@
|
||||
#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);
|
||||
|
||||
@@ -507,10 +507,9 @@ bfd_pef_scan_start_address (bfd *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;
|
||||
|
||||
+38
-61
@@ -1,6 +1,6 @@
|
||||
/* 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.
|
||||
@@ -40,7 +40,8 @@
|
||||
#include "libbfd.h"
|
||||
|
||||
/* PPCbug location structure */
|
||||
typedef struct ppcboot_location {
|
||||
typedef struct ppcboot_location
|
||||
{
|
||||
bfd_byte ind;
|
||||
bfd_byte head;
|
||||
bfd_byte sector;
|
||||
@@ -48,7 +49,8 @@ typedef struct ppcboot_location {
|
||||
} 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 */
|
||||
@@ -56,7 +58,8 @@ typedef struct ppcboot_partition {
|
||||
} 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 */
|
||||
@@ -80,7 +83,8 @@ ppcboot_hdr_t;
|
||||
#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;
|
||||
@@ -89,28 +93,13 @@ typedef struct ppcboot_data {
|
||||
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))
|
||||
|
||||
/* 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))
|
||||
{
|
||||
@@ -124,10 +113,9 @@ ppcboot_mkobject (abfd)
|
||||
|
||||
/* 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;
|
||||
@@ -144,8 +132,7 @@ ppcboot_set_arch_mach (abfd, arch, machine)
|
||||
being ppcboot. */
|
||||
|
||||
static const bfd_target *
|
||||
ppcboot_object_p (abfd)
|
||||
bfd *abfd;
|
||||
ppcboot_object_p (bfd *abfd)
|
||||
{
|
||||
struct stat statbuf;
|
||||
asection *sec;
|
||||
@@ -175,7 +162,7 @@ ppcboot_object_p (abfd)
|
||||
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)
|
||||
@@ -218,7 +205,7 @@ ppcboot_object_p (abfd)
|
||||
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;
|
||||
@@ -232,12 +219,11 @@ ppcboot_object_p (abfd)
|
||||
/* 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)
|
||||
@@ -249,8 +235,7 @@ ppcboot_get_section_contents (abfd, section, location, offset, 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 *);
|
||||
}
|
||||
@@ -259,9 +244,7 @@ ppcboot_get_symtab_upper_bound (abfd)
|
||||
/* 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;
|
||||
@@ -289,9 +272,7 @@ mangle_name (abfd, suffix)
|
||||
/* 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;
|
||||
@@ -339,10 +320,9 @@ ppcboot_canonicalize_symtab (abfd, alocation)
|
||||
/* 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);
|
||||
}
|
||||
@@ -360,12 +340,11 @@ ppcboot_get_symbol_info (ignore_abfd, 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)
|
||||
{
|
||||
@@ -401,14 +380,12 @@ ppcboot_sizeof_headers (bfd *abfd ATTRIBUTE_UNUSED,
|
||||
/* 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"));
|
||||
@@ -428,8 +405,8 @@ ppcboot_bfd_print_private_bfd_data (abfd, farg)
|
||||
|
||||
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
|
||||
|
||||
+20
-23
@@ -1,6 +1,6 @@
|
||||
/* 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.
|
||||
@@ -35,31 +35,29 @@
|
||||
#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;
|
||||
@@ -137,10 +135,10 @@ ptrace_unix_core_file_p (abfd)
|
||||
}
|
||||
|
||||
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
|
||||
@@ -148,15 +146,14 @@ ptrace_unix_core_file_failing_command (abfd)
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
/* 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 */
|
||||
}
|
||||
@@ -215,7 +212,7 @@ const bfd_target ptrace_core_vec =
|
||||
|
||||
NULL,
|
||||
|
||||
(PTR) 0 /* backend_data */
|
||||
NULL /* backend_data */
|
||||
};
|
||||
|
||||
#endif /* PTRACE_CORE */
|
||||
|
||||
+20
-27
@@ -1,6 +1,7 @@
|
||||
/* 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.
|
||||
@@ -43,10 +44,9 @@
|
||||
#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);
|
||||
@@ -104,11 +104,10 @@ bfd_coff_reloc16_get_value (reloc, link_info, input_section)
|
||||
}
|
||||
|
||||
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;
|
||||
|
||||
@@ -143,11 +142,10 @@ bfd_perform_slip (abfd, slip, input_section, value)
|
||||
}
|
||||
|
||||
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;
|
||||
@@ -247,18 +245,13 @@ bfd_coff_reloc16_relax_section (abfd, input_section, link_info, again)
|
||||
}
|
||||
|
||||
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;
|
||||
|
||||
+13
-27
@@ -1,6 +1,6 @@
|
||||
/* 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>
|
||||
|
||||
@@ -45,24 +45,16 @@ struct sco5_core_struct
|
||||
|
||||
/* 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;
|
||||
|
||||
@@ -78,10 +70,7 @@ make_bfd_asection (abfd, name, flags, size, vma, filepos)
|
||||
}
|
||||
|
||||
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);
|
||||
@@ -115,8 +104,7 @@ read_uarea(abfd, filepos)
|
||||
}
|
||||
|
||||
const bfd_target *
|
||||
sco5_core_file_p (abfd)
|
||||
bfd *abfd;
|
||||
sco5_core_file_p (bfd *abfd)
|
||||
{
|
||||
int coffset_siz, val, nsecs, cheadoffs;
|
||||
int coresize;
|
||||
@@ -327,8 +315,7 @@ sco5_core_file_p (abfd)
|
||||
}
|
||||
|
||||
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)
|
||||
@@ -338,8 +325,7 @@ sco5_core_file_failing_command (abfd)
|
||||
}
|
||||
|
||||
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
|
||||
@@ -348,7 +334,7 @@ sco5_core_file_failing_signal (ignore_abfd)
|
||||
|
||||
/* 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 */
|
||||
}
|
||||
@@ -408,5 +394,5 @@ const bfd_target sco5_core_vec =
|
||||
|
||||
NULL,
|
||||
|
||||
(PTR) 0 /* backend_data */
|
||||
NULL /* backend_data */
|
||||
};
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/* 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).
|
||||
@@ -63,7 +63,7 @@ typedef struct som_symbol
|
||||
unsigned int hppa_arg_reloc;
|
||||
unsigned int hppa_priv_level;
|
||||
} ap;
|
||||
PTR any;
|
||||
void * any;
|
||||
}
|
||||
tc_data;
|
||||
|
||||
|
||||
+31
-65
@@ -1,6 +1,6 @@
|
||||
/* 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.
|
||||
@@ -49,15 +49,10 @@ extern const bfd_target MY(vec);
|
||||
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);
|
||||
@@ -67,11 +62,8 @@ sparclinux_bfd_final_link (abfd, info)
|
||||
|
||||
/* 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);
|
||||
@@ -170,31 +162,13 @@ struct linux_link_hash_table
|
||||
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;
|
||||
|
||||
@@ -221,8 +195,7 @@ linux_link_hash_newfunc (entry, table, string)
|
||||
/* 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);
|
||||
@@ -258,7 +231,7 @@ linux_link_hash_table_create (abfd)
|
||||
#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
|
||||
@@ -269,11 +242,10 @@ linux_link_hash_table_create (abfd)
|
||||
/* 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;
|
||||
|
||||
@@ -299,12 +271,11 @@ new_fixup (info, h, value, builtin)
|
||||
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;
|
||||
@@ -326,18 +297,16 @@ linux_link_create_dynamic_sections (abfd, info)
|
||||
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;
|
||||
@@ -548,9 +517,8 @@ linux_tally_symbols (struct linux_link_hash_entry *h, void * data)
|
||||
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;
|
||||
@@ -561,7 +529,7 @@ bfd_sparclinux_size_dynamic_sections (output_bfd, info)
|
||||
/* 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
|
||||
@@ -603,9 +571,7 @@ bfd_sparclinux_size_dynamic_sections (output_bfd, info)
|
||||
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;
|
||||
@@ -755,7 +721,7 @@ linux_finish_dynamic_link (output_bfd, info)
|
||||
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;
|
||||
|
||||
+11
-16
@@ -1,6 +1,6 @@
|
||||
/* 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.
|
||||
|
||||
@@ -37,15 +37,15 @@
|
||||
#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)
|
||||
@@ -70,9 +70,7 @@ static bfd_boolean NAME (aout,sparclynx_write_object_contents) PARAMS ((bfd *));
|
||||
@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;
|
||||
@@ -130,8 +128,7 @@ NAME(lynx,set_arch_mach) (abfd, machtype)
|
||||
/* 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))
|
||||
{
|
||||
@@ -149,8 +146,7 @@ choose_reloc_size (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);
|
||||
@@ -190,11 +186,10 @@ NAME(aout,sparclynx_write_object_contents) (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))
|
||||
{
|
||||
@@ -228,7 +223,7 @@ static const struct aout_backend_data sparclynx_aout_backend =
|
||||
#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
|
||||
|
||||
+6
-9
@@ -21,9 +21,8 @@
|
||||
#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;
|
||||
|
||||
@@ -34,9 +33,8 @@ ticoff0_bad_format_hook (abfd, 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;
|
||||
|
||||
@@ -49,9 +47,8 @@ ticoff1_bad_format_hook (abfd, 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;
|
||||
|
||||
+13
-20
@@ -1,6 +1,6 @@
|
||||
/* 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.
|
||||
|
||||
@@ -60,26 +60,21 @@ struct trad_core_struct
|
||||
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;
|
||||
|
||||
static const bfd_target *
|
||||
trad_unix_core_file_p (bfd *abfd)
|
||||
{
|
||||
int val;
|
||||
struct user u;
|
||||
@@ -236,9 +231,8 @@ trad_unix_core_file_p (abfd)
|
||||
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;
|
||||
@@ -249,9 +243,8 @@ trad_unix_core_file_failing_command (abfd)
|
||||
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);
|
||||
@@ -262,7 +255,7 @@ trad_unix_core_file_failing_signal (ignore_abfd)
|
||||
|
||||
/* 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 */
|
||||
}
|
||||
@@ -322,5 +315,5 @@ const bfd_target trad_core_vec =
|
||||
|
||||
NULL,
|
||||
|
||||
(PTR) 0 /* backend_data */
|
||||
NULL /* backend_data */
|
||||
};
|
||||
|
||||
+1
-1
@@ -2346,5 +2346,5 @@ const bfd_target vms_lib_txt_vec =
|
||||
|
||||
NULL,
|
||||
|
||||
(PTR) 0
|
||||
NULL
|
||||
};
|
||||
|
||||
+1
-1
@@ -550,7 +550,7 @@ typedef struct bfd_sym_data_struct bfd_sym_data_struct;
|
||||
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
|
||||
|
||||
Reference in New Issue
Block a user