From 8c11394ac605d5e4adaf6755b239dcee7629c889 Mon Sep 17 00:00:00 2001 From: Nick Clifton Date: Thu, 26 Mar 1998 18:16:23 +0000 Subject: [PATCH] Remove (most of the) target dependent code from peicode.h --- bfd/ChangeLog | 10 ++++++++++ bfd/peicode.h | 46 +++++++++++++++++++++++++++++++++------------- 2 files changed, 43 insertions(+), 13 deletions(-) diff --git a/bfd/ChangeLog b/bfd/ChangeLog index b454bd70edd..514eb4f9583 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,3 +1,13 @@ +Thu Mar 26 10:13:41 1998 Nick Clifton + + * peicode.h: Chain together calls to + coff_bfd_copy_private_bfd_data and + coff_bfd_print_private_bfd_data. + + * coff-arm.c: Add prototypes for + coff_arm_bfd_print_private_bfd_data and + coff_arm_bfd_copy_private_bfd_data. + Wed Mar 25 15:45:55 1998 Nick Clifton * coffcode.h (coff_mkobject_hook): Set private falgs even for a PE diff --git a/bfd/peicode.h b/bfd/peicode.h index 90260668eac..d6b5944d93b 100644 --- a/bfd/peicode.h +++ b/bfd/peicode.h @@ -52,9 +52,15 @@ Most of this hacked by Steve Chamberlain, wasting too much time. */ -#undef coff_bfd_print_private_bfd_data +#ifdef coff_bfd_print_private_bfd_data +static boolean (* pe_saved_coff_bfd_print_private_bfd_data) (bfd *, PTR) = coff_bfd_print_private_bfd_data; +#undef coff_bfd_print_private_bfd_data +#else +static boolean (* pe_saved_coff_bfd_print_private_bfd_data) (bfd *, PTR) = NULL; +#endif #define coff_bfd_print_private_bfd_data pe_print_private_bfd_data -#define coff_mkobject pe_mkobject + +#define coff_mkobject pe_mkobject #define coff_mkobject_hook pe_mkobject_hook #ifndef GET_FCN_LNNOPTR @@ -1966,13 +1972,19 @@ pe_print_private_bfd_data (abfd, vfile) fprintf (file, "%s\n", dir_names[j]); } - pe_print_idata(abfd, vfile); - pe_print_edata(abfd, vfile); - pe_print_pdata(abfd, vfile); - pe_print_reloc(abfd, vfile); + pe_print_idata (abfd, vfile); + pe_print_edata (abfd, vfile); + pe_print_pdata (abfd, vfile); + pe_print_reloc (abfd, vfile); + + if (pe_saved_coff_bfd_print_private_bfd_data != NULL) + { + fputc ('\n', file); + + return pe_saved_bfd_print_private_bfd_data (abfd, vfile); + } - fputc ('\n', file); - return coff_arm_bfd_print_private_bfd_data (abfd, vfile); + return true; } static boolean @@ -2030,13 +2042,13 @@ pe_mkobject_hook (abfd, filehdr, aouthdr) #ifdef COFF_IMAGE_WITH_PE if (aouthdr) - { - pe->pe_opthdr = ((struct internal_aouthdr *)aouthdr)->pe; - } + pe->pe_opthdr = ((struct internal_aouthdr *)aouthdr)->pe; #endif +#ifdef ARM if (! coff_arm_bfd_set_private_flags (abfd, internal_f->f_flags)) coff_data (abfd) ->flags = 0; +#endif return (PTR) pe; } @@ -2046,7 +2058,12 @@ pe_mkobject_hook (abfd, filehdr, aouthdr) /* Copy any private info we understand from the input bfd to the output bfd. */ -#undef coff_bfd_copy_private_bfd_data +#ifdef coff_bfd_copy_private_bfd_data +static boolean (* pe_saved_coff_bfd_copy_private_bfd_data)(bfd *, bfd *) = coff_bfd_copy_private_bfd_data; +#undef coff_bfd_copy_private_bfd_data +#else +static boolean (* pe_saved_coff_bfd_copy_private_bfd_data)(bfd *, bfd *) = NULL; +#endif #define coff_bfd_copy_private_bfd_data pe_bfd_copy_private_bfd_data static boolean @@ -2061,7 +2078,10 @@ pe_bfd_copy_private_bfd_data (ibfd, obfd) pe_data (obfd)->pe_opthdr = pe_data (ibfd)->pe_opthdr; pe_data (obfd)->dll = pe_data (ibfd)->dll; - return coff_arm_bfd_copy_private_bfd_data (ibfd, obfd); + if (pe_saved_coff_bfd_copy_private_bfd_data) + return pe_saved_coff_bfd_copy_private_bfd_data (ibfd, obfd); + + return true; } #ifdef COFF_IMAGE_WITH_PE -- 2.30.2