mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-09-10 05:52:21 +08:00
Add more missing prototypes
This commit is contained in:
@ -29,6 +29,15 @@
|
||||
* libaout.h (N_SET_DYNAMIC): Silence compile time warning.
|
||||
|
||||
* bout.c: Add missing function prototypes. Fix formatting.
|
||||
* coff-z8k.c: Add missing function prototypes. Fix formatting.
|
||||
* coff-w65.c: Add missing function prototypes. Fix formatting.
|
||||
* coff-h8500.c: Add missing function prototypes. Fix formatting.
|
||||
* coff-h8300.c: Add missing function prototypes. Fix formatting.
|
||||
* coff-tic54x.c: Add missing function prototypes. Fix formatting.
|
||||
* coff-tic30.c: Add missing function prototypes. Fix formatting.
|
||||
* coff-m68k.c: Add missing function prototypes. Fix formatting.
|
||||
* coff-rs6000.c: Add missing function prototypes. Fix formatting.
|
||||
* coff-sh.c: Add missing function prototypes. Fix formatting.
|
||||
|
||||
2001-08-23 Jakub Jelinek <jakub@redhat.com>
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
/* BFD back-end for Hitachi H8/300 COFF binaries.
|
||||
Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
|
||||
2000
|
||||
2000, 2001
|
||||
Free Software Foundation, Inc.
|
||||
Written by Steve Chamberlain, <sac@cygnus.com>.
|
||||
|
||||
@ -69,6 +69,15 @@ funcvec_hash_table_init
|
||||
struct bfd_hash_table *,
|
||||
const char *))));
|
||||
|
||||
static bfd_reloc_status_type special PARAMS ((bfd *, arelent *, asymbol *, PTR, asection *, bfd *, char **));
|
||||
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 boolean h8300_symbol_address_p PARAMS ((bfd *, asection *, bfd_vma));
|
||||
static int h8300_reloc16_estimate PARAMS ((bfd *, asection *, arelent *, unsigned int, struct bfd_link_info *));
|
||||
static void h8300_reloc16_extra_cases PARAMS ((bfd *, struct bfd_link_info *, struct bfd_link_order *, arelent *, bfd_byte *, unsigned int *, unsigned int *));
|
||||
static boolean h8300_bfd_link_add_symbols PARAMS ((bfd *, struct bfd_link_info *));
|
||||
|
||||
/* To lookup a value in the function vector hash table. */
|
||||
#define funcvec_hash_lookup(table, string, create, copy) \
|
||||
((struct funcvec_hash_entry *) \
|
||||
|
@ -1,5 +1,5 @@
|
||||
/* BFD back-end for Hitachi H8/500 COFF binaries.
|
||||
Copyright 1993, 1994, 1995, 1997, 1999, 2000
|
||||
Copyright 1993, 1994, 1995, 1997, 1999, 2000, 2001
|
||||
Free Software Foundation, Inc.
|
||||
Contributed by Cygnus Support.
|
||||
Written by Steve Chamberlain, <sac@cygnus.com>.
|
||||
@ -28,6 +28,11 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
|
||||
#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)
|
||||
|
||||
static reloc_howto_type r_imm8 =
|
||||
@ -63,8 +68,8 @@ HOWTO (R_H8500_PCREL16, 0, 1, 16, true, 0, complain_overflow_signed, 0, "r_pcrel
|
||||
static reloc_howto_type r_high16 =
|
||||
HOWTO (R_H8500_HIGH16, 0, 1, 8, false, 0,
|
||||
complain_overflow_dont, 0, "r_high16", true, 0x000ffff, 0x0000ffff, false);
|
||||
|
||||
/* Turn a howto into a reloc number */
|
||||
|
||||
/* Turn a howto into a reloc number. */
|
||||
|
||||
static int
|
||||
coff_h8500_select_reloc (howto)
|
||||
@ -80,15 +85,14 @@ coff_h8500_select_reloc (howto)
|
||||
|
||||
#define __A_MAGIC_SET__
|
||||
|
||||
/* Code to swap in the reloc */
|
||||
/* Code to swap in the reloc. */
|
||||
#define SWAP_IN_RELOC_OFFSET bfd_h_get_32
|
||||
#define SWAP_OUT_RELOC_OFFSET bfd_h_put_32
|
||||
#define SWAP_OUT_RELOC_EXTRA(abfd, src, dst) \
|
||||
dst->r_stuff[0] = 'S'; \
|
||||
dst->r_stuff[1] = 'C';
|
||||
|
||||
/* Code to turn a r_type into a howto ptr, uses the above howto table
|
||||
*/
|
||||
/* Code to turn a r_type into a howto ptr, uses the above howto table. */
|
||||
|
||||
static void
|
||||
rtype2howto (internal, dst)
|
||||
@ -132,7 +136,7 @@ rtype2howto(internal, dst)
|
||||
|
||||
#define RTYPE2HOWTO(internal, relocentry) rtype2howto(internal,relocentry)
|
||||
|
||||
/* Perform any necessary magic to the addend in a reloc entry */
|
||||
/* Perform any necessary magic to the addend in a reloc entry. */
|
||||
|
||||
#define CALC_ADDEND(abfd, symbol, ext_reloc, cache_ptr) \
|
||||
cache_ptr->addend = ext_reloc.r_offset;
|
||||
@ -151,13 +155,9 @@ static void reloc_processing (relent, reloc, symbols, abfd, section)
|
||||
rtype2howto (relent, reloc);
|
||||
|
||||
if (reloc->r_symndx > 0)
|
||||
{
|
||||
relent->sym_ptr_ptr = symbols + obj_convert (abfd)[reloc->r_symndx];
|
||||
}
|
||||
else
|
||||
{
|
||||
relent->sym_ptr_ptr = bfd_abs_section_ptr->symbol_ptr_ptr;
|
||||
}
|
||||
|
||||
relent->addend = reloc->r_offset;
|
||||
relent->address -= section->vma;
|
||||
@ -175,6 +175,7 @@ extra_case (in_abfd, link_info, link_order, reloc, data, src_ptr, dst_ptr)
|
||||
{
|
||||
bfd_byte *d = data+*dst_ptr;
|
||||
asection *input_section = link_order->u.indirect.section;
|
||||
|
||||
switch (reloc->howto->type)
|
||||
{
|
||||
case R_H8500_IMM8:
|
||||
@ -248,7 +249,7 @@ extra_case (in_abfd, link_info, link_order, reloc, data, src_ptr, dst_ptr)
|
||||
+ *dst_ptr
|
||||
+ link_order->u.indirect.section->output_section->vma;
|
||||
int gap = dst - dot - 1; /* -1 since were in the odd byte of the
|
||||
word and the pc's been incremented */
|
||||
word and the pc's been incremented. */
|
||||
|
||||
if (gap > 128 || gap < -128)
|
||||
{
|
||||
@ -271,7 +272,7 @@ extra_case (in_abfd, link_info, link_order, reloc, data, src_ptr, dst_ptr)
|
||||
+ *dst_ptr
|
||||
+ link_order->u.indirect.section->output_section->vma;
|
||||
int gap = dst - dot - 1; /* -1 since were in the odd byte of the
|
||||
word and the pc's been incremented */
|
||||
word and the pc's been incremented. */
|
||||
|
||||
if (gap > 32767 || gap < -32768)
|
||||
{
|
||||
|
@ -68,18 +68,6 @@ static reloc_howto_type *m68kcoff_common_addend_rtype_to_howto
|
||||
#endif
|
||||
|
||||
static boolean m68k_coff_is_local_label_name PARAMS ((bfd *, const char *));
|
||||
#ifdef STATIC_RELOCS
|
||||
static
|
||||
#endif
|
||||
reloc_howto_type * m68k_reloc_type_lookup PARAMS ((bfd *, bfd_reloc_code_real_type));
|
||||
#ifdef STATIC_RELOCS
|
||||
static
|
||||
#endif
|
||||
int m68k_howto2rtype PARAMS ((reloc_howto_type *));
|
||||
#ifdef STATIC_RELOCS
|
||||
static
|
||||
#endif
|
||||
void m68k_rtype2howto PARAMS ((arelent *, int));
|
||||
|
||||
/* 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
|
||||
@ -135,10 +123,19 @@ extern int m68k_howto2rtype PARAMS ((reloc_howto_type *));
|
||||
extern reloc_howto_type *m68k_reloc_type_lookup
|
||||
PARAMS ((bfd *, bfd_reloc_code_real_type));
|
||||
#else
|
||||
|
||||
#ifdef STATIC_RELOCS
|
||||
static
|
||||
#define STAT_REL static
|
||||
#else
|
||||
#define STAT_REL
|
||||
#endif
|
||||
void
|
||||
|
||||
STAT_REL reloc_howto_type * m68k_reloc_type_lookup PARAMS ((bfd *, bfd_reloc_code_real_type));
|
||||
STAT_REL int m68k_howto2rtype PARAMS ((reloc_howto_type *));
|
||||
STAT_REL void m68k_rtype2howto PARAMS ((arelent *, int));
|
||||
|
||||
|
||||
STAT_REL void
|
||||
m68k_rtype2howto(internal, relocentry)
|
||||
arelent *internal;
|
||||
int relocentry;
|
||||
@ -155,10 +152,7 @@ m68k_rtype2howto(internal, relocentry)
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef STATIC_RELOCS
|
||||
static
|
||||
#endif
|
||||
int
|
||||
STAT_REL int
|
||||
m68k_howto2rtype (internal)
|
||||
reloc_howto_type *internal;
|
||||
{
|
||||
@ -183,10 +177,7 @@ m68k_howto2rtype (internal)
|
||||
return R_RELLONG;
|
||||
}
|
||||
|
||||
#ifdef STATIC_RELOCS
|
||||
static
|
||||
#endif
|
||||
reloc_howto_type *
|
||||
STAT_REL reloc_howto_type *
|
||||
m68k_reloc_type_lookup (abfd, code)
|
||||
bfd *abfd ATTRIBUTE_UNUSED;
|
||||
bfd_reloc_code_real_type code;
|
||||
|
@ -56,10 +56,10 @@ extern unsigned int _bfd_xcoff_swap_sym_out PARAMS ((bfd *, PTR, PTR));
|
||||
extern void _bfd_xcoff_swap_aux_in PARAMS ((bfd *, PTR, int, int, int, int, PTR));
|
||||
extern unsigned int _bfd_xcoff_swap_aux_out PARAMS ((bfd *, PTR, int, int, int, int, PTR));
|
||||
|
||||
/* Forward declare _bfd_xcoff_rtype2howto for coffcode.h macro */
|
||||
/* Forward declare _bfd_xcoff_rtype2howto for coffcode.h macro. */
|
||||
void _bfd_xcoff_rtype2howto PARAMS ((arelent *, struct internal_reloc *));
|
||||
|
||||
/* coffcode.h needs these to be defined */
|
||||
/* coffcode.h needs these to be defined. */
|
||||
#define RS6000COFF_C 1
|
||||
|
||||
#define SELECT_RELOC(internal, howto) \
|
||||
@ -251,9 +251,12 @@ _bfd_xcoff_swap_sym_in (abfd, ext1, in1)
|
||||
SYMENT *ext = (SYMENT *)ext1;
|
||||
struct internal_syment * in = (struct internal_syment *)in1;
|
||||
|
||||
if(ext->e.e_name[0] != 0) {
|
||||
if (ext->e.e_name[0] != 0)
|
||||
{
|
||||
memcpy(in->_n._n_name, ext->e.e_name, SYMNMLEN);
|
||||
} else {
|
||||
}
|
||||
else
|
||||
{
|
||||
in->_n._n_n._n_zeroes = 0;
|
||||
in->_n._n_n._n_offset =
|
||||
bfd_h_get_32 (abfd, (bfd_byte *) ext->e.e.e_offset);
|
||||
@ -275,9 +278,12 @@ _bfd_xcoff_swap_sym_out (abfd, inp, extp)
|
||||
struct internal_syment *in = (struct internal_syment *)inp;
|
||||
SYMENT *ext =(SYMENT *)extp;
|
||||
|
||||
if(in->_n._n_name[0] != 0) {
|
||||
if (in->_n._n_name[0] != 0)
|
||||
{
|
||||
memcpy(ext->e.e_name, in->_n._n_name, SYMNMLEN);
|
||||
} else {
|
||||
}
|
||||
else
|
||||
{
|
||||
bfd_h_put_32 (abfd, 0, (bfd_byte *) ext->e.e.e_zeroes);
|
||||
bfd_h_put_32 (abfd, in->_n._n_n._n_offset,
|
||||
(bfd_byte *) ext->e.e.e_offset);
|
||||
@ -311,13 +317,17 @@ _bfd_xcoff_swap_aux_in (abfd, ext1, type, class, indx, numaux, in1)
|
||||
AUXENT * ext = (AUXENT *)ext1;
|
||||
union internal_auxent *in = (union internal_auxent *)in1;
|
||||
|
||||
switch (class) {
|
||||
switch (class)
|
||||
{
|
||||
case C_FILE:
|
||||
if (ext->x_file.x_fname[0] == 0) {
|
||||
if (ext->x_file.x_fname[0] == 0)
|
||||
{
|
||||
in->x_file.x_n.x_zeroes = 0;
|
||||
in->x_file.x_n.x_offset =
|
||||
bfd_h_get_32 (abfd, (bfd_byte *) ext->x_file.x_n.x_offset);
|
||||
} else {
|
||||
}
|
||||
else
|
||||
{
|
||||
if (numaux > 1)
|
||||
{
|
||||
if (indx == 0)
|
||||
@ -355,7 +365,8 @@ _bfd_xcoff_swap_aux_in (abfd, ext1, type, class, indx, numaux, in1)
|
||||
case C_STAT:
|
||||
case C_LEAFSTAT:
|
||||
case C_HIDDEN:
|
||||
if (type == T_NULL) {
|
||||
if (type == T_NULL)
|
||||
{
|
||||
in->x_scn.x_scnlen = bfd_h_get_32(abfd,
|
||||
(bfd_byte *) ext->x_scn.x_scnlen);
|
||||
in->x_scn.x_nreloc = bfd_h_get_16(abfd,
|
||||
@ -394,10 +405,13 @@ _bfd_xcoff_swap_aux_in (abfd, ext1, type, class, indx, numaux, in1)
|
||||
in->x_sym.x_fcnary.x_ary.x_dimen[3] =
|
||||
bfd_h_get_16 (abfd, (bfd_byte *) ext->x_sym.x_fcnary.x_ary.x_dimen[3]);
|
||||
}
|
||||
if (ISFCN(type)) {
|
||||
|
||||
if (ISFCN (type))
|
||||
{
|
||||
in->x_sym.x_misc.x_fsize = bfd_h_get_32 (abfd, (bfd_byte *) ext->x_sym.x_misc.x_fsize);
|
||||
}
|
||||
else {
|
||||
else
|
||||
{
|
||||
in->x_sym.x_misc.x_lnsz.x_lnno = bfd_h_get_16 (abfd, (bfd_byte *)
|
||||
ext->x_sym.x_misc.x_lnsz.x_lnno);
|
||||
in->x_sym.x_misc.x_lnsz.x_size = bfd_h_get_16 (abfd, (bfd_byte *)
|
||||
@ -405,9 +419,8 @@ _bfd_xcoff_swap_aux_in (abfd, ext1, type, class, indx, numaux, in1)
|
||||
}
|
||||
|
||||
end: ;
|
||||
/* the semicolon is because MSVC doesn't like labels at
|
||||
/* The semicolon is because MSVC doesn't like labels at
|
||||
end of block. */
|
||||
|
||||
}
|
||||
|
||||
|
||||
@ -464,7 +477,8 @@ _bfd_xcoff_swap_aux_out (abfd, inp, type, class, indx, numaux, extp)
|
||||
case C_STAT:
|
||||
case C_LEAFSTAT:
|
||||
case C_HIDDEN:
|
||||
if (type == T_NULL) {
|
||||
if (type == T_NULL)
|
||||
{
|
||||
bfd_h_put_32(abfd, in->x_scn.x_scnlen, (bfd_byte *) ext->x_scn.x_scnlen);
|
||||
bfd_h_put_16(abfd, in->x_scn.x_nreloc, (bfd_byte *) ext->x_scn.x_nreloc);
|
||||
bfd_h_put_16(abfd, in->x_scn.x_nlinno, (bfd_byte *) ext->x_scn.x_nlinno);
|
||||
@ -1527,6 +1541,7 @@ xcoff_write_armap_old (abfd, elength, map, orl_count, stridx)
|
||||
}
|
||||
|
||||
/* Write a single armap in the big format. */
|
||||
|
||||
static boolean
|
||||
xcoff_write_one_armap_big (abfd, map, orl_count, orl_ccount, stridx, bits64,
|
||||
prevoff, nextoff)
|
||||
@ -1544,7 +1559,7 @@ xcoff_write_one_armap_big (abfd, map, orl_count, orl_ccount, stridx, bits64,
|
||||
unsigned char buf[4];
|
||||
bfd *sub;
|
||||
file_ptr fileoff;
|
||||
const bfd_arch_info_type *arch_info;
|
||||
const bfd_arch_info_type *arch_info = NULL;
|
||||
bfd *object_bfd;
|
||||
unsigned int i;
|
||||
|
||||
@ -1553,10 +1568,13 @@ xcoff_write_one_armap_big (abfd, map, orl_count, orl_ccount, stridx, bits64,
|
||||
machines) since the fields's width is 20 and there numbers with
|
||||
more than 32 bits can be represented. */
|
||||
sprintf (hdr.size, "%ld", (long) (4 + orl_ccount * 4 + stridx));
|
||||
if (bits64) {
|
||||
if (bits64)
|
||||
{
|
||||
sprintf (hdr.nextoff, "%d", 0);
|
||||
} else {
|
||||
/* do explict cast to long to remove compiler warning */
|
||||
}
|
||||
else
|
||||
{
|
||||
/* Do explict cast to long to remove compiler warning. */
|
||||
sprintf (hdr.nextoff, "%ld", (strtol (prevoff, (char **) NULL, 10)
|
||||
+ (long) (4 + orl_ccount * 4 + stridx)));
|
||||
}
|
||||
@ -1642,7 +1660,6 @@ xcoff_write_one_armap_big (abfd, map, orl_count, orl_ccount, stridx, bits64,
|
||||
return true;
|
||||
}
|
||||
|
||||
/*ARGSUSED*/
|
||||
static boolean
|
||||
xcoff_write_armap_big (abfd, elength, map, orl_count, stridx)
|
||||
bfd *abfd;
|
||||
@ -1654,7 +1671,7 @@ xcoff_write_armap_big (abfd, elength, map, orl_count, stridx)
|
||||
unsigned int i;
|
||||
unsigned int orl_count_32, orl_count_64;
|
||||
unsigned int stridx_32, stridx_64;
|
||||
const bfd_arch_info_type *arch_info;
|
||||
const bfd_arch_info_type *arch_info = NULL;
|
||||
bfd *object_bfd;
|
||||
|
||||
/* First, we look through the symbols and work out which are
|
||||
@ -1685,7 +1702,7 @@ xcoff_write_armap_big (abfd, elength, map, orl_count, stridx)
|
||||
}
|
||||
/* A quick sanity check... */
|
||||
BFD_ASSERT (orl_count_64 + orl_count_32 == orl_count);
|
||||
/* explicit cast to int for compiler */
|
||||
/* Explicit cast to int for compiler. */
|
||||
BFD_ASSERT ((int)(stridx_64 + stridx_32) == stridx);
|
||||
|
||||
/* Now write out each map. */
|
||||
@ -1703,7 +1720,6 @@ xcoff_write_armap_big (abfd, elength, map, orl_count, stridx)
|
||||
return true;
|
||||
}
|
||||
|
||||
/*ARGSUSED*/
|
||||
boolean
|
||||
_bfd_xcoff_write_armap (abfd, elength, map, orl_count, stridx)
|
||||
bfd *abfd;
|
||||
@ -2247,7 +2263,6 @@ _bfd_xcoff_write_archive_contents (abfd)
|
||||
/* We can't use the usual coff_sizeof_headers routine, because AIX
|
||||
always uses an a.out header. */
|
||||
|
||||
/*ARGSUSED*/
|
||||
int
|
||||
_bfd_xcoff_sizeof_headers (abfd, reloc)
|
||||
bfd *abfd;
|
||||
@ -2490,17 +2505,17 @@ xcoff_ppc_relocate_section (output_bfd, info, input_bfd,
|
||||
if this reloc is against the TOC anchor. */
|
||||
|
||||
if (sec->name[3] == '0'
|
||||
&& strcmp (sec->name, ".tc0") == 0) {
|
||||
|
||||
&& strcmp (sec->name, ".tc0") == 0)
|
||||
{
|
||||
val = xcoff_data (output_bfd)->toc;
|
||||
} else {
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
val = (sec->output_section->vma
|
||||
+ sec->output_offset
|
||||
+ sym->n_value
|
||||
- sec->vma);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
else
|
||||
@ -2735,7 +2750,6 @@ xcoff_ppc_relocate_section (output_bfd, info, input_bfd,
|
||||
name = h->root.root.string;
|
||||
else
|
||||
{
|
||||
|
||||
name = _bfd_coff_internal_syment_name (input_bfd, sym, buf);
|
||||
|
||||
if (name == NULL)
|
||||
@ -2804,11 +2818,14 @@ _bfd_xcoff_put_ldsymbol_name (abfd, ldinfo, ldsym, name)
|
||||
static boolean
|
||||
_bfd_xcoff_put_symbol_name (bfd *abfd, struct bfd_strtab_hash *strtab,
|
||||
struct internal_syment *sym,
|
||||
const char *name) {
|
||||
|
||||
if (strlen (name) <= SYMNMLEN) {
|
||||
const char *name)
|
||||
{
|
||||
if (strlen (name) <= SYMNMLEN)
|
||||
{
|
||||
strncpy (sym->_n._n_name, name, SYMNMLEN);
|
||||
} else {
|
||||
}
|
||||
else
|
||||
{
|
||||
boolean hash;
|
||||
bfd_size_type indx;
|
||||
|
||||
@ -2830,27 +2847,25 @@ xcoff_create_csect_from_smclas (abfd, aux, symbol_name)
|
||||
union internal_auxent *aux;
|
||||
const char *symbol_name;
|
||||
{
|
||||
|
||||
asection *return_value = NULL;
|
||||
|
||||
/*
|
||||
* .sv64 = x_smclas == 17
|
||||
* This is an invalid csect for 32 bit apps.
|
||||
*/
|
||||
static const char *names[19] = {
|
||||
/* .sv64 = x_smclas == 17
|
||||
This is an invalid csect for 32 bit apps. */
|
||||
static const char *names[19] =
|
||||
{
|
||||
".pr", ".ro", ".db", ".tc", ".ua", ".rw", ".gl", ".xo",
|
||||
".sv", ".bs", ".ds", ".uc", ".ti", ".tb", NULL, ".tc0",
|
||||
".td", NULL, ".sv3264"
|
||||
};
|
||||
|
||||
if ((19 >= aux->x_csect.x_smclas) &&
|
||||
(NULL != names[aux->x_csect.x_smclas])) {
|
||||
|
||||
(NULL != names[aux->x_csect.x_smclas]))
|
||||
{
|
||||
return_value = bfd_make_section_anyway
|
||||
(abfd, names[aux->x_csect.x_smclas]);
|
||||
|
||||
|
||||
} else {
|
||||
}
|
||||
else
|
||||
{
|
||||
(*_bfd_error_handler)
|
||||
(_("%s: symbol `%s' has unrecognized smclas %d"),
|
||||
bfd_get_filename (abfd), symbol_name, aux->x_csect.x_smclas);
|
||||
@ -2865,9 +2880,9 @@ xcoff_is_lineno_count_overflow (abfd, value)
|
||||
bfd *abfd ATTRIBUTE_UNUSED;
|
||||
bfd_vma value;
|
||||
{
|
||||
if (0xffff <= value) {
|
||||
if (0xffff <= value)
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -2876,9 +2891,9 @@ xcoff_is_reloc_count_overflow (abfd, value)
|
||||
bfd *abfd ATTRIBUTE_UNUSED;
|
||||
bfd_vma value;
|
||||
{
|
||||
if (0xffff <= value) {
|
||||
if (0xffff <= value)
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -2915,12 +2930,11 @@ HOWTO (0, /* type */
|
||||
0xffffffff, /* dst_mask */
|
||||
false); /* pcrel_offset */
|
||||
|
||||
/*
|
||||
* glink
|
||||
*
|
||||
* The first word of global linkage code must be modified by filling in
|
||||
* the correct TOC offset.
|
||||
*/
|
||||
/* glink
|
||||
|
||||
The first word of global linkage code must be modified by filling in
|
||||
the correct TOC offset. */
|
||||
|
||||
static unsigned long xcoff_glink_code[9] =
|
||||
{
|
||||
0x81820000, /* lwz r12,0(r2) */
|
||||
@ -2937,7 +2951,7 @@ static unsigned long xcoff_glink_code[9] =
|
||||
|
||||
static const struct xcoff_backend_data_rec bfd_xcoff_backend_data =
|
||||
{
|
||||
{ /* COFF backend, defined in libcoff.h */
|
||||
{ /* COFF backend, defined in libcoff.h. */
|
||||
_bfd_xcoff_swap_aux_in, /* _bfd_coff_swap_aux_in */
|
||||
_bfd_xcoff_swap_sym_in, /* _bfd_coff_swap_sym_in */
|
||||
coff_swap_lineno_in, /* _bfd_coff_swap_lineno_in */
|
||||
@ -2977,8 +2991,7 @@ static const struct xcoff_backend_data_rec bfd_xcoff_backend_data =
|
||||
dummy_reloc16_extra_cases, /* _bfd_coff_reloc16_extra_cases */
|
||||
dummy_reloc16_estimate, /* _bfd_coff_reloc16_estimate */
|
||||
NULL, /* bfd_coff_sym_is_global */
|
||||
/* _bfd_coff_compute_section_file_positions */
|
||||
coff_compute_section_file_positions,
|
||||
coff_compute_section_file_positions, /* _bfd_coff_compute_section_file_positions */
|
||||
NULL , /* _bfd_coff_start_final_link */
|
||||
xcoff_ppc_relocate_section, /* _bfd_coff_relocate_section */
|
||||
coff_rtype_to_howto, /* _bfd_coff_rtype_to_howto */
|
||||
@ -2992,8 +3005,7 @@ static const struct xcoff_backend_data_rec bfd_xcoff_backend_data =
|
||||
bfd_arch_rs6000, /* architecture */
|
||||
bfd_mach_rs6k, /* machine */
|
||||
|
||||
|
||||
/* function pointers to xcoff specific swap routines */
|
||||
/* Function pointers to xcoff specific swap routines. */
|
||||
xcoff_swap_ldhdr_in, /* _xcoff_swap_ldhdr_in */
|
||||
xcoff_swap_ldhdr_out, /* _xcoff_swap_ldhdr_out */
|
||||
xcoff_swap_ldsym_in, /* _xcoff_swap_ldsym_in */
|
||||
@ -3001,17 +3013,17 @@ static const struct xcoff_backend_data_rec bfd_xcoff_backend_data =
|
||||
xcoff_swap_ldrel_in, /* _xcoff_swap_ldrel_in */
|
||||
xcoff_swap_ldrel_out, /* _xcoff_swap_ldrel_out */
|
||||
|
||||
/* sizes */
|
||||
/* Sizes. */
|
||||
LDHDRSZ, /* _xcoff_ldhdrsz */
|
||||
LDSYMSZ, /* _xcoff_ldsymsz */
|
||||
LDRELSZ, /* _xcoff_ldrelsz */
|
||||
12, /* _xcoff_function_descriptor_size */
|
||||
SMALL_AOUTSZ, /* _xcoff_small_aout_header_size */
|
||||
|
||||
/* versions */
|
||||
/* Versions. */
|
||||
1, /* _xcoff_ldhdr_version */
|
||||
|
||||
/* xcoff vs xcoff64 putting symbol names */
|
||||
/* Xcoff vs xcoff64 putting symbol names. */
|
||||
_bfd_xcoff_put_symbol_name, /* _xcoff_put_symbol_name */
|
||||
_bfd_xcoff_put_ldsymbol_name, /* _xcoff_put_ldsymbol_name */
|
||||
|
||||
@ -3019,17 +3031,16 @@ static const struct xcoff_backend_data_rec bfd_xcoff_backend_data =
|
||||
|
||||
xcoff_create_csect_from_smclas, /* _xcoff_create_csect_from_smclas */
|
||||
|
||||
/* lineno and reloc count overflow */
|
||||
/* Lineno and reloc count overflow. */
|
||||
xcoff_is_lineno_count_overflow,
|
||||
xcoff_is_reloc_count_overflow,
|
||||
|
||||
xcoff_loader_symbol_offset,
|
||||
xcoff_loader_reloc_offset,
|
||||
|
||||
/* glink */
|
||||
/* glink. */
|
||||
& xcoff_glink_code[0],
|
||||
(36), /* _xcoff_glink_size */
|
||||
|
||||
};
|
||||
|
||||
/* The transfer vector that leads the outside world to all of the above. */
|
||||
|
@ -1,5 +1,5 @@
|
||||
/* BFD back-end for Hitachi Super-H COFF binaries.
|
||||
Copyright 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000
|
||||
Copyright 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001
|
||||
Free Software Foundation, Inc.
|
||||
Contributed by Cygnus Support.
|
||||
Written by Steve Chamberlain, <sac@cygnus.com>.
|
||||
@ -65,6 +65,7 @@ static boolean sh_relocate_section
|
||||
static bfd_byte *sh_coff_get_relocated_section_contents
|
||||
PARAMS ((bfd *, struct bfd_link_info *, struct bfd_link_order *,
|
||||
bfd_byte *, 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. */
|
||||
@ -83,6 +84,7 @@ static bfd_byte *sh_coff_get_relocated_section_contents
|
||||
#define COFF_LONG_FILENAMES
|
||||
|
||||
#ifdef COFF_WITH_PE
|
||||
static boolean in_reloc_p PARAMS ((bfd *, reloc_howto_type *));
|
||||
/* Return true if this relocation should
|
||||
appear in the output .reloc section. */
|
||||
static boolean in_reloc_p (abfd, howto)
|
||||
@ -412,6 +414,7 @@ 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)
|
||||
@ -2074,6 +2077,7 @@ static const struct sh_minor_opcode sh_opcodef[] =
|
||||
{ MAP (sh_opcodef1), 0xf0ff }
|
||||
};
|
||||
|
||||
#ifndef COFF_IMAGE_WITH_PE
|
||||
static struct sh_major_opcode sh_opcodes[] =
|
||||
{
|
||||
{ MAP (sh_opcode0) },
|
||||
@ -2093,6 +2097,7 @@ static struct sh_major_opcode sh_opcodes[] =
|
||||
{ MAP (sh_opcodee) },
|
||||
{ MAP (sh_opcodef) }
|
||||
};
|
||||
#endif
|
||||
|
||||
/* The double data transfer / parallel processing insns are not
|
||||
described here. This will cause sh_align_load_span to leave them alone. */
|
||||
@ -3133,6 +3138,8 @@ 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 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
|
||||
|
@ -1,5 +1,5 @@
|
||||
/* BFD back-end for TMS320C30 coff binaries.
|
||||
Copyright 1998, 1999, 2000 Free Software Foundation, Inc.
|
||||
Copyright 1998, 1999, 2000, 2001 Free Software Foundation, Inc.
|
||||
Contributed by Steven Haworth (steve@pm.cse.rmit.edu.au)
|
||||
|
||||
This file is part of BFD, the Binary File Descriptor library.
|
||||
@ -27,6 +27,12 @@
|
||||
#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[] =
|
||||
@ -50,6 +56,7 @@ reloc_howto_type tic30_coff_howto_table[] =
|
||||
/* For the case statement use the code values used in tc_gen_reloc to
|
||||
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;
|
||||
@ -75,7 +82,7 @@ tic30_coff_reloc_type_lookup (abfd, code)
|
||||
|
||||
#endif
|
||||
|
||||
/* Turn a howto into a reloc number */
|
||||
/* Turn a howto into a reloc number. */
|
||||
|
||||
static int
|
||||
coff_tic30_select_reloc (howto)
|
||||
@ -148,13 +155,10 @@ reloc_processing (relent, reloc, symbols, abfd, section)
|
||||
rtype2howto (relent, reloc);
|
||||
|
||||
if (reloc->r_symndx > 0)
|
||||
{
|
||||
relent->sym_ptr_ptr = symbols + obj_convert (abfd)[reloc->r_symndx];
|
||||
}
|
||||
else
|
||||
{
|
||||
relent->sym_ptr_ptr = bfd_abs_section_ptr->symbol_ptr_ptr;
|
||||
}
|
||||
|
||||
relent->addend = reloc->r_offset;
|
||||
relent->address -= section->vma;
|
||||
}
|
||||
|
@ -1,5 +1,5 @@
|
||||
/* BFD back-end for TMS320C54X coff binaries.
|
||||
Copyright 1999, 2000 Free Software Foundation, Inc.
|
||||
Copyright 1999, 2000, 2001 Free Software Foundation, Inc.
|
||||
Contributed by Timothy Wall (twall@cygnus.com)
|
||||
|
||||
This file is part of BFD, the Binary File Descriptor library.
|
||||
@ -30,19 +30,33 @@
|
||||
#undef F_LSYMS
|
||||
#define F_LSYMS F_LSYMS_TICOFF
|
||||
|
||||
/*
|
||||
32-bit operations
|
||||
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 boolean tic54x_set_section_contents PARAMS ((bfd *, sec_ptr, 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_vma tic54x_getl32 PARAMS ((const bfd_byte *));
|
||||
static void tic54x_putl32 PARAMS ((bfd_vma, bfd_byte *));
|
||||
static bfd_signed_vma tic54x_getl_signed_32 PARAMS ((const bfd_byte *));
|
||||
static 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 boolean ticoff0_bad_format_hook PARAMS ((bfd *, PTR));
|
||||
static boolean ticoff1_bad_format_hook PARAMS ((bfd *, PTR));
|
||||
static boolean ticoff_bfd_is_local_label_name PARAMS ((bfd *, const char *));
|
||||
|
||||
/* 32-bit operations
|
||||
The octet order is screwy. words are LSB first (LS octet, actually), but
|
||||
longwords are MSW first. For example, 0x12345678 is encoded 0x5678 in the
|
||||
first word and 0x1234 in the second. When looking at the data as stored in
|
||||
the COFF file, you would see the octets ordered as 0x78, 0x56, 0x34, 0x12.
|
||||
Don't bother with 64-bits, as there aren't any.
|
||||
*/
|
||||
Don't bother with 64-bits, as there aren't any. */
|
||||
|
||||
static bfd_vma
|
||||
tic54x_getl32 (addr)
|
||||
register const bfd_byte *addr;
|
||||
const bfd_byte *addr;
|
||||
{
|
||||
unsigned long v;
|
||||
|
||||
v = (unsigned long) addr[2];
|
||||
v |= (unsigned long) addr[3] << 8;
|
||||
v |= (unsigned long) addr[0] << 16;
|
||||
@ -53,7 +67,7 @@ tic54x_getl32(addr)
|
||||
static void
|
||||
tic54x_putl32 (data, addr)
|
||||
bfd_vma data;
|
||||
register bfd_byte *addr;
|
||||
bfd_byte *addr;
|
||||
{
|
||||
addr[2] = (bfd_byte)data;
|
||||
addr[3] = (bfd_byte) (data >> 8);
|
||||
@ -110,6 +124,7 @@ bfd_ticoff_get_section_load_page (sect)
|
||||
|
||||
/* Set the architecture appropriately. Allow unkown architectures
|
||||
(e.g. binary). */
|
||||
|
||||
static boolean
|
||||
tic54x_set_arch_mach (abfd, arch, machine)
|
||||
bfd *abfd;
|
||||
@ -136,7 +151,6 @@ tic54x_relocation (abfd, reloc_entry, symbol, data, input_section,
|
||||
bfd *output_bfd;
|
||||
char **error_message ATTRIBUTE_UNUSED;
|
||||
{
|
||||
|
||||
if (output_bfd != (bfd *) NULL)
|
||||
{
|
||||
/* This is a partial relocation, and we want to apply the
|
||||
@ -152,10 +166,10 @@ reloc_howto_type tic54x_howto_table[] =
|
||||
{
|
||||
/* type,rightshift,size (0=byte, 1=short, 2=long),
|
||||
bit size, pc_relative, bitpos, dont complain_on_overflow,
|
||||
special_function, name, partial_inplace, src_mask, dst_mask, pcrel_offset */
|
||||
special_function, name, partial_inplace, src_mask, dst_mask, pcrel_offset. */
|
||||
|
||||
/* NORMAL BANK */
|
||||
/* 16-bit direct reference to symbol's address */
|
||||
/* 16-bit direct reference to symbol's address. */
|
||||
HOWTO (R_RELWORD,0,1,16,false,0,complain_overflow_dont,
|
||||
tic54x_relocation,"REL16",false,0xFFFF,0xFFFF,false),
|
||||
|
||||
@ -209,13 +223,13 @@ reloc_howto_type tic54x_howto_table[] =
|
||||
/* 32-bit relocation exclusively for stabs */
|
||||
HOWTO (R_RELLONG,0,2,32,false,0,complain_overflow_dont,
|
||||
tic54x_relocation,"STAB",false,0xFFFFFFFF,0xFFFFFFFF,false),
|
||||
|
||||
};
|
||||
|
||||
#define coff_bfd_reloc_type_lookup tic54x_coff_reloc_type_lookup
|
||||
|
||||
/* For the case statement use the code values used tc_gen_reloc (defined in
|
||||
bfd/reloc.c) to map to the howto table entries */
|
||||
bfd/reloc.c) to map to the howto table entries. */
|
||||
|
||||
reloc_howto_type *
|
||||
tic54x_coff_reloc_type_lookup (abfd, code)
|
||||
bfd *abfd ATTRIBUTE_UNUSED;
|
||||
@ -243,7 +257,8 @@ tic54x_coff_reloc_type_lookup (abfd, code)
|
||||
}
|
||||
|
||||
/* Code to turn a r_type into a howto ptr, uses the above howto table.
|
||||
Called after some initial checking by the tic54x_rtype_to_howto fn below */
|
||||
Called after some initial checking by the tic54x_rtype_to_howto fn below. */
|
||||
|
||||
static void
|
||||
tic54x_lookup_howto (internal, dst)
|
||||
arelent *internal;
|
||||
@ -251,6 +266,7 @@ tic54x_lookup_howto (internal, dst)
|
||||
{
|
||||
unsigned i;
|
||||
int bank = (dst->r_symndx == -1) ? HOWTO_BANK : 0;
|
||||
|
||||
for (i = 0; i < sizeof tic54x_howto_table/sizeof tic54x_howto_table[0]; i++)
|
||||
{
|
||||
if (tic54x_howto_table[i].type == dst->r_type)
|
||||
@ -268,8 +284,6 @@ tic54x_lookup_howto (internal, dst)
|
||||
#define RELOC_PROCESSING(RELENT,RELOC,SYMS,ABFD,SECT)\
|
||||
tic54x_reloc_processing(RELENT,RELOC,SYMS,ABFD,SECT)
|
||||
|
||||
static void tic54x_reloc_processing();
|
||||
|
||||
#define coff_rtype_to_howto coff_tic54x_rtype_to_howto
|
||||
|
||||
static reloc_howto_type *
|
||||
@ -322,8 +336,9 @@ ticoff1_bad_format_hook (abfd, filehdr)
|
||||
return true;
|
||||
}
|
||||
|
||||
/* replace the stock _bfd_coff_is_local_label_name to recognize TI COFF local
|
||||
labels */
|
||||
/* Replace the stock _bfd_coff_is_local_label_name to recognize TI COFF local
|
||||
labels. */
|
||||
|
||||
static boolean
|
||||
ticoff_bfd_is_local_label_name (abfd, name)
|
||||
bfd *abfd ATTRIBUTE_UNUSED;
|
||||
@ -339,8 +354,7 @@ ticoff_bfd_is_local_label_name (abfd, name)
|
||||
/* Customize coffcode.h; the default coff_ functions are set up to use COFF2;
|
||||
coff_bad_format_hook uses BADMAG, so set that for COFF2. The COFF1
|
||||
and COFF0 vectors use custom _bad_format_hook procs instead of setting
|
||||
BADMAG.
|
||||
*/
|
||||
BADMAG. */
|
||||
#define BADMAG(x) COFF2_BADMAG(x)
|
||||
#include "coffcode.h"
|
||||
|
||||
@ -396,19 +410,19 @@ tic54x_reloc_processing (relent, reloc, symbols, abfd, section)
|
||||
refering to the symbols in the raw data have not been
|
||||
modified, so we have to have a negative addend to compensate.
|
||||
|
||||
Note that symbols which used to be common must be left alone */
|
||||
Note that symbols which used to be common must be left alone. */
|
||||
|
||||
/* Calculate any reloc addend by looking at the symbol */
|
||||
/* Calculate any reloc addend by looking at the symbol. */
|
||||
CALC_ADDEND (abfd, ptr, *reloc, relent);
|
||||
|
||||
relent->address -= section->vma;
|
||||
/* !! relent->section = (asection *) NULL;*/
|
||||
|
||||
/* Fill in the relent->howto field from reloc->r_type */
|
||||
/* Fill in the relent->howto field from reloc->r_type. */
|
||||
tic54x_lookup_howto (relent, reloc);
|
||||
}
|
||||
|
||||
/* COFF0 differs in file/section header size and relocation entry size */
|
||||
/* COFF0 differs in file/section header size and relocation entry size. */
|
||||
static CONST bfd_coff_backend_data ticoff0_swap_table =
|
||||
{
|
||||
coff_SWAP_aux_in, coff_SWAP_sym_in, coff_SWAP_lineno_in,
|
||||
@ -449,7 +463,7 @@ static CONST bfd_coff_backend_data ticoff0_swap_table =
|
||||
coff_link_output_has_begun, coff_final_link_postscript
|
||||
};
|
||||
|
||||
/* COFF1 differs in section header size */
|
||||
/* COFF1 differs in section header size. */
|
||||
static CONST bfd_coff_backend_data ticoff1_swap_table =
|
||||
{
|
||||
coff_SWAP_aux_in, coff_SWAP_sym_in, coff_SWAP_lineno_in,
|
||||
@ -490,7 +504,7 @@ static CONST bfd_coff_backend_data ticoff1_swap_table =
|
||||
coff_link_output_has_begun, coff_final_link_postscript
|
||||
};
|
||||
|
||||
/* TI COFF v0, DOS tools (little-endian headers) */
|
||||
/* TI COFF v0, DOS tools (little-endian headers). */
|
||||
const bfd_target tic54x_coff0_vec =
|
||||
{
|
||||
"coff0-c54x", /* name */
|
||||
@ -534,7 +548,7 @@ const bfd_target tic54x_coff0_vec =
|
||||
(PTR) & ticoff0_swap_table
|
||||
};
|
||||
|
||||
/* TI COFF v0, SPARC tools (big-endian headers) */
|
||||
/* TI COFF v0, SPARC tools (big-endian headers). */
|
||||
const bfd_target tic54x_coff0_beh_vec =
|
||||
{
|
||||
"coff0-beh-c54x", /* name */
|
||||
@ -579,7 +593,7 @@ const bfd_target tic54x_coff0_beh_vec =
|
||||
(PTR) & ticoff0_swap_table
|
||||
};
|
||||
|
||||
/* TI COFF v1, DOS tools (little-endian headers) */
|
||||
/* TI COFF v1, DOS tools (little-endian headers). */
|
||||
const bfd_target tic54x_coff1_vec =
|
||||
{
|
||||
"coff1-c54x", /* name */
|
||||
@ -624,7 +638,7 @@ const bfd_target tic54x_coff1_vec =
|
||||
(PTR) & ticoff1_swap_table
|
||||
};
|
||||
|
||||
/* TI COFF v1, SPARC tools (big-endian headers) */
|
||||
/* TI COFF v1, SPARC tools (big-endian headers). */
|
||||
const bfd_target tic54x_coff1_beh_vec =
|
||||
{
|
||||
"coff1-beh-c54x", /* name */
|
||||
@ -669,7 +683,7 @@ const bfd_target tic54x_coff1_beh_vec =
|
||||
(PTR) & ticoff1_swap_table
|
||||
};
|
||||
|
||||
/* TI COFF v2, TI DOS tools output (little-endian headers) */
|
||||
/* TI COFF v2, TI DOS tools output (little-endian headers). */
|
||||
const bfd_target tic54x_coff2_vec =
|
||||
{
|
||||
"coff2-c54x", /* name */
|
||||
@ -714,7 +728,7 @@ const bfd_target tic54x_coff2_vec =
|
||||
COFF_SWAP_TABLE
|
||||
};
|
||||
|
||||
/* TI COFF v2, TI SPARC tools output (big-endian headers) */
|
||||
/* TI COFF v2, TI SPARC tools output (big-endian headers). */
|
||||
const bfd_target tic54x_coff2_beh_vec =
|
||||
{
|
||||
"coff2-beh-c54x", /* name */
|
||||
|
@ -1,5 +1,5 @@
|
||||
/* BFD back-end for WDC 65816 COFF binaries.
|
||||
Copyright 1995, 1996, 1997, 1999, 2000 Free Software Foundation, Inc.
|
||||
Copyright 1995, 1996, 1997, 1999, 2000, 2001 Free Software Foundation, Inc.
|
||||
Written by Steve Chamberlain, <sac@cygnus.com>.
|
||||
|
||||
This file is part of BFD, the Binary File Descriptor library.
|
||||
@ -26,6 +26,12 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
|
||||
#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[] =
|
||||
{
|
||||
@ -39,10 +45,9 @@ static reloc_howto_type howto_table[] =
|
||||
HOWTO (R_W65_PCR8, 0, 0, 8, false, 0, complain_overflow_bitfield, 0, "pcrel8", true, 0x000000ff, 0x000000ff, true),
|
||||
HOWTO (R_W65_PCR16, 1, 0, 16, false, 0, complain_overflow_bitfield, 0, "pcrel16", true, 0x0000ffff, 0x0000ffff, true),
|
||||
HOWTO (R_W65_DP, 0, 0, 8, false, 0, complain_overflow_bitfield, 0, "dp", true, 0x000000ff, 0x000000ff, false),
|
||||
|
||||
};
|
||||
|
||||
/* Turn a howto into a reloc number */
|
||||
/* Turn a howto into a reloc number. */
|
||||
|
||||
#define SELECT_RELOC(x,howto) \
|
||||
{ x.r_type = select_reloc(howto); }
|
||||
@ -65,8 +70,7 @@ select_reloc (howto)
|
||||
return howto->type ;
|
||||
}
|
||||
|
||||
/* Code to turn a r_type into a howto ptr, uses the above howto table
|
||||
*/
|
||||
/* Code to turn a r_type into a howto ptr, uses the above howto table. */
|
||||
|
||||
static void
|
||||
rtype2howto (internal, dst)
|
||||
@ -78,7 +82,7 @@ rtype2howto (internal, dst)
|
||||
|
||||
#define RTYPE2HOWTO(internal, relocentry) rtype2howto(internal,relocentry)
|
||||
|
||||
/* Perform any necessary magic to the addend in a reloc entry */
|
||||
/* Perform any necessary magic to the addend in a reloc entry. */
|
||||
|
||||
#define CALC_ADDEND(abfd, symbol, ext_reloc, cache_ptr) \
|
||||
cache_ptr->addend = ext_reloc.r_offset;
|
||||
@ -98,13 +102,9 @@ reloc_processing (relent, reloc, symbols, abfd, section)
|
||||
rtype2howto (relent, reloc);
|
||||
|
||||
if (((int) reloc->r_symndx) > 0)
|
||||
{
|
||||
relent->sym_ptr_ptr = symbols + obj_convert (abfd)[reloc->r_symndx];
|
||||
}
|
||||
else
|
||||
{
|
||||
relent->sym_ptr_ptr = (asymbol **)&(bfd_abs_symbol);
|
||||
}
|
||||
|
||||
relent->addend = reloc->r_offset;
|
||||
|
||||
@ -113,7 +113,7 @@ reloc_processing (relent, reloc, symbols, abfd, section)
|
||||
}
|
||||
|
||||
static int
|
||||
h8300_reloc16_estimate(abfd, input_section, reloc, shrink, link_info)
|
||||
w65_reloc16_estimate (abfd, input_section, reloc, shrink, link_info)
|
||||
bfd *abfd;
|
||||
asection *input_section;
|
||||
arelent *reloc;
|
||||
@ -127,7 +127,7 @@ h8300_reloc16_estimate(abfd, input_section, reloc, shrink, link_info)
|
||||
/* 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 */
|
||||
uncooked section. */
|
||||
|
||||
/* reloc->address -= shrink; conceptual */
|
||||
|
||||
@ -140,18 +140,17 @@ h8300_reloc16_estimate(abfd, input_section, reloc, shrink, link_info)
|
||||
shrink+=2;
|
||||
break;
|
||||
|
||||
/* Thing is a move one byte */
|
||||
/* Thing is a move one byte. */
|
||||
case R_MOV16B1:
|
||||
value = bfd_coff_reloc16_get_value (reloc, link_info, input_section);
|
||||
|
||||
if (value >= 0xff00)
|
||||
{
|
||||
|
||||
/* Change the reloc type from 16bit, possible 8 to 8bit
|
||||
possible 16 */
|
||||
possible 16. */
|
||||
reloc->howto = reloc->howto + 1;
|
||||
/* The place to relc moves back by one */
|
||||
/* This will be two bytes smaller in the long run */
|
||||
/* The place to relc moves back by one. */
|
||||
/* This will be two bytes smaller in the long run. */
|
||||
shrink += 2;
|
||||
bfd_perform_slip (abfd, 2, input_section, address);
|
||||
}
|
||||
@ -159,7 +158,7 @@ h8300_reloc16_estimate(abfd, input_section, reloc, shrink, link_info)
|
||||
break;
|
||||
/* This is the 24 bit branch which could become an 8 bitter,
|
||||
the relocation points to the first byte of the insn, not the
|
||||
actual data */
|
||||
actual data. */
|
||||
|
||||
case R_JMPL1:
|
||||
value = bfd_coff_reloc16_get_value (reloc, link_info, input_section);
|
||||
@ -169,24 +168,21 @@ h8300_reloc16_estimate(abfd, input_section, reloc, shrink, link_info)
|
||||
|
||||
/* See if the address we're looking at within 127 bytes of where
|
||||
we are, if so then we can use a small branch rather than the
|
||||
jump we were going to */
|
||||
|
||||
jump we were going to. */
|
||||
gap = value - dot;
|
||||
|
||||
if (-120 < (long) gap && (long) gap < 120)
|
||||
{
|
||||
|
||||
/* Change the reloc type from 24bit, possible 8 to 8bit
|
||||
possible 32 */
|
||||
possible 32. */
|
||||
reloc->howto = reloc->howto + 1;
|
||||
/* This will be two bytes smaller in the long run */
|
||||
/* This will be two bytes smaller in the long run. */
|
||||
shrink += 2;
|
||||
bfd_perform_slip (abfd, 2, input_section, address);
|
||||
}
|
||||
break;
|
||||
|
||||
case R_JMP1:
|
||||
|
||||
value = bfd_coff_reloc16_get_value (reloc, link_info, input_section);
|
||||
|
||||
dot = input_section->output_section->vma +
|
||||
@ -194,19 +190,17 @@ h8300_reloc16_estimate(abfd, input_section, reloc, shrink, link_info)
|
||||
|
||||
/* See if the address we're looking at within 127 bytes of where
|
||||
we are, if so then we can use a small branch rather than the
|
||||
jump we were going to */
|
||||
|
||||
jump we were going to. */
|
||||
gap = value - (dot - shrink);
|
||||
|
||||
if (-120 < (long) gap && (long) gap < 120)
|
||||
{
|
||||
|
||||
/* Change the reloc type from 16bit, possible 8 to 8bit
|
||||
possible 16 */
|
||||
possible 16. */
|
||||
reloc->howto = reloc->howto + 1;
|
||||
/* The place to relc moves back by one */
|
||||
/* The place to relc moves back by one. */
|
||||
|
||||
/* This will be two bytes smaller in the long run */
|
||||
/* This will be two bytes smaller in the long run. */
|
||||
shrink += 2;
|
||||
bfd_perform_slip (abfd, 2, input_section, address);
|
||||
}
|
||||
@ -216,19 +210,17 @@ h8300_reloc16_estimate(abfd, input_section, reloc, shrink, link_info)
|
||||
return shrink;
|
||||
}
|
||||
|
||||
/* First phase of a relaxing link */
|
||||
/* First phase of a relaxing link. */
|
||||
|
||||
/* Reloc types
|
||||
large small
|
||||
R_MOV16B1 R_MOV16B2 mov.b with 16bit or 8 bit address
|
||||
R_JMP1 R_JMP2 jmp or pcrel branch
|
||||
R_JMPL1 R_JMPL_B8 24jmp or pcrel branch
|
||||
R_MOV24B1 R_MOV24B2 24 or 8 bit reloc for mov.b
|
||||
|
||||
*/
|
||||
R_MOV24B1 R_MOV24B2 24 or 8 bit reloc for mov.b */
|
||||
|
||||
static void
|
||||
h8300_reloc16_extra_cases (abfd, link_info, link_order, reloc, data, src_ptr,
|
||||
w65_reloc16_extra_cases (abfd, link_info, link_order, reloc, data, src_ptr,
|
||||
dst_ptr)
|
||||
bfd *abfd;
|
||||
struct bfd_link_info *link_info;
|
||||
@ -328,7 +320,8 @@ h8300_reloc16_extra_cases (abfd, link_info, link_order, reloc, data, src_ptr,
|
||||
+ link_order->u.indirect.section->output_section->vma;
|
||||
|
||||
gap -= dot + 1;
|
||||
if (gap < -128 || gap > 127) {
|
||||
if (gap < -128 || gap > 127)
|
||||
{
|
||||
if (! ((*link_info->callbacks->reloc_overflow)
|
||||
(link_info, bfd_asymbol_name (*reloc->sym_ptr_ptr),
|
||||
reloc->howto->name, reloc->addend, input_section->owner,
|
||||
@ -350,8 +343,9 @@ h8300_reloc16_extra_cases (abfd, link_info, link_order, reloc, data, src_ptr,
|
||||
+ link_order->u.indirect.section->output_section->vma;
|
||||
|
||||
/* This wraps within the page, so ignore the relativeness, look at the
|
||||
high part */
|
||||
if ((gap & 0xf0000) != (dot & 0xf0000)) {
|
||||
high part. */
|
||||
if ((gap & 0xf0000) != (dot & 0xf0000))
|
||||
{
|
||||
if (! ((*link_info->callbacks->reloc_overflow)
|
||||
(link_info, bfd_asymbol_name (*reloc->sym_ptr_ptr),
|
||||
reloc->howto->name, reloc->addend, input_section->owner,
|
||||
@ -372,11 +366,10 @@ h8300_reloc16_extra_cases (abfd, link_info, link_order, reloc, data, src_ptr,
|
||||
}
|
||||
*src_ptr = src_address;
|
||||
*dst_ptr = dst_address;
|
||||
|
||||
}
|
||||
|
||||
#define coff_reloc16_extra_cases h8300_reloc16_extra_cases
|
||||
#define coff_reloc16_estimate h8300_reloc16_estimate
|
||||
#define coff_reloc16_extra_cases w65_reloc16_extra_cases
|
||||
#define coff_reloc16_estimate w65_reloc16_estimate
|
||||
|
||||
#include "coffcode.h"
|
||||
|
||||
|
@ -28,6 +28,11 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
|
||||
#include "coff/internal.h"
|
||||
#include "libcoff.h"
|
||||
|
||||
static void extra_case PARAMS ((bfd *, struct bfd_link_info *, struct bfd_link_order *, arelent *, bfd_byte *, unsigned int *, unsigned int *));
|
||||
static void reloc_processing PARAMS ((arelent *, struct internal_reloc *, asymbol **, bfd *, asection *));
|
||||
static void rtype2howto PARAMS ((arelent *, struct internal_reloc *));
|
||||
static int coff_z8k_select_reloc PARAMS ((reloc_howto_type *));
|
||||
|
||||
#define COFF_DEFAULT_SECTION_ALIGNMENT_POWER (1)
|
||||
|
||||
static reloc_howto_type r_imm32 =
|
||||
@ -81,15 +86,14 @@ coff_z8k_select_reloc (howto)
|
||||
#define Z8K 1 /* Customize coffcode.h */
|
||||
#define __A_MAGIC_SET__
|
||||
|
||||
/* Code to swap in the reloc */
|
||||
/* Code to swap in the reloc. */
|
||||
#define SWAP_IN_RELOC_OFFSET bfd_h_get_32
|
||||
#define SWAP_OUT_RELOC_OFFSET bfd_h_put_32
|
||||
#define SWAP_OUT_RELOC_EXTRA(abfd, src, dst) \
|
||||
dst->r_stuff[0] = 'S'; \
|
||||
dst->r_stuff[1] = 'C';
|
||||
|
||||
/* Code to turn a r_type into a howto ptr, uses the above howto table
|
||||
*/
|
||||
/* Code to turn a r_type into a howto ptr, uses the above howto table. */
|
||||
|
||||
static void
|
||||
rtype2howto (internal, dst)
|
||||
@ -130,7 +134,7 @@ rtype2howto (internal, dst)
|
||||
|
||||
#define RTYPE2HOWTO(internal, relocentry) rtype2howto (internal, relocentry)
|
||||
|
||||
/* Perform any necessary magic to the addend in a reloc entry */
|
||||
/* Perform any necessary magic to the addend in a reloc entry. */
|
||||
|
||||
#define CALC_ADDEND(abfd, symbol, ext_reloc, cache_ptr) \
|
||||
cache_ptr->addend = ext_reloc.r_offset;
|
||||
|
Reference in New Issue
Block a user