From f135c692723ff3b1513345b1379fcfa0b7e40239 Mon Sep 17 00:00:00 2001 From: Ian Lance Taylor Date: Tue, 7 Mar 1995 19:56:31 +0000 Subject: * coffcode.h (bfd_coff_backend_data): Add new field _bfd_coff_adjust_symndx. (bfd_coff_adjust_symndx): Define. (coff_adjust_symndx): Define as NULL if not already defined. (bfd_coff_std_swap_table): Initialize new field to coff_adjust_symndx. * cofflink.c (coff_link_input_bfd): Call coff_adjust_symndx if it is defined. * coff-a29k.c (coff_a29k_adjust_symndx): New static function. (coff_adjust_symndx): Define before including coffcode.h. * libcoff.h: Rebuild. --- bfd/coff-a29k.c | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) (limited to 'bfd/coff-a29k.c') diff --git a/bfd/coff-a29k.c b/bfd/coff-a29k.c index 35c748a..db29499 100644 --- a/bfd/coff-a29k.c +++ b/bfd/coff-a29k.c @@ -34,6 +34,9 @@ static bfd_reloc_status_type a29k_reloc static boolean coff_a29k_relocate_section PARAMS ((bfd *, struct bfd_link_info *, bfd *, asection *, bfd_byte *, struct internal_reloc *, struct internal_syment *, asection **)); +static boolean coff_a29k_adjust_symndx + PARAMS ((bfd *, struct bfd_link_info *, bfd *, asection *, + struct internal_reloc *, boolean *)); #define COFF_DEFAULT_SECTION_ALIGNMENT_POWER (2) @@ -537,6 +540,28 @@ coff_a29k_relocate_section (output_bfd, info, input_bfd, input_section, #define coff_relocate_section coff_a29k_relocate_section +/* We don't want to change the symndx of a R_IHCONST reloc, since it + is actually an addend, not a symbol index at all. */ + +/*ARGSUSED*/ +static boolean +coff_a29k_adjust_symndx (obfd, info, ibfd, sec, irel, adjustedp) + bfd *obfd; + struct bfd_link_info *info; + bfd *ibfd; + asection *sec; + struct internal_reloc *irel; + boolean *adjustedp; +{ + if (irel->r_type == R_IHCONST) + *adjustedp = true; + else + *adjustedp = false; + return true; +} + +#define coff_adjust_symndx coff_a29k_adjust_symndx + #include "coffcode.h" const bfd_target a29kcoff_big_vec = -- cgit v1.1