mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-06-05 15:17:13 +08:00
2000-11-15 Kazu Hirata <kazu@hxi.com>
* coff-rs6000.c: Fix formatting. * coff-sh.c: Likewise. * coff-sparc.c: Likewise. * coff-tic30.c: Likewise. * coff-tic54x.c: Likewise. * coff-tic80.c: Likewise. * coff-w65.c: Likewise. * coff-we32k.c: Likewise. * coff-z8k.c: Likewise.
This commit is contained in:
@ -3,6 +3,14 @@
|
|||||||
* coff-arm.c: Fix formatting.
|
* coff-arm.c: Fix formatting.
|
||||||
* coff-ppc.c: Likewise.
|
* coff-ppc.c: Likewise.
|
||||||
* coff-rs6000.c: Likewise.
|
* coff-rs6000.c: Likewise.
|
||||||
|
* coff-sh.c: Likewise.
|
||||||
|
* coff-sparc.c: Likewise.
|
||||||
|
* coff-tic30.c: Likewise.
|
||||||
|
* coff-tic54x.c: Likewise.
|
||||||
|
* coff-tic80.c: Likewise.
|
||||||
|
* coff-w65.c: Likewise.
|
||||||
|
* coff-we32k.c: Likewise.
|
||||||
|
* coff-z8k.c: Likewise.
|
||||||
|
|
||||||
2000-11-15 Richard Henderson <rth@redhat.com>
|
2000-11-15 Richard Henderson <rth@redhat.com>
|
||||||
|
|
||||||
|
@ -1542,7 +1542,6 @@ normalize_filename (abfd)
|
|||||||
|
|
||||||
/* Write out an XCOFF armap. */
|
/* Write out an XCOFF armap. */
|
||||||
|
|
||||||
/*ARGSUSED*/
|
|
||||||
static boolean
|
static boolean
|
||||||
xcoff_write_armap_old (abfd, elength, map, orl_count, stridx)
|
xcoff_write_armap_old (abfd, elength, map, orl_count, stridx)
|
||||||
bfd *abfd;
|
bfd *abfd;
|
||||||
@ -1741,7 +1740,6 @@ xcoff_write_one_armap_big (abfd, map, orl_count, orl_ccount, stridx, bits64,
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*ARGSUSED*/
|
|
||||||
static boolean
|
static boolean
|
||||||
xcoff_write_armap_big (abfd, elength, map, orl_count, stridx)
|
xcoff_write_armap_big (abfd, elength, map, orl_count, stridx)
|
||||||
bfd *abfd;
|
bfd *abfd;
|
||||||
@ -1801,7 +1799,6 @@ xcoff_write_armap_big (abfd, elength, map, orl_count, stridx)
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*ARGSUSED*/
|
|
||||||
boolean
|
boolean
|
||||||
_bfd_xcoff_write_armap (abfd, elength, map, orl_count, stridx)
|
_bfd_xcoff_write_armap (abfd, elength, map, orl_count, stridx)
|
||||||
bfd *abfd;
|
bfd *abfd;
|
||||||
@ -2345,7 +2342,6 @@ _bfd_xcoff_write_archive_contents (abfd)
|
|||||||
/* We can't use the usual coff_sizeof_headers routine, because AIX
|
/* We can't use the usual coff_sizeof_headers routine, because AIX
|
||||||
always uses an a.out header. */
|
always uses an a.out header. */
|
||||||
|
|
||||||
/*ARGSUSED*/
|
|
||||||
int
|
int
|
||||||
_bfd_xcoff_sizeof_headers (abfd, reloc)
|
_bfd_xcoff_sizeof_headers (abfd, reloc)
|
||||||
bfd *abfd;
|
bfd *abfd;
|
||||||
@ -2361,5 +2357,3 @@ _bfd_xcoff_sizeof_headers (abfd, reloc)
|
|||||||
size += abfd->section_count * SCNHSZ;
|
size += abfd->section_count * SCNHSZ;
|
||||||
return size;
|
return size;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -31,7 +31,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
|
|||||||
#include "coff/pe.h"
|
#include "coff/pe.h"
|
||||||
|
|
||||||
#ifndef COFF_IMAGE_WITH_PE
|
#ifndef COFF_IMAGE_WITH_PE
|
||||||
static boolean sh_align_load_span
|
static boolean sh_align_load_span
|
||||||
PARAMS ((bfd *, asection *, bfd_byte *,
|
PARAMS ((bfd *, asection *, bfd_byte *,
|
||||||
boolean (*) (bfd *, asection *, PTR, bfd_byte *, bfd_vma),
|
boolean (*) (bfd *, asection *, PTR, bfd_byte *, bfd_vma),
|
||||||
PTR, bfd_vma **, bfd_vma *, bfd_vma, bfd_vma, boolean *));
|
PTR, bfd_vma **, bfd_vma *, bfd_vma, bfd_vma, boolean *));
|
||||||
@ -88,7 +88,7 @@ static boolean in_reloc_p (abfd, howto)
|
|||||||
reloc_howto_type * howto;
|
reloc_howto_type * howto;
|
||||||
{
|
{
|
||||||
return ! howto->pc_relative && howto->type != R_SH_IMAGEBASE;
|
return ! howto->pc_relative && howto->type != R_SH_IMAGEBASE;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* The supported relocations. There are a lot of relocations defined
|
/* The supported relocations. There are a lot of relocations defined
|
||||||
@ -171,18 +171,18 @@ static reloc_howto_type sh_coff_howtos[] =
|
|||||||
|
|
||||||
EMPTY_HOWTO (15),
|
EMPTY_HOWTO (15),
|
||||||
#ifdef COFF_WITH_PE
|
#ifdef COFF_WITH_PE
|
||||||
HOWTO (R_SH_IMAGEBASE, /* type */
|
HOWTO (R_SH_IMAGEBASE, /* type */
|
||||||
0, /* rightshift */
|
0, /* rightshift */
|
||||||
2, /* size (0 = byte, 1 = short, 2 = long) */
|
2, /* size (0 = byte, 1 = short, 2 = long) */
|
||||||
32, /* bitsize */
|
32, /* bitsize */
|
||||||
false, /* pc_relative */
|
false, /* pc_relative */
|
||||||
0, /* bitpos */
|
0, /* bitpos */
|
||||||
complain_overflow_bitfield, /* complain_on_overflow */
|
complain_overflow_bitfield, /* complain_on_overflow */
|
||||||
sh_reloc, /* special_function */
|
sh_reloc, /* special_function */
|
||||||
"rva32", /* name */
|
"rva32", /* name */
|
||||||
true, /* partial_inplace */
|
true, /* partial_inplace */
|
||||||
0xffffffff, /* src_mask */
|
0xffffffff, /* src_mask */
|
||||||
0xffffffff, /* dst_mask */
|
0xffffffff, /* dst_mask */
|
||||||
false), /* pcrel_offset */
|
false), /* pcrel_offset */
|
||||||
#else
|
#else
|
||||||
EMPTY_HOWTO (16), /* R_SH_IMM8 */
|
EMPTY_HOWTO (16), /* R_SH_IMM8 */
|
||||||
@ -391,14 +391,14 @@ static reloc_howto_type sh_coff_howtos[] =
|
|||||||
/* Get the value of a symbol, when performing a relocation. */
|
/* Get the value of a symbol, when performing a relocation. */
|
||||||
|
|
||||||
static long
|
static long
|
||||||
get_symbol_value (symbol)
|
get_symbol_value (symbol)
|
||||||
asymbol *symbol;
|
asymbol *symbol;
|
||||||
{
|
{
|
||||||
bfd_vma relocation;
|
bfd_vma relocation;
|
||||||
|
|
||||||
if (bfd_is_com_section (symbol->section))
|
if (bfd_is_com_section (symbol->section))
|
||||||
relocation = 0;
|
relocation = 0;
|
||||||
else
|
else
|
||||||
relocation = (symbol->value +
|
relocation = (symbol->value +
|
||||||
symbol->section->output_section->vma +
|
symbol->section->output_section->vma +
|
||||||
symbol->section->output_offset);
|
symbol->section->output_offset);
|
||||||
@ -676,7 +676,7 @@ sh_reloc (abfd, reloc_entry, symbol_in, data, input_section, output_bfd,
|
|||||||
align load and store instructions on four byte boundaries if we
|
align load and store instructions on four byte boundaries if we
|
||||||
can, by swapping them with one of the adjacent instructions. */
|
can, by swapping them with one of the adjacent instructions. */
|
||||||
|
|
||||||
static boolean
|
static boolean
|
||||||
sh_relax_section (abfd, sec, link_info, again)
|
sh_relax_section (abfd, sec, link_info, again)
|
||||||
bfd *abfd;
|
bfd *abfd;
|
||||||
asection *sec;
|
asection *sec;
|
||||||
@ -2144,7 +2144,7 @@ sh_insn_info (insn)
|
|||||||
return op;
|
return op;
|
||||||
}
|
}
|
||||||
|
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* See whether an instruction uses or sets a general purpose register */
|
/* See whether an instruction uses or sets a general purpose register */
|
||||||
@ -2251,7 +2251,7 @@ sh_insn_uses_freg (insn, op, freg)
|
|||||||
of a double precision value.
|
of a double precision value.
|
||||||
So what this all boils down to is that we have to ignore the lowest
|
So what this all boils down to is that we have to ignore the lowest
|
||||||
bit of the register number. */
|
bit of the register number. */
|
||||||
|
|
||||||
if ((f & USESF1) != 0
|
if ((f & USESF1) != 0
|
||||||
&& (USESF1_REG (insn) & 0xe) == (freg & 0xe))
|
&& (USESF1_REG (insn) & 0xe) == (freg & 0xe))
|
||||||
return true;
|
return true;
|
||||||
@ -2285,7 +2285,7 @@ sh_insn_sets_freg (insn, op, freg)
|
|||||||
of a double precision value.
|
of a double precision value.
|
||||||
So what this all boils down to is that we have to ignore the lowest
|
So what this all boils down to is that we have to ignore the lowest
|
||||||
bit of the register number. */
|
bit of the register number. */
|
||||||
|
|
||||||
if ((f & SETSF1) != 0
|
if ((f & SETSF1) != 0
|
||||||
&& (SETSF1_REG (insn) & 0xe) == (freg & 0xe))
|
&& (SETSF1_REG (insn) & 0xe) == (freg & 0xe))
|
||||||
return true;
|
return true;
|
||||||
@ -2485,7 +2485,7 @@ _bfd_sh_align_load_span (abfd, sec, contents, swap, relocs,
|
|||||||
if (dsp && i - 2 > start)
|
if (dsp && i - 2 > start)
|
||||||
{
|
{
|
||||||
unsigned pprev_insn = bfd_get_16 (abfd, contents + i - 4);
|
unsigned pprev_insn = bfd_get_16 (abfd, contents + i - 4);
|
||||||
|
|
||||||
if ((pprev_insn & 0xfc00) == 0xf800)
|
if ((pprev_insn & 0xfc00) == 0xf800)
|
||||||
prev_op = NULL;
|
prev_op = NULL;
|
||||||
else
|
else
|
||||||
@ -2875,7 +2875,7 @@ sh_relocate_section (output_bfd, info, input_bfd, input_section, contents,
|
|||||||
sym = NULL;
|
sym = NULL;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (symndx < 0
|
if (symndx < 0
|
||||||
|| (unsigned long) symndx >= obj_raw_syment_count (input_bfd))
|
|| (unsigned long) symndx >= obj_raw_syment_count (input_bfd))
|
||||||
{
|
{
|
||||||
@ -2912,7 +2912,7 @@ sh_relocate_section (output_bfd, info, input_bfd, input_section, contents,
|
|||||||
if (rel->r_type == R_SH_IMAGEBASE)
|
if (rel->r_type == R_SH_IMAGEBASE)
|
||||||
addend -= pe_data (input_section->output_section->owner)->pe_opthdr.ImageBase;
|
addend -= pe_data (input_section->output_section->owner)->pe_opthdr.ImageBase;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
val = 0;
|
val = 0;
|
||||||
|
|
||||||
if (h == NULL)
|
if (h == NULL)
|
||||||
@ -3118,7 +3118,7 @@ CREATE_BIG_COFF_TARGET_VEC (shcoff_vec, "coff-sh", BFD_IS_RELAXABLE, 0, '_', NUL
|
|||||||
#else
|
#else
|
||||||
#define TARGET_SYM shlcoff_vec
|
#define TARGET_SYM shlcoff_vec
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef TARGET_SHL_NAME
|
#ifndef TARGET_SHL_NAME
|
||||||
#define TARGET_SHL_NAME "coff-shl"
|
#define TARGET_SHL_NAME "coff-shl"
|
||||||
#endif
|
#endif
|
||||||
@ -3270,7 +3270,7 @@ const bfd_target shcoff_small_vec =
|
|||||||
BFD_JUMP_TABLE_DYNAMIC (_bfd_nodynamic),
|
BFD_JUMP_TABLE_DYNAMIC (_bfd_nodynamic),
|
||||||
|
|
||||||
& shlcoff_small_vec,
|
& shlcoff_small_vec,
|
||||||
|
|
||||||
(PTR) &bfd_coff_small_swap_table
|
(PTR) &bfd_coff_small_swap_table
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -3297,7 +3297,7 @@ const bfd_target shlcoff_small_vec =
|
|||||||
bfd_getl16, bfd_getl_signed_16, bfd_putl16, /* hdrs */
|
bfd_getl16, bfd_getl_signed_16, bfd_putl16, /* hdrs */
|
||||||
|
|
||||||
{_bfd_dummy_target, coff_small_object_p, /* bfd_check_format */
|
{_bfd_dummy_target, coff_small_object_p, /* bfd_check_format */
|
||||||
bfd_generic_archive_p, _bfd_dummy_target},
|
bfd_generic_archive_p, _bfd_dummy_target},
|
||||||
{bfd_false, coff_mkobject, _bfd_generic_mkarchive, /* bfd_set_format */
|
{bfd_false, coff_mkobject, _bfd_generic_mkarchive, /* bfd_set_format */
|
||||||
bfd_false},
|
bfd_false},
|
||||||
{bfd_false, coff_write_object_contents, /* bfd_write_contents */
|
{bfd_false, coff_write_object_contents, /* bfd_write_contents */
|
||||||
@ -3314,7 +3314,7 @@ const bfd_target shlcoff_small_vec =
|
|||||||
BFD_JUMP_TABLE_DYNAMIC (_bfd_nodynamic),
|
BFD_JUMP_TABLE_DYNAMIC (_bfd_nodynamic),
|
||||||
|
|
||||||
& shcoff_small_vec,
|
& shcoff_small_vec,
|
||||||
|
|
||||||
(PTR) &bfd_coff_small_swap_table
|
(PTR) &bfd_coff_small_swap_table
|
||||||
};
|
};
|
||||||
#endif
|
#endif
|
||||||
|
@ -36,8 +36,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
|
|||||||
enum reloc_type
|
enum reloc_type
|
||||||
{
|
{
|
||||||
R_SPARC_NONE = 0,
|
R_SPARC_NONE = 0,
|
||||||
R_SPARC_8, R_SPARC_16, R_SPARC_32,
|
R_SPARC_8, R_SPARC_16, R_SPARC_32,
|
||||||
R_SPARC_DISP8, R_SPARC_DISP16, R_SPARC_DISP32,
|
R_SPARC_DISP8, R_SPARC_DISP16, R_SPARC_DISP32,
|
||||||
R_SPARC_WDISP30, R_SPARC_WDISP22,
|
R_SPARC_WDISP30, R_SPARC_WDISP22,
|
||||||
R_SPARC_HI22, R_SPARC_22,
|
R_SPARC_HI22, R_SPARC_22,
|
||||||
R_SPARC_13, R_SPARC_LO10,
|
R_SPARC_13, R_SPARC_LO10,
|
||||||
@ -96,7 +96,7 @@ bfd_coff_generic_reloc (abfd, reloc_entry, symbol, data, input_section,
|
|||||||
return bfd_reloc_continue;
|
return bfd_reloc_continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
static reloc_howto_type coff_sparc_howto_table[] =
|
static reloc_howto_type coff_sparc_howto_table[] =
|
||||||
{
|
{
|
||||||
HOWTO(R_SPARC_NONE, 0,0, 0,false,0,complain_overflow_dont, bfd_coff_generic_reloc,"R_SPARC_NONE", false,0,0x00000000,true),
|
HOWTO(R_SPARC_NONE, 0,0, 0,false,0,complain_overflow_dont, bfd_coff_generic_reloc,"R_SPARC_NONE", false,0,0x00000000,true),
|
||||||
HOWTO(R_SPARC_8, 0,0, 8,false,0,complain_overflow_bitfield,bfd_coff_generic_reloc,"R_SPARC_8", false,0,0x000000ff,true),
|
HOWTO(R_SPARC_8, 0,0, 8,false,0,complain_overflow_bitfield,bfd_coff_generic_reloc,"R_SPARC_8", false,0,0x000000ff,true),
|
||||||
@ -197,7 +197,7 @@ rtype2howto (cache_ptr, dst)
|
|||||||
|
|
||||||
#define __A_MAGIC_SET__
|
#define __A_MAGIC_SET__
|
||||||
|
|
||||||
/* Enable Sparc-specific hacks in coffcode.h. */
|
/* Enable Sparc-specific hacks in coffcode.h. */
|
||||||
|
|
||||||
#define COFF_SPARC
|
#define COFF_SPARC
|
||||||
|
|
||||||
|
@ -49,7 +49,7 @@ reloc_howto_type tic30_coff_howto_table[] =
|
|||||||
|
|
||||||
/* For the case statement use the code values used in tc_gen_reloc to
|
/* 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
|
map to the howto table entries that match those in both the aout
|
||||||
and coff implementations. */
|
and coff implementations. */
|
||||||
reloc_howto_type *
|
reloc_howto_type *
|
||||||
tic30_coff_reloc_type_lookup (abfd, code)
|
tic30_coff_reloc_type_lookup (abfd, code)
|
||||||
bfd *abfd ATTRIBUTE_UNUSED;
|
bfd *abfd ATTRIBUTE_UNUSED;
|
||||||
@ -86,7 +86,6 @@ coff_tic30_select_reloc (howto)
|
|||||||
|
|
||||||
#define SELECT_RELOC(x,howto) x.r_type = coff_tic30_select_reloc(howto)
|
#define SELECT_RELOC(x,howto) x.r_type = coff_tic30_select_reloc(howto)
|
||||||
|
|
||||||
|
|
||||||
#define BADMAG(x) TIC30BADMAG(x)
|
#define BADMAG(x) TIC30BADMAG(x)
|
||||||
#define TIC30 1 /* Customize coffcode.h */
|
#define TIC30 1 /* Customize coffcode.h */
|
||||||
#define __A_MAGIC_SET__
|
#define __A_MAGIC_SET__
|
||||||
@ -97,7 +96,7 @@ coff_tic30_select_reloc (howto)
|
|||||||
#define SWAP_OUT_RELOC_EXTRA(abfd, src, dst) dst->r_stuff[0] = 'S'; \
|
#define SWAP_OUT_RELOC_EXTRA(abfd, src, dst) dst->r_stuff[0] = 'S'; \
|
||||||
dst->r_stuff[1] = 'C';
|
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
|
static void
|
||||||
rtype2howto (internal, dst)
|
rtype2howto (internal, dst)
|
||||||
@ -134,7 +133,6 @@ rtype2howto (internal, dst)
|
|||||||
#define CALC_ADDEND(abfd, symbol, ext_reloc, cache_ptr) \
|
#define CALC_ADDEND(abfd, symbol, ext_reloc, cache_ptr) \
|
||||||
cache_ptr->addend = ext_reloc.r_offset;
|
cache_ptr->addend = ext_reloc.r_offset;
|
||||||
|
|
||||||
|
|
||||||
#define RELOC_PROCESSING(relent,reloc,symbols,abfd,section) \
|
#define RELOC_PROCESSING(relent,reloc,symbols,abfd,section) \
|
||||||
reloc_processing(relent, reloc, symbols, abfd, section)
|
reloc_processing(relent, reloc, symbols, abfd, section)
|
||||||
|
|
||||||
@ -203,6 +201,6 @@ const bfd_target tic30_coff_vec =
|
|||||||
BFD_JUMP_TABLE_DYNAMIC (_bfd_nodynamic),
|
BFD_JUMP_TABLE_DYNAMIC (_bfd_nodynamic),
|
||||||
|
|
||||||
NULL,
|
NULL,
|
||||||
|
|
||||||
COFF_SWAP_TABLE
|
COFF_SWAP_TABLE
|
||||||
};
|
};
|
||||||
|
@ -79,7 +79,7 @@ tic54x_getl_signed_32 (addr)
|
|||||||
#define coff_get_section_load_page bfd_ticoff_get_section_load_page
|
#define coff_get_section_load_page bfd_ticoff_get_section_load_page
|
||||||
#define coff_set_section_load_page bfd_ticoff_set_section_load_page
|
#define coff_set_section_load_page bfd_ticoff_set_section_load_page
|
||||||
|
|
||||||
void
|
void
|
||||||
bfd_ticoff_set_section_load_page (sect, page)
|
bfd_ticoff_set_section_load_page (sect, page)
|
||||||
asection *sect;
|
asection *sect;
|
||||||
int page;
|
int page;
|
||||||
@ -87,14 +87,13 @@ bfd_ticoff_set_section_load_page (sect, page)
|
|||||||
sect->lma = (sect->lma & ADDR_MASK) | PG_TO_FLAG(page);
|
sect->lma = (sect->lma & ADDR_MASK) | PG_TO_FLAG(page);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
int
|
int
|
||||||
bfd_ticoff_get_section_load_page (sect)
|
bfd_ticoff_get_section_load_page (sect)
|
||||||
asection *sect;
|
asection *sect;
|
||||||
{
|
{
|
||||||
int page;
|
int page;
|
||||||
|
|
||||||
/* Provide meaningful defaults for predefined sections. */
|
/* Provide meaningful defaults for predefined sections. */
|
||||||
if (sect == &bfd_com_section)
|
if (sect == &bfd_com_section)
|
||||||
page = PG_DATA;
|
page = PG_DATA;
|
||||||
|
|
||||||
@ -110,7 +109,7 @@ bfd_ticoff_get_section_load_page (sect)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Set the architecture appropriately. Allow unkown architectures
|
/* Set the architecture appropriately. Allow unkown architectures
|
||||||
(e.g. binary). */
|
(e.g. binary). */
|
||||||
static boolean
|
static boolean
|
||||||
tic54x_set_arch_mach (abfd, arch, machine)
|
tic54x_set_arch_mach (abfd, arch, machine)
|
||||||
bfd *abfd;
|
bfd *abfd;
|
||||||
@ -127,7 +126,7 @@ tic54x_set_arch_mach (abfd, arch, machine)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static bfd_reloc_status_type
|
static bfd_reloc_status_type
|
||||||
tic54x_relocation (abfd, reloc_entry, symbol, data, input_section,
|
tic54x_relocation (abfd, reloc_entry, symbol, data, input_section,
|
||||||
output_bfd, error_message)
|
output_bfd, error_message)
|
||||||
bfd *abfd ATTRIBUTE_UNUSED;
|
bfd *abfd ATTRIBUTE_UNUSED;
|
||||||
arelent *reloc_entry;
|
arelent *reloc_entry;
|
||||||
@ -137,7 +136,7 @@ tic54x_relocation (abfd, reloc_entry, symbol, data, input_section,
|
|||||||
bfd *output_bfd;
|
bfd *output_bfd;
|
||||||
char **error_message ATTRIBUTE_UNUSED;
|
char **error_message ATTRIBUTE_UNUSED;
|
||||||
{
|
{
|
||||||
|
|
||||||
if (output_bfd != (bfd *) NULL)
|
if (output_bfd != (bfd *) NULL)
|
||||||
{
|
{
|
||||||
/* This is a partial relocation, and we want to apply the
|
/* This is a partial relocation, and we want to apply the
|
||||||
@ -157,7 +156,7 @@ reloc_howto_type tic54x_howto_table[] =
|
|||||||
|
|
||||||
/* NORMAL BANK */
|
/* 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,
|
HOWTO (R_RELWORD,0,1,16,false,0,complain_overflow_dont,
|
||||||
tic54x_relocation,"REL16",false,0xFFFF,0xFFFF,false),
|
tic54x_relocation,"REL16",false,0xFFFF,0xFFFF,false),
|
||||||
|
|
||||||
/* 7 LSBs of an address */
|
/* 7 LSBs of an address */
|
||||||
@ -183,7 +182,7 @@ reloc_howto_type tic54x_howto_table[] =
|
|||||||
|
|
||||||
/* ABSOLUTE BANK */
|
/* ABSOLUTE BANK */
|
||||||
/* 16-bit direct reference to symbol's address, absolute */
|
/* 16-bit direct reference to symbol's address, absolute */
|
||||||
HOWTO (R_RELWORD,0,1,16,false,0,complain_overflow_dont,
|
HOWTO (R_RELWORD,0,1,16,false,0,complain_overflow_dont,
|
||||||
tic54x_relocation,"AREL16",false,0xFFFF,0xFFFF,false),
|
tic54x_relocation,"AREL16",false,0xFFFF,0xFFFF,false),
|
||||||
|
|
||||||
/* 7 LSBs of an address, absolute */
|
/* 7 LSBs of an address, absolute */
|
||||||
@ -243,7 +242,7 @@ tic54x_coff_reloc_type_lookup (abfd, code)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* 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.
|
||||||
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
|
static void
|
||||||
tic54x_lookup_howto (internal, dst)
|
tic54x_lookup_howto (internal, dst)
|
||||||
@ -263,7 +262,7 @@ tic54x_lookup_howto (internal, dst)
|
|||||||
|
|
||||||
(*_bfd_error_handler) (_("Unrecognized reloc type 0x%x"),
|
(*_bfd_error_handler) (_("Unrecognized reloc type 0x%x"),
|
||||||
(unsigned int) dst->r_type);
|
(unsigned int) dst->r_type);
|
||||||
abort();
|
abort ();
|
||||||
}
|
}
|
||||||
|
|
||||||
#define RELOC_PROCESSING(RELENT,RELOC,SYMS,ABFD,SECT)\
|
#define RELOC_PROCESSING(RELENT,RELOC,SYMS,ABFD,SECT)\
|
||||||
@ -288,7 +287,7 @@ coff_tic54x_rtype_to_howto (abfd, sec, rel, h, sym, addendp)
|
|||||||
{
|
{
|
||||||
/* This is a TI "internal relocation", which means that the relocation
|
/* This is a TI "internal relocation", which means that the relocation
|
||||||
amount is the amount by which the current section is being relocated
|
amount is the amount by which the current section is being relocated
|
||||||
in the output section. */
|
in the output section. */
|
||||||
*addendp = (sec->output_section->vma + sec->output_offset) - sec->vma;
|
*addendp = (sec->output_section->vma + sec->output_offset) - sec->vma;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -325,7 +324,7 @@ ticoff1_bad_format_hook (abfd, filehdr)
|
|||||||
|
|
||||||
/* replace the stock _bfd_coff_is_local_label_name to recognize TI COFF local
|
/* replace the stock _bfd_coff_is_local_label_name to recognize TI COFF local
|
||||||
labels */
|
labels */
|
||||||
static boolean
|
static boolean
|
||||||
ticoff_bfd_is_local_label_name (abfd, name)
|
ticoff_bfd_is_local_label_name (abfd, name)
|
||||||
bfd *abfd ATTRIBUTE_UNUSED;
|
bfd *abfd ATTRIBUTE_UNUSED;
|
||||||
const char *name;
|
const char *name;
|
||||||
@ -337,11 +336,11 @@ ticoff_bfd_is_local_label_name (abfd, name)
|
|||||||
|
|
||||||
#define coff_bfd_is_local_label_name ticoff_bfd_is_local_label_name
|
#define coff_bfd_is_local_label_name ticoff_bfd_is_local_label_name
|
||||||
|
|
||||||
/* Customize coffcode.h; the default coff_ functions are set up to use COFF2;
|
/* 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
|
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
|
and COFF0 vectors use custom _bad_format_hook procs instead of setting
|
||||||
BADMAG.
|
BADMAG.
|
||||||
*/
|
*/
|
||||||
#define BADMAG(x) COFF2_BADMAG(x)
|
#define BADMAG(x) COFF2_BADMAG(x)
|
||||||
#include "coffcode.h"
|
#include "coffcode.h"
|
||||||
|
|
||||||
@ -353,7 +352,7 @@ tic54x_set_section_contents (abfd, section, location, offset, bytes_to_do)
|
|||||||
file_ptr offset;
|
file_ptr offset;
|
||||||
bfd_size_type bytes_to_do;
|
bfd_size_type bytes_to_do;
|
||||||
{
|
{
|
||||||
return coff_set_section_contents (abfd, section, location,
|
return coff_set_section_contents (abfd, section, location,
|
||||||
offset, bytes_to_do);
|
offset, bytes_to_do);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -368,7 +367,7 @@ tic54x_reloc_processing (relent, reloc, symbols, abfd, section)
|
|||||||
asymbol *ptr;
|
asymbol *ptr;
|
||||||
|
|
||||||
relent->address = reloc->r_vaddr;
|
relent->address = reloc->r_vaddr;
|
||||||
|
|
||||||
if (reloc->r_symndx != -1)
|
if (reloc->r_symndx != -1)
|
||||||
{
|
{
|
||||||
if (reloc->r_symndx < 0 || reloc->r_symndx >= obj_conv_table_size (abfd))
|
if (reloc->r_symndx < 0 || reloc->r_symndx >= obj_conv_table_size (abfd))
|
||||||
@ -391,26 +390,26 @@ tic54x_reloc_processing (relent, reloc, symbols, abfd, section)
|
|||||||
relent->sym_ptr_ptr = section->symbol_ptr_ptr;
|
relent->sym_ptr_ptr = section->symbol_ptr_ptr;
|
||||||
ptr = *(relent->sym_ptr_ptr);
|
ptr = *(relent->sym_ptr_ptr);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* The symbols definitions that we have read in have been
|
/* The symbols definitions that we have read in have been
|
||||||
relocated as if their sections started at 0. But the offsets
|
relocated as if their sections started at 0. But the offsets
|
||||||
refering to the symbols in the raw data have not been
|
refering to the symbols in the raw data have not been
|
||||||
modified, so we have to have a negative addend to compensate.
|
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);
|
CALC_ADDEND (abfd, ptr, *reloc, relent);
|
||||||
|
|
||||||
relent->address -= section->vma;
|
relent->address -= section->vma;
|
||||||
/* !! relent->section = (asection *) NULL;*/
|
/* !! 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);
|
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 =
|
static CONST bfd_coff_backend_data ticoff0_swap_table =
|
||||||
{
|
{
|
||||||
coff_SWAP_aux_in, coff_SWAP_sym_in, coff_SWAP_lineno_in,
|
coff_SWAP_aux_in, coff_SWAP_sym_in, coff_SWAP_lineno_in,
|
||||||
coff_SWAP_aux_out, coff_SWAP_sym_out,
|
coff_SWAP_aux_out, coff_SWAP_sym_out,
|
||||||
@ -451,7 +450,7 @@ static CONST bfd_coff_backend_data ticoff0_swap_table =
|
|||||||
};
|
};
|
||||||
|
|
||||||
/* COFF1 differs in section header size */
|
/* COFF1 differs in section header size */
|
||||||
static CONST bfd_coff_backend_data ticoff1_swap_table =
|
static CONST bfd_coff_backend_data ticoff1_swap_table =
|
||||||
{
|
{
|
||||||
coff_SWAP_aux_in, coff_SWAP_sym_in, coff_SWAP_lineno_in,
|
coff_SWAP_aux_in, coff_SWAP_sym_in, coff_SWAP_lineno_in,
|
||||||
coff_SWAP_aux_out, coff_SWAP_sym_out,
|
coff_SWAP_aux_out, coff_SWAP_sym_out,
|
||||||
@ -491,7 +490,6 @@ static CONST bfd_coff_backend_data ticoff1_swap_table =
|
|||||||
coff_link_output_has_begun, coff_final_link_postscript
|
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 =
|
const bfd_target tic54x_coff0_vec =
|
||||||
{
|
{
|
||||||
|
@ -424,7 +424,7 @@ local16_reloc (abfd, reloc_entry, symbol_in, data, input_section, output_bfd,
|
|||||||
|
|
||||||
/* Code to turn an external r_type into a pointer to an entry in the howto_table.
|
/* Code to turn an external r_type into a pointer to an entry in the howto_table.
|
||||||
If passed an r_type we don't recognize the abort rather than silently failing
|
If passed an r_type we don't recognize the abort rather than silently failing
|
||||||
to generate an output file. */
|
to generate an output file. */
|
||||||
|
|
||||||
static void
|
static void
|
||||||
rtype2howto (cache_ptr, dst)
|
rtype2howto (cache_ptr, dst)
|
||||||
@ -465,7 +465,7 @@ coff_tic80_rtype_to_howto (abfd, sec, rel, h, sym, addendp)
|
|||||||
{
|
{
|
||||||
/* This is a TI "internal relocation", which means that the relocation
|
/* This is a TI "internal relocation", which means that the relocation
|
||||||
amount is the amount by which the current section is being relocated
|
amount is the amount by which the current section is being relocated
|
||||||
in the output section. */
|
in the output section. */
|
||||||
*addendp = (sec -> output_section -> vma + sec -> output_offset) - sec -> vma;
|
*addendp = (sec -> output_section -> vma + sec -> output_offset) - sec -> vma;
|
||||||
}
|
}
|
||||||
RTYPE2HOWTO (&genrel, rel);
|
RTYPE2HOWTO (&genrel, rel);
|
||||||
@ -518,7 +518,7 @@ coff_tic80_relocate_section (output_bfd, info, input_bfd,
|
|||||||
sym = NULL;
|
sym = NULL;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
h = obj_coff_sym_hashes (input_bfd)[symndx];
|
h = obj_coff_sym_hashes (input_bfd)[symndx];
|
||||||
sym = syms + symndx;
|
sym = syms + symndx;
|
||||||
}
|
}
|
||||||
@ -649,7 +649,7 @@ coff_tic80_relocate_section (output_bfd, info, input_bfd,
|
|||||||
contents[addr + 1] |= hold & 0x80;
|
contents[addr + 1] |= hold & 0x80;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
case R_PPBASE:
|
case R_PPBASE:
|
||||||
/* Parameter RAM is from 0x1000000 to 0x1000800. */
|
/* Parameter RAM is from 0x1000000 to 0x1000800. */
|
||||||
contents[addr] &=~ 0x3;
|
contents[addr] &=~ 0x3;
|
||||||
|
@ -42,7 +42,6 @@ static reloc_howto_type howto_table[] =
|
|||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
/* Turn a howto into a reloc number */
|
/* Turn a howto into a reloc number */
|
||||||
|
|
||||||
#define SELECT_RELOC(x,howto) \
|
#define SELECT_RELOC(x,howto) \
|
||||||
@ -52,7 +51,6 @@ static reloc_howto_type howto_table[] =
|
|||||||
#define W65 1 /* Customize coffcode.h */
|
#define W65 1 /* Customize coffcode.h */
|
||||||
#define __A_MAGIC_SET__
|
#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_IN_RELOC_OFFSET bfd_h_get_32
|
||||||
#define SWAP_OUT_RELOC_OFFSET bfd_h_put_32
|
#define SWAP_OUT_RELOC_OFFSET bfd_h_put_32
|
||||||
@ -60,7 +58,6 @@ static reloc_howto_type howto_table[] =
|
|||||||
dst->r_stuff[0] = 'S'; \
|
dst->r_stuff[0] = 'S'; \
|
||||||
dst->r_stuff[1] = 'C';
|
dst->r_stuff[1] = 'C';
|
||||||
|
|
||||||
|
|
||||||
static int
|
static int
|
||||||
select_reloc (howto)
|
select_reloc (howto)
|
||||||
reloc_howto_type *howto;
|
reloc_howto_type *howto;
|
||||||
@ -81,14 +78,11 @@ rtype2howto (internal, dst)
|
|||||||
|
|
||||||
#define RTYPE2HOWTO(internal, relocentry) rtype2howto(internal,relocentry)
|
#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) \
|
#define CALC_ADDEND(abfd, symbol, ext_reloc, cache_ptr) \
|
||||||
cache_ptr->addend = ext_reloc.r_offset;
|
cache_ptr->addend = ext_reloc.r_offset;
|
||||||
|
|
||||||
|
|
||||||
#define RELOC_PROCESSING(relent,reloc,symbols,abfd,section) \
|
#define RELOC_PROCESSING(relent,reloc,symbols,abfd,section) \
|
||||||
reloc_processing(relent, reloc, symbols, abfd, section)
|
reloc_processing(relent, reloc, symbols, abfd, section)
|
||||||
|
|
||||||
@ -112,15 +106,12 @@ reloc_processing (relent, reloc, symbols, abfd, section)
|
|||||||
relent->sym_ptr_ptr = (asymbol **)&(bfd_abs_symbol);
|
relent->sym_ptr_ptr = (asymbol **)&(bfd_abs_symbol);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
relent->addend = reloc->r_offset;
|
relent->addend = reloc->r_offset;
|
||||||
|
|
||||||
relent->address -= section->vma;
|
relent->address -= section->vma;
|
||||||
/* relent->section = 0;*/
|
/* relent->section = 0;*/
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static int
|
static int
|
||||||
h8300_reloc16_estimate(abfd, input_section, reloc, shrink, link_info)
|
h8300_reloc16_estimate(abfd, input_section, reloc, shrink, link_info)
|
||||||
bfd *abfd;
|
bfd *abfd;
|
||||||
@ -129,11 +120,11 @@ h8300_reloc16_estimate(abfd, input_section, reloc, shrink, link_info)
|
|||||||
unsigned int shrink;
|
unsigned int shrink;
|
||||||
struct bfd_link_info *link_info;
|
struct bfd_link_info *link_info;
|
||||||
{
|
{
|
||||||
bfd_vma value;
|
bfd_vma value;
|
||||||
bfd_vma dot;
|
bfd_vma dot;
|
||||||
bfd_vma gap;
|
bfd_vma gap;
|
||||||
|
|
||||||
/* The address of the thing to be relocated will have moved back by
|
/* 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,
|
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
|
since we need it to know where the relocation lives in the source
|
||||||
uncooked section */
|
uncooked section */
|
||||||
@ -141,10 +132,9 @@ h8300_reloc16_estimate(abfd, input_section, reloc, shrink, link_info)
|
|||||||
/* reloc->address -= shrink; conceptual */
|
/* reloc->address -= shrink; conceptual */
|
||||||
|
|
||||||
bfd_vma address = reloc->address - shrink;
|
bfd_vma address = reloc->address - shrink;
|
||||||
|
|
||||||
|
|
||||||
switch (reloc->howto->type)
|
switch (reloc->howto->type)
|
||||||
{
|
{
|
||||||
case R_MOV16B2:
|
case R_MOV16B2:
|
||||||
case R_JMP2:
|
case R_JMP2:
|
||||||
shrink+=2;
|
shrink+=2;
|
||||||
@ -155,40 +145,40 @@ h8300_reloc16_estimate(abfd, input_section, reloc, shrink, link_info)
|
|||||||
value = bfd_coff_reloc16_get_value(reloc, link_info, input_section);
|
value = bfd_coff_reloc16_get_value(reloc, link_info, input_section);
|
||||||
|
|
||||||
if (value >= 0xff00)
|
if (value >= 0xff00)
|
||||||
{
|
{
|
||||||
|
|
||||||
/* Change the reloc type from 16bit, possible 8 to 8bit
|
/* Change the reloc type from 16bit, possible 8 to 8bit
|
||||||
possible 16 */
|
possible 16 */
|
||||||
reloc->howto = reloc->howto + 1;
|
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 ;
|
shrink +=2 ;
|
||||||
bfd_perform_slip(abfd, 2, input_section, address);
|
bfd_perform_slip(abfd, 2, input_section, address);
|
||||||
}
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
/* This is the 24 bit branch which could become an 8 bitter,
|
/* This is the 24 bit branch which could become an 8 bitter,
|
||||||
the relocation points to the first byte of the insn, not the
|
the relocation points to the first byte of the insn, not the
|
||||||
actual data */
|
actual data */
|
||||||
|
|
||||||
case R_JMPL1:
|
case R_JMPL1:
|
||||||
value = bfd_coff_reloc16_get_value(reloc, link_info, input_section);
|
value = bfd_coff_reloc16_get_value(reloc, link_info, input_section);
|
||||||
|
|
||||||
dot = input_section->output_section->vma +
|
dot = input_section->output_section->vma +
|
||||||
input_section->output_offset + address;
|
input_section->output_offset + address;
|
||||||
|
|
||||||
/* See if the address we're looking at within 127 bytes of where
|
/* 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
|
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 ;
|
gap = value - dot ;
|
||||||
|
|
||||||
if (-120 < (long)gap && (long)gap < 120 )
|
if (-120 < (long)gap && (long)gap < 120 )
|
||||||
{
|
{
|
||||||
|
|
||||||
/* Change the reloc type from 24bit, possible 8 to 8bit
|
/* Change the reloc type from 24bit, possible 8 to 8bit
|
||||||
possible 32 */
|
possible 32 */
|
||||||
reloc->howto = reloc->howto + 1;
|
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 ;
|
shrink +=2 ;
|
||||||
bfd_perform_slip(abfd, 2, input_section, address);
|
bfd_perform_slip(abfd, 2, input_section, address);
|
||||||
@ -198,23 +188,22 @@ h8300_reloc16_estimate(abfd, input_section, reloc, shrink, link_info)
|
|||||||
case R_JMP1:
|
case R_JMP1:
|
||||||
|
|
||||||
value = bfd_coff_reloc16_get_value(reloc, link_info, input_section);
|
value = bfd_coff_reloc16_get_value(reloc, link_info, input_section);
|
||||||
|
|
||||||
dot = input_section->output_section->vma +
|
dot = input_section->output_section->vma +
|
||||||
input_section->output_offset + address;
|
input_section->output_offset + address;
|
||||||
|
|
||||||
/* See if the address we're looking at within 127 bytes of where
|
/* 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
|
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);
|
gap = value - (dot - shrink);
|
||||||
|
|
||||||
|
|
||||||
if (-120 < (long)gap && (long)gap < 120 )
|
if (-120 < (long)gap && (long)gap < 120 )
|
||||||
{
|
{
|
||||||
|
|
||||||
/* Change the reloc type from 16bit, possible 8 to 8bit
|
/* Change the reloc type from 16bit, possible 8 to 8bit
|
||||||
possible 16 */
|
possible 16 */
|
||||||
reloc->howto = reloc->howto + 1;
|
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 */
|
||||||
@ -224,11 +213,9 @@ h8300_reloc16_estimate(abfd, input_section, reloc, shrink, link_info)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
return shrink;
|
return shrink;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/* First phase of a relaxing link */
|
/* First phase of a relaxing link */
|
||||||
|
|
||||||
/* Reloc types
|
/* Reloc types
|
||||||
@ -336,8 +323,8 @@ h8300_reloc16_extra_cases (abfd, link_info, link_order, reloc, data, src_ptr,
|
|||||||
{
|
{
|
||||||
int gap = bfd_coff_reloc16_get_value (reloc, link_info,
|
int gap = bfd_coff_reloc16_get_value (reloc, link_info,
|
||||||
input_section);
|
input_section);
|
||||||
bfd_vma dot = link_order->offset
|
bfd_vma dot = link_order->offset
|
||||||
+ dst_address
|
+ dst_address
|
||||||
+ link_order->u.indirect.section->output_section->vma;
|
+ link_order->u.indirect.section->output_section->vma;
|
||||||
|
|
||||||
gap -= dot + 1;
|
gap -= dot + 1;
|
||||||
@ -346,7 +333,7 @@ h8300_reloc16_extra_cases (abfd, link_info, link_order, reloc, data, src_ptr,
|
|||||||
(link_info, bfd_asymbol_name (*reloc->sym_ptr_ptr),
|
(link_info, bfd_asymbol_name (*reloc->sym_ptr_ptr),
|
||||||
reloc->howto->name, reloc->addend, input_section->owner,
|
reloc->howto->name, reloc->addend, input_section->owner,
|
||||||
input_section, reloc->address)))
|
input_section, reloc->address)))
|
||||||
abort();
|
abort ();
|
||||||
}
|
}
|
||||||
bfd_put_8 (abfd, gap, data + dst_address);
|
bfd_put_8 (abfd, gap, data + dst_address);
|
||||||
dst_address += 1;
|
dst_address += 1;
|
||||||
@ -358,11 +345,10 @@ h8300_reloc16_extra_cases (abfd, link_info, link_order, reloc, data, src_ptr,
|
|||||||
{
|
{
|
||||||
bfd_vma gap = bfd_coff_reloc16_get_value (reloc, link_info,
|
bfd_vma gap = bfd_coff_reloc16_get_value (reloc, link_info,
|
||||||
input_section);
|
input_section);
|
||||||
bfd_vma dot = link_order->offset
|
bfd_vma dot = link_order->offset
|
||||||
+ dst_address
|
+ dst_address
|
||||||
+ link_order->u.indirect.section->output_section->vma;
|
+ link_order->u.indirect.section->output_section->vma;
|
||||||
|
|
||||||
|
|
||||||
/* This wraps within the page, so ignore the relativeness, look at the
|
/* This wraps within the page, so ignore the relativeness, look at the
|
||||||
high part */
|
high part */
|
||||||
if ((gap & 0xf0000) != (dot & 0xf0000)) {
|
if ((gap & 0xf0000) != (dot & 0xf0000)) {
|
||||||
@ -370,7 +356,7 @@ h8300_reloc16_extra_cases (abfd, link_info, link_order, reloc, data, src_ptr,
|
|||||||
(link_info, bfd_asymbol_name (*reloc->sym_ptr_ptr),
|
(link_info, bfd_asymbol_name (*reloc->sym_ptr_ptr),
|
||||||
reloc->howto->name, reloc->addend, input_section->owner,
|
reloc->howto->name, reloc->addend, input_section->owner,
|
||||||
input_section, reloc->address)))
|
input_section, reloc->address)))
|
||||||
abort();
|
abort ();
|
||||||
}
|
}
|
||||||
|
|
||||||
gap -= dot + 2;
|
gap -= dot + 2;
|
||||||
@ -394,7 +380,6 @@ h8300_reloc16_extra_cases (abfd, link_info, link_order, reloc, data, src_ptr,
|
|||||||
|
|
||||||
#include "coffcode.h"
|
#include "coffcode.h"
|
||||||
|
|
||||||
|
|
||||||
#undef coff_bfd_get_relocated_section_contents
|
#undef coff_bfd_get_relocated_section_contents
|
||||||
#undef coff_bfd_relax_section
|
#undef coff_bfd_relax_section
|
||||||
#define coff_bfd_get_relocated_section_contents \
|
#define coff_bfd_get_relocated_section_contents \
|
||||||
|
@ -27,7 +27,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
|
|||||||
|
|
||||||
#define COFF_DEFAULT_SECTION_ALIGNMENT_POWER (3)
|
#define COFF_DEFAULT_SECTION_ALIGNMENT_POWER (3)
|
||||||
|
|
||||||
static reloc_howto_type howto_table[] =
|
static reloc_howto_type howto_table[] =
|
||||||
{
|
{
|
||||||
EMPTY_HOWTO (0),
|
EMPTY_HOWTO (0),
|
||||||
EMPTY_HOWTO (1),
|
EMPTY_HOWTO (1),
|
||||||
|
@ -54,7 +54,7 @@ HOWTO (R_JR, 0, 1, 8, true, 0, complain_overflow_signed, 0,
|
|||||||
|
|
||||||
/* Turn a howto into a reloc number */
|
/* Turn a howto into a reloc number */
|
||||||
|
|
||||||
static int
|
static int
|
||||||
coff_z8k_select_reloc (howto)
|
coff_z8k_select_reloc (howto)
|
||||||
reloc_howto_type *howto;
|
reloc_howto_type *howto;
|
||||||
{
|
{
|
||||||
@ -63,13 +63,10 @@ coff_z8k_select_reloc (howto)
|
|||||||
|
|
||||||
#define SELECT_RELOC(x,howto) x.r_type = coff_z8k_select_reloc(howto)
|
#define SELECT_RELOC(x,howto) x.r_type = coff_z8k_select_reloc(howto)
|
||||||
|
|
||||||
|
|
||||||
#define BADMAG(x) Z8KBADMAG(x)
|
#define BADMAG(x) Z8KBADMAG(x)
|
||||||
#define Z8K 1 /* Customize coffcode.h */
|
#define Z8K 1 /* Customize coffcode.h */
|
||||||
#define __A_MAGIC_SET__
|
#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_IN_RELOC_OFFSET bfd_h_get_32
|
||||||
#define SWAP_OUT_RELOC_OFFSET bfd_h_put_32
|
#define SWAP_OUT_RELOC_OFFSET bfd_h_put_32
|
||||||
@ -110,18 +107,15 @@ rtype2howto (internal, dst)
|
|||||||
|
|
||||||
#define RTYPE2HOWTO(internal, relocentry) rtype2howto(internal,relocentry)
|
#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) \
|
#define CALC_ADDEND(abfd, symbol, ext_reloc, cache_ptr) \
|
||||||
cache_ptr->addend = ext_reloc.r_offset;
|
cache_ptr->addend = ext_reloc.r_offset;
|
||||||
|
|
||||||
|
|
||||||
#define RELOC_PROCESSING(relent,reloc,symbols,abfd,section) \
|
#define RELOC_PROCESSING(relent,reloc,symbols,abfd,section) \
|
||||||
reloc_processing(relent, reloc, symbols, abfd, section)
|
reloc_processing(relent, reloc, symbols, abfd, section)
|
||||||
|
|
||||||
static void
|
static void
|
||||||
reloc_processing (relent, reloc, symbols, abfd, section)
|
reloc_processing (relent, reloc, symbols, abfd, section)
|
||||||
arelent * relent;
|
arelent * relent;
|
||||||
struct internal_reloc *reloc;
|
struct internal_reloc *reloc;
|
||||||
@ -141,7 +135,6 @@ reloc_processing (relent, reloc, symbols, abfd, section)
|
|||||||
relent->sym_ptr_ptr = bfd_abs_section_ptr->symbol_ptr_ptr;
|
relent->sym_ptr_ptr = bfd_abs_section_ptr->symbol_ptr_ptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
relent->addend = reloc->r_offset;
|
relent->addend = reloc->r_offset;
|
||||||
relent->address -= section->vma;
|
relent->address -= section->vma;
|
||||||
}
|
}
|
||||||
@ -178,7 +171,7 @@ extra_case (in_abfd, link_info, link_order, reloc, data, src_ptr, dst_ptr)
|
|||||||
|
|
||||||
case R_IMM4L:
|
case R_IMM4L:
|
||||||
bfd_put_8 (in_abfd,
|
bfd_put_8 (in_abfd,
|
||||||
((bfd_get_8 (in_abfd, data + *dst_ptr) & 0xf0)
|
((bfd_get_8 (in_abfd, data + *dst_ptr) & 0xf0)
|
||||||
| (0x0f
|
| (0x0f
|
||||||
& bfd_coff_reloc16_get_value (reloc, link_info,
|
& bfd_coff_reloc16_get_value (reloc, link_info,
|
||||||
input_section))),
|
input_section))),
|
||||||
@ -230,7 +223,6 @@ extra_case (in_abfd, link_info, link_order, reloc, data, src_ptr, dst_ptr)
|
|||||||
|
|
||||||
#include "coffcode.h"
|
#include "coffcode.h"
|
||||||
|
|
||||||
|
|
||||||
#undef coff_bfd_get_relocated_section_contents
|
#undef coff_bfd_get_relocated_section_contents
|
||||||
#undef coff_bfd_relax_section
|
#undef coff_bfd_relax_section
|
||||||
#define coff_bfd_get_relocated_section_contents \
|
#define coff_bfd_get_relocated_section_contents \
|
||||||
|
Reference in New Issue
Block a user