[PATCH 2/2] coff-go32: support extended relocations
Nick Clifton
nickc@redhat.com
Thu Apr 9 09:49:53 GMT 2020
Hi Jan,
> coffswap.h: (coff_swap_scnhdr_in, coff_swap_scnhdr_out): Allow
> overriding these functions with macros of the same name.
[...]
> +#ifndef coff_swap_scnhdr_in
> static void
> coff_swap_scnhdr_in (bfd * abfd, void * ext, void * in)
This breaks build any other COFF based target. They all define coff_swap_scnhdr_in
and coff_swap_scnhdr_out to be target specific names, but they use the generic code.
Eg bfd/alpha-coff.c (lines 86 and 87):
#define coff_swap_scnhdr_in alpha_ecoff_swap_scnhdr_in
#define coff_swap_scnhdr_out alpha_ecoff_swap_scnhdr_out
I believe that this is done so that if the binutils are configured to support multiple
coff targets they will each have their own versions of the coff_swap_scnhdr_[in|out]
functions. (Which makes sense given that the functions use macros which can be target
specific).
I think that what you need to do is to change these defines (in coff-go32.c and coff-stgo32.c):
#define coff_swap_scnhdr_in _bfd_go32_swap_scnhdr_in
#define coff_swap_scnhdr_out _bfd_go32_swap_scnhdr_out
to:
#define coff_SWAP_scnhdr_in _bfd_go32_swap_scnhdr_in
#define coff_SWAP_scnhdr_out _bfd_go32_swap_scnhdr_out
which will then ensure that the correct routines are referenced in the bfd_coff_std_swap_table
defined in coffcode.h.
Please could you check this and make sure that it does work ?
Secondly, once that is done, please could you check that a toolchain configured as:
--enable-targets=all
will build ? That way you can be sure that the alpha and mips coff targets also work.
Cheers
Nick
More information about the Binutils
mailing list