* aoutx.h (NAME(aout,reloc_type_lookup)): Add BFD_RELOC_8 and

BFD_RELOC_16 to switch for extended relocs.
	(MY_swap_ext_reloc_in): New.
	(MY_swap_ext_reloc_out): New.
	(NAME(aout,slurp_reloc_table)): Use MY_swap_ext_reloc_in rather
	than NAME(aout,swap_ext_reloc_in) for extended relocs.
	(NAME(aout,squirt_out_relocs)): Similarly use
	MY_swap_ext_reloc_out.
	(aout_link_reloc_link_order): Use MY_put_ext_reloc if defined.
This commit is contained in:
Hans-Peter Nilsson
2000-04-03 11:44:45 +00:00
parent 1ce6d55a69
commit 1642229ef3
2 changed files with 31 additions and 3 deletions

@ -1,3 +1,15 @@
Mon Apr 3 13:37:15 2000 Hans-Peter Nilsson <hp@axis.com>
* aoutx.h (NAME(aout,reloc_type_lookup)): Add BFD_RELOC_8 and
BFD_RELOC_16 to switch for extended relocs.
(MY_swap_ext_reloc_in): New.
(MY_swap_ext_reloc_out): New.
(NAME(aout,slurp_reloc_table)): Use MY_swap_ext_reloc_in rather
than NAME(aout,swap_ext_reloc_in) for extended relocs.
(NAME(aout,squirt_out_relocs)): Similarly use
MY_swap_ext_reloc_out.
(aout_link_reloc_link_order): Use MY_put_ext_reloc if defined.
2000-04-03 Kazu Hirata <kazu@hxi.com> 2000-04-03 Kazu Hirata <kazu@hxi.com>
* coff-h8300.c (h8300_reloc16_extra_cases): Add bsr:16 -> bsr:8 to * coff-h8300.c (h8300_reloc16_extra_cases): Add bsr:16 -> bsr:8 to

@ -165,10 +165,18 @@ DESCRIPTION
#define MY_swap_std_reloc_in NAME(aout,swap_std_reloc_in) #define MY_swap_std_reloc_in NAME(aout,swap_std_reloc_in)
#endif #endif
#ifndef MY_swap_ext_reloc_in
#define MY_swap_ext_reloc_in NAME(aout,swap_ext_reloc_in)
#endif
#ifndef MY_swap_std_reloc_out #ifndef MY_swap_std_reloc_out
#define MY_swap_std_reloc_out NAME(aout,swap_std_reloc_out) #define MY_swap_std_reloc_out NAME(aout,swap_std_reloc_out)
#endif #endif
#ifndef MY_swap_ext_reloc_out
#define MY_swap_ext_reloc_out NAME(aout,swap_ext_reloc_out)
#endif
#ifndef MY_final_link_relocate #ifndef MY_final_link_relocate
#define MY_final_link_relocate _bfd_final_link_relocate #define MY_final_link_relocate _bfd_final_link_relocate
#endif #endif
@ -283,6 +291,8 @@ NAME(aout,reloc_type_lookup) (abfd,code)
if (ext) if (ext)
switch (code) switch (code)
{ {
EXT (BFD_RELOC_8, 0);
EXT (BFD_RELOC_16, 1);
EXT (BFD_RELOC_32, 2); EXT (BFD_RELOC_32, 2);
EXT (BFD_RELOC_HI22, 8); EXT (BFD_RELOC_HI22, 8);
EXT (BFD_RELOC_LO10, 11); EXT (BFD_RELOC_LO10, 11);
@ -2381,8 +2391,8 @@ NAME(aout,slurp_reloc_table) (abfd, asect, symbols)
(struct reloc_ext_external *) relocs; (struct reloc_ext_external *) relocs;
for (; counter < count; counter++, rptr++, cache_ptr++) for (; counter < count; counter++, rptr++, cache_ptr++)
NAME(aout,swap_ext_reloc_in) (abfd, rptr, cache_ptr, symbols, MY_swap_ext_reloc_in (abfd, rptr, cache_ptr, symbols,
bfd_get_symcount (abfd)); bfd_get_symcount (abfd));
} }
else else
{ {
@ -2432,7 +2442,8 @@ NAME(aout,squirt_out_relocs) (abfd, section)
for (natptr = native; for (natptr = native;
count != 0; count != 0;
--count, natptr += each_size, ++generic) --count, natptr += each_size, ++generic)
NAME(aout,swap_ext_reloc_out) (abfd, *generic, (struct reloc_ext_external *)natptr); MY_swap_ext_reloc_out (abfd, *generic,
(struct reloc_ext_external *) natptr);
} }
else else
{ {
@ -5671,6 +5682,10 @@ aout_link_reloc_link_order (finfo, o, p)
} }
else else
{ {
#ifdef MY_put_ext_reloc
MY_put_ext_reloc (finfo->output_bfd, r_extern, r_index, p->offset,
howto, &erel, pr->addend);
#else
PUT_WORD (finfo->output_bfd, p->offset, erel.r_address); PUT_WORD (finfo->output_bfd, p->offset, erel.r_address);
if (bfd_header_big_endian (finfo->output_bfd)) if (bfd_header_big_endian (finfo->output_bfd))
@ -5693,6 +5708,7 @@ aout_link_reloc_link_order (finfo, o, p)
} }
PUT_WORD (finfo->output_bfd, pr->addend, erel.r_addend); PUT_WORD (finfo->output_bfd, pr->addend, erel.r_addend);
#endif /* MY_put_ext_reloc */
rel_ptr = (PTR) &erel; rel_ptr = (PTR) &erel;
} }