This is the mail archive of the
binutils@sourceware.cygnus.com
mailing list for the binutils project.
Patch to bfd/aoutx.h to parametrize use of swap_ext_reloc_in, swap_ext_reloc_out
- To: binutils at sourceware dot cygnus dot com
- Subject: Patch to bfd/aoutx.h to parametrize use of swap_ext_reloc_in, swap_ext_reloc_out
- From: Hans-Peter Nilsson <hans-peter dot nilsson at axis dot com>
- Date: Fri, 10 Mar 2000 23:47:32 +0100
This patch lets the target override the default swap_ext_reloc_in,
swap_ext_reloc_out and put_reloc code, just as can be done with
std relocs.
I also took the liberty (gasp!) to tweak spacing for the
MY_swap_std_mumble macros to GNU standard. They just stood too
close. :-)
Fri Mar 10 23:28:31 2000 Hans-Peter Nilsson <hp@axis.se>
* aoutx.h (MY_swap_std_reloc_in): GNUify spacing.
(MY_swap_ext_reloc_in): New.
(MY_swap_std_reloc_out): GNUify spacing.
(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.
Index: bfd/aoutx.h
===================================================================
RCS file: /cvs/src/src/bfd/aoutx.h,v
retrieving revision 1.4
diff -c -p -r1.4 aoutx.h
*** aoutx.h 2000/03/01 19:40:53 1.4
--- aoutx.h 2000/03/10 22:09:35
*************** DESCRIPTION
*** 162,172 ****
#endif
#ifndef MY_swap_std_reloc_in
! #define MY_swap_std_reloc_in NAME(aout,swap_std_reloc_in)
#endif
#ifndef MY_swap_std_reloc_out
! #define MY_swap_std_reloc_out NAME(aout,swap_std_reloc_out)
#endif
#ifndef MY_final_link_relocate
--- 162,180 ----
#endif
#ifndef MY_swap_std_reloc_in
! #define MY_swap_std_reloc_in NAME (aout, swap_std_reloc_in)
#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
! #define MY_swap_std_reloc_out NAME (aout, swap_std_reloc_out)
! #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
*************** NAME(aout,slurp_reloc_table) (abfd, asec
*** 2381,2388 ****
(struct reloc_ext_external *) relocs;
for (; counter < count; counter++, rptr++, cache_ptr++)
! NAME(aout,swap_ext_reloc_in) (abfd, rptr, cache_ptr, symbols,
! bfd_get_symcount (abfd));
}
else
{
--- 2395,2402 ----
(struct reloc_ext_external *) relocs;
for (; counter < count; counter++, rptr++, cache_ptr++)
! MY_swap_ext_reloc_in (abfd, rptr, cache_ptr, symbols,
! bfd_get_symcount (abfd));
}
else
{
*************** NAME(aout,squirt_out_relocs) (abfd, sect
*** 2432,2438 ****
for (natptr = native;
count != 0;
--count, natptr += each_size, ++generic)
! NAME(aout,swap_ext_reloc_out) (abfd, *generic, (struct reloc_ext_external *)natptr);
}
else
{
--- 2446,2453 ----
for (natptr = native;
count != 0;
--count, natptr += each_size, ++generic)
! MY_swap_ext_reloc_out (abfd, *generic,
! (struct reloc_ext_external *) natptr);
}
else
{
*************** aout_link_reloc_link_order (finfo, o, p)
*** 5671,5676 ****
--- 5686,5695 ----
}
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);
if (bfd_header_big_endian (finfo->output_bfd))
*************** aout_link_reloc_link_order (finfo, o, p)
*** 5693,5698 ****
--- 5712,5718 ----
}
PUT_WORD (finfo->output_bfd, pr->addend, erel.r_addend);
+ #endif /* MY_put_ext_reloc */
rel_ptr = (PTR) &erel;
}
brgds, H-P