This is the mail archive of the binutils@sourceware.cygnus.com mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

An xcoff cleanup


bfd/coff-pmac.c was including coff-rs6000.c directly, which doesn't work now
that the latter had global functions.

So I created xcoff.h, which has all the various defines and externs that are
common to coff-pmac.c, coff-rs6000.c, and coff64-rs6000.c.  This also gets rid
of some duplicate code in coff{64?}-rs6000.c

This patch is mostly just shuffling things around.  It also adds coff64-rs6000
to BFD64_BACKENDS, as I had forgotten that in my previous patch.

With this, --enable-targets=all --enable-64-bit-bfd builds except for ia64.

OK?

			-Clint


Fri Apr 28 10:05:41 2000  Clinton Popetz  <cpopetz@cygnus.com>

	* Makefile.am (BFD64_BACKENDS, BFD64_BACKENDS_CFILES): Add
	coff64-rs6000.{lo,c}.
	(coff-pmac.lo, coff-rs6000.lo, coff64-rs6000.lo): Add dependency
	on xcoff.h
	* Makefile.in: Regenerate.
	* xcoff.h: New file.
	* coff-pmac.c: Use xcoff.h instead of coff-rs6000.c.
	* coff-rs6000.c: Move all declarations and defines that are
	common to the xcoff backends into xcoff.h
	* coff64-rs6000.c: Ditto, 	


Index: Makefile.in
===================================================================
RCS file: /cvs/src/src/bfd/Makefile.in,v
retrieving revision 1.27
diff -c -2 -p -r1.27 Makefile.in
*** Makefile.in	2000/04/26 15:09:42	1.27
--- Makefile.in	2000/04/28 15:25:22
*************** BFD64_BACKENDS = \
*** 508,511 ****
--- 508,512 ----
  	coff-alpha.lo \
  	coff-ia64.lo \
+ 	coff64-rs6000.lo \
  	demo64.lo \
  	elf64-alpha.lo \
*************** BFD64_BACKENDS_CFILES = \
*** 524,527 ****
--- 525,529 ----
  	coff-alpha.c \
  	coff-ia64.c \
+ 	coff64-rs6000.c \
  	demo64.c \
  	elf64-alpha.c \
*************** coff-mips.lo: coff-mips.c $(INCDIR)/bfdl
*** 1341,1351 ****
    $(INCDIR)/coff/mips.h libcoff.h libecoff.h coffswap.h \
    ecoffswap.h
! coff-pmac.lo: coff-pmac.c coff-rs6000.c $(INCDIR)/coff/internal.h \
    $(INCDIR)/coff/rs6000.h libcoff.h $(INCDIR)/bfdlink.h \
    coffcode.h coffswap.h
! coff-rs6000.lo: coff-rs6000.c $(INCDIR)/coff/internal.h \
    $(INCDIR)/coff/rs6000.h libcoff.h $(INCDIR)/bfdlink.h \
    coffcode.h coffswap.h
! coff64-rs6000.lo: coff64-rs6000.c coff-rs6000.c $(INCDIR)/coff/internal.h \
    $(INCDIR)/coff/rs6000.h libcoff.h $(INCDIR)/bfdlink.h \
    coffcode.h coffswap.h
--- 1343,1354 ----
    $(INCDIR)/coff/mips.h libcoff.h libecoff.h coffswap.h \
    ecoffswap.h
! coff-pmac.lo: coff-pmac.c coff-rs6000.c xcoff.h $(INCDIR)/coff/internal.h \
    $(INCDIR)/coff/rs6000.h libcoff.h $(INCDIR)/bfdlink.h \
    coffcode.h coffswap.h
! coff-rs6000.lo: coff-rs6000.c xcoff.h $(INCDIR)/coff/internal.h \
    $(INCDIR)/coff/rs6000.h libcoff.h $(INCDIR)/bfdlink.h \
    coffcode.h coffswap.h
! coff64-rs6000.lo: coff64-rs6000.c coff-rs6000.c xcoff.h \
!   $(INCDIR)/coff/internal.h \
    $(INCDIR)/coff/rs6000.h libcoff.h $(INCDIR)/bfdlink.h \
    coffcode.h coffswap.h
Index: Makefile.am
===================================================================
RCS file: /cvs/src/src/bfd/Makefile.am,v
retrieving revision 1.25
diff -c -2 -p -r1.25 Makefile.am
*** Makefile.am	2000/04/26 15:09:42	1.25
--- Makefile.am	2000/04/28 15:25:23
*************** BFD64_BACKENDS = \
*** 389,392 ****
--- 389,393 ----
  	coff-alpha.lo \
  	coff-ia64.lo \
+ 	coff64-rs6000.lo \
  	demo64.lo \
  	elf64-alpha.lo \
*************** BFD64_BACKENDS_CFILES = \
*** 404,407 ****
--- 405,409 ----
  	coff-alpha.c \
  	coff-ia64.c \
+ 	coff64-rs6000.c \
  	demo64.c \
  	elf64-alpha.c \
*************** coff-mips.lo: coff-mips.c $(INCDIR)/bfdl
*** 813,823 ****
    $(INCDIR)/coff/mips.h libcoff.h libecoff.h coffswap.h \
    ecoffswap.h
! coff-pmac.lo: coff-pmac.c coff-rs6000.c $(INCDIR)/coff/internal.h \
    $(INCDIR)/coff/rs6000.h libcoff.h $(INCDIR)/bfdlink.h \
    coffcode.h coffswap.h
! coff-rs6000.lo: coff-rs6000.c $(INCDIR)/coff/internal.h \
    $(INCDIR)/coff/rs6000.h libcoff.h $(INCDIR)/bfdlink.h \
    coffcode.h coffswap.h
! coff64-rs6000.lo: coff64-rs6000.c coff-rs6000.c $(INCDIR)/coff/internal.h \
    $(INCDIR)/coff/rs6000.h libcoff.h $(INCDIR)/bfdlink.h \
    coffcode.h coffswap.h
--- 815,826 ----
    $(INCDIR)/coff/mips.h libcoff.h libecoff.h coffswap.h \
    ecoffswap.h
! coff-pmac.lo: coff-pmac.c coff-rs6000.c xcoff.h $(INCDIR)/coff/internal.h \
    $(INCDIR)/coff/rs6000.h libcoff.h $(INCDIR)/bfdlink.h \
    coffcode.h coffswap.h
! coff-rs6000.lo: coff-rs6000.c xcoff.h $(INCDIR)/coff/internal.h \
    $(INCDIR)/coff/rs6000.h libcoff.h $(INCDIR)/bfdlink.h \
    coffcode.h coffswap.h
! coff64-rs6000.lo: coff64-rs6000.c coff-rs6000.c xcoff.h \
!   $(INCDIR)/coff/internal.h \
    $(INCDIR)/coff/rs6000.h libcoff.h $(INCDIR)/bfdlink.h \
    coffcode.h coffswap.h
Index: coff-pmac.c
===================================================================
RCS file: /cvs/src/src/bfd/coff-pmac.c,v
retrieving revision 1.1.1.1
diff -c -2 -p -r1.1.1.1 coff-pmac.c
*** coff-pmac.c	1999/05/03 07:28:55	1.1.1.1
--- coff-pmac.c	2000/04/28 15:14:42
*************** along with this program; if not, write t
*** 18,27 ****
  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
  
- #define TARGET_SYM	pmac_xcoff_vec
- #define TARGET_NAME	"xcoff-powermac"
  
  /* Tweak coffcode.h based on this being a PowerMac instead of RS/6000. */
  
  #define POWERMAC
  
- #include "coff-rs6000.c"
--- 18,36 ----
  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
  
  
  /* Tweak coffcode.h based on this being a PowerMac instead of RS/6000. */
  
  #define POWERMAC
+ 
+ #define TARGET_SYM	pmac_xcoff_vec
+ #define TARGET_NAME	"xcoff-powermac"
+ 
+ #include "bfd.h"
+ #include "sysdep.h"
+ #include "libbfd.h"
+ #include "coff/internal.h"
+ #include "coff/rs6000.h"
+ #include "libcoff.h"
+ #include "xcoff.h"
+ 
  
Index: coff-rs6000.c
===================================================================
RCS file: /cvs/src/src/bfd/coff-rs6000.c,v
retrieving revision 1.7
diff -c -2 -p -r1.7 coff-rs6000.c
*** coff-rs6000.c	2000/04/26 15:09:42	1.7
--- coff-rs6000.c	2000/04/28 15:14:42
*************** along with this program; if not, write t
*** 27,32 ****
  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
  
- /* Internalcoff.h and coffcode.h modify themselves based on this flag.  */
- #define RS6000COFF_C 1
  
  #include "bfd.h"
--- 27,30 ----
*************** Foundation, Inc., 59 Temple Place - Suit
*** 36,60 ****
  #include "coff/rs6000.h"
  #include "libcoff.h"
  
  /* The main body of code is in coffcode.h.  */
  
- boolean _bfd_xcoff_mkobject PARAMS ((bfd *));
- boolean _bfd_xcoff_copy_private_bfd_data PARAMS ((bfd *, bfd *));
- boolean _bfd_xcoff_is_local_label_name PARAMS ((bfd *, const char *));
- void _bfd_xcoff_rtype2howto
-   PARAMS ((arelent *, struct internal_reloc *));
- reloc_howto_type *_bfd_xcoff_reloc_type_lookup
-   PARAMS ((bfd *, bfd_reloc_code_real_type));
- boolean _bfd_xcoff_slurp_armap PARAMS ((bfd *));
- const bfd_target *_bfd_xcoff_archive_p PARAMS ((bfd *));
- PTR _bfd_xcoff_read_ar_hdr PARAMS ((bfd *));
- bfd *_bfd_xcoff_openr_next_archived_file PARAMS ((bfd *, bfd *));
- int _bfd_xcoff_generic_stat_arch_elt PARAMS ((bfd *, struct stat *));
  static const char *normalize_filename PARAMS ((bfd *));
! boolean _bfd_xcoff_write_armap
!   PARAMS ((bfd *, unsigned int, struct orl *, unsigned int, int));
! boolean _bfd_xcoff_write_archive_contents PARAMS ((bfd *));
! int _bfd_xcoff_sizeof_headers PARAMS ((bfd *, boolean));
! 
  /* We use our own tdata type.  Its first field is the COFF tdata type,
     so the COFF routines are compatible.  */
--- 34,46 ----
  #include "coff/rs6000.h"
  #include "libcoff.h"
+ #define TARGET_NAME "aixcoff-rs6000"
+ #define TARGET_SYM rs6000coff_vec
+ #include "xcoff.h"
  
+ 
  /* The main body of code is in coffcode.h.  */
  
  static const char *normalize_filename PARAMS ((bfd *));
! 
  /* We use our own tdata type.  Its first field is the COFF tdata type,
     so the COFF routines are compatible.  */
*************** _bfd_xcoff_is_local_label_name (abfd, na
*** 148,160 ****
  
  
- #define NO_COFF_SYMBOLS
  
! static void xcoff_swap_sym_in PARAMS ((bfd *, PTR, PTR));
! static unsigned int xcoff_swap_sym_out PARAMS ((bfd *, PTR, PTR));
! static void xcoff_swap_aux_in PARAMS ((bfd *, PTR, int, int, int, int, PTR));
! static unsigned int xcoff_swap_aux_out PARAMS ((bfd *, PTR, int, int, int, int, PTR));
! 
! static void
! xcoff_swap_sym_in (abfd, ext1, in1)
       bfd            *abfd;
       PTR ext1;
--- 134,140 ----
  
  
  
! void
! _bfd_xcoff_swap_sym_in (abfd, ext1, in1)
       bfd            *abfd;
       PTR ext1;
*************** xcoff_swap_sym_in (abfd, ext1, in1)
*** 183,188 ****
  }
  
! static unsigned int
! xcoff_swap_sym_out (abfd, inp, extp)
       bfd       *abfd;
       PTR	inp;
--- 163,168 ----
  }
  
! unsigned int
! _bfd_xcoff_swap_sym_out (abfd, inp, extp)
       bfd       *abfd;
       PTR	inp;
*************** xcoff_swap_sym_out (abfd, inp, extp)
*** 218,223 ****
  #define GETBYTE bfd_h_get_8
  
! static void
! xcoff_swap_aux_in (abfd, ext1, type, class, indx, numaux, in1)
       bfd            *abfd;
       PTR 	      ext1;
--- 198,203 ----
  #define GETBYTE bfd_h_get_8
  
! void
! _bfd_xcoff_swap_aux_in (abfd, ext1, type, class, indx, numaux, in1)
       bfd            *abfd;
       PTR 	      ext1;
*************** end: ;
*** 332,337 ****
  
  
! static unsigned int
! xcoff_swap_aux_out (abfd, inp, type, class, indx, numaux, extp)
       bfd   *abfd;
       PTR 	inp;
--- 312,317 ----
  
  
! unsigned int
! _bfd_xcoff_swap_aux_out (abfd, inp, type, class, indx, numaux, extp)
       bfd   *abfd;
       PTR 	inp;
*************** _bfd_xcoff_reloc_type_lookup (abfd, code
*** 898,928 ****
  }
  
- #define SELECT_RELOC(internal, howto)					\
-   {									\
-     internal.r_type = howto->type;					\
-     internal.r_size =							\
-       ((howto->complain_on_overflow == complain_overflow_signed		\
- 	? 0x80								\
- 	: 0)								\
-        | (howto->bitsize - 1));						\
-   }
- 
- #define COFF_DEFAULT_SECTION_ALIGNMENT_POWER (3)
- 
- #define COFF_LONG_FILENAMES
- 
- #define RTYPE2HOWTO(cache_ptr, dst) _bfd_xcoff_rtype2howto (cache_ptr, dst)
- 
- #define coff_SWAP_sym_in xcoff_swap_sym_in
- #define coff_SWAP_sym_out xcoff_swap_sym_out
- #define coff_SWAP_aux_in xcoff_swap_aux_in
- #define coff_SWAP_aux_out xcoff_swap_aux_out
- #define coff_mkobject _bfd_xcoff_mkobject
- #define coff_bfd_copy_private_bfd_data _bfd_xcoff_copy_private_bfd_data
- #define coff_bfd_is_local_label_name _bfd_xcoff_is_local_label_name
- #define coff_bfd_reloc_type_lookup _bfd_xcoff_reloc_type_lookup
- #define coff_relocate_section _bfd_ppc_xcoff_relocate_section
- 
- #include "coffcode.h"
  
  /* XCOFF archive support.  The original version of this code was by
--- 878,881 ----
*************** struct xcoff_ar_hdr_big
*** 1136,1156 ****
    ((struct xcoff_ar_hdr_big *) arch_eltdata (bfd)->arch_header)
  
- /* XCOFF archives do not have anything which corresponds to an
-    extended name table.  */
- 
- #define _bfd_xcoff_slurp_extended_name_table bfd_false
- #define _bfd_xcoff_construct_extended_name_table \
-   ((boolean (*) PARAMS ((bfd *, char **, bfd_size_type *, const char **))) \
-    bfd_false)
- #define _bfd_xcoff_truncate_arname bfd_dont_truncate_arname
- 
- /* We can use the standard get_elt_at_index routine.  */
- 
- #define _bfd_xcoff_get_elt_at_index _bfd_generic_get_elt_at_index
- 
- /* XCOFF archives do not have a timestamp.  */
- 
- #define _bfd_xcoff_update_armap_timestamp bfd_true
- 
  /* Read in the armap of an XCOFF archive.  */
  
--- 1089,1092 ----
*************** _bfd_xcoff_sizeof_headers (abfd, reloc)
*** 2323,2436 ****
  }
  
- #define CORE_FILE_P _bfd_dummy_target
  
- #define coff_core_file_failing_command _bfd_nocore_core_file_failing_command
- #define coff_core_file_failing_signal _bfd_nocore_core_file_failing_signal
- #define coff_core_file_matches_executable_p \
-   _bfd_nocore_core_file_matches_executable_p
- 
- #ifdef AIX_CORE
- #undef CORE_FILE_P
- #define CORE_FILE_P rs6000coff_core_p
- extern const bfd_target * rs6000coff_core_p ();
- extern boolean rs6000coff_get_section_contents ();
- extern boolean rs6000coff_core_file_matches_executable_p ();
- 
- #undef	coff_core_file_matches_executable_p
- #define coff_core_file_matches_executable_p  \
- 				     rs6000coff_core_file_matches_executable_p
- 
- extern char *rs6000coff_core_file_failing_command PARAMS ((bfd *abfd));
- #undef coff_core_file_failing_command
- #define coff_core_file_failing_command rs6000coff_core_file_failing_command
- 
- extern int rs6000coff_core_file_failing_signal PARAMS ((bfd *abfd));
- #undef coff_core_file_failing_signal
- #define coff_core_file_failing_signal rs6000coff_core_file_failing_signal
- 
- #undef	coff_get_section_contents
- #define	coff_get_section_contents	rs6000coff_get_section_contents
- #endif /* AIX_CORE */
- 
- #ifdef LYNX_CORE
- 
- #undef CORE_FILE_P
- #define CORE_FILE_P lynx_core_file_p
- extern const bfd_target *lynx_core_file_p PARAMS ((bfd *abfd));
- 
- extern boolean lynx_core_file_matches_executable_p PARAMS ((bfd *core_bfd,
- 							    bfd *exec_bfd));
- #undef	coff_core_file_matches_executable_p
- #define coff_core_file_matches_executable_p lynx_core_file_matches_executable_p
- 
- extern char *lynx_core_file_failing_command PARAMS ((bfd *abfd));
- #undef coff_core_file_failing_command
- #define coff_core_file_failing_command lynx_core_file_failing_command
- 
- extern int lynx_core_file_failing_signal PARAMS ((bfd *abfd));
- #undef coff_core_file_failing_signal
- #define coff_core_file_failing_signal lynx_core_file_failing_signal
- 
- #endif /* LYNX_CORE */
- 
- #define _bfd_xcoff_bfd_get_relocated_section_contents \
-   coff_bfd_get_relocated_section_contents
- #define _bfd_xcoff_bfd_relax_section coff_bfd_relax_section
- #define _bfd_xcoff_bfd_gc_sections coff_bfd_gc_sections
- #define _bfd_xcoff_bfd_link_split_section coff_bfd_link_split_section
- 
- /* The transfer vector that leads the outside world to all of the above. */
- 
- const bfd_target
- #ifdef TARGET_SYM
-   TARGET_SYM =
- #else
-   rs6000coff_vec =
- #endif
- {
- #ifdef TARGET_NAME
-   TARGET_NAME,
- #else
-   "aixcoff-rs6000",		/* name */
- #endif
-   bfd_target_coff_flavour,
-   BFD_ENDIAN_BIG,		/* data byte order is big */
-   BFD_ENDIAN_BIG,		/* header byte order is big */
- 
-   (HAS_RELOC | EXEC_P |		/* object flags */
-    HAS_LINENO | HAS_DEBUG | DYNAMIC |
-    HAS_SYMS | HAS_LOCALS | WP_TEXT),
- 
-   (SEC_HAS_CONTENTS | SEC_ALLOC | SEC_LOAD | SEC_RELOC), /* section flags */
-   0,				/* leading char */
-   '/',				/* ar_pad_char */
-   15,				/* ar_max_namelen??? FIXMEmgo */
- 
-   bfd_getb64, bfd_getb_signed_64, bfd_putb64,
-      bfd_getb32, bfd_getb_signed_32, bfd_putb32,
-      bfd_getb16, bfd_getb_signed_16, bfd_putb16, /* data */
-   bfd_getb64, bfd_getb_signed_64, bfd_putb64,
-      bfd_getb32, bfd_getb_signed_32, bfd_putb32,
-      bfd_getb16, bfd_getb_signed_16, bfd_putb16, /* hdrs */
- 
-   {_bfd_dummy_target, coff_object_p, 	/* bfd_check_format */
-      _bfd_xcoff_archive_p, CORE_FILE_P},
-   {bfd_false, coff_mkobject,		/* bfd_set_format */
-      _bfd_generic_mkarchive, bfd_false},
-   {bfd_false, coff_write_object_contents,	/* bfd_write_contents */
-      _bfd_xcoff_write_archive_contents, bfd_false},
- 
-      BFD_JUMP_TABLE_GENERIC (coff),
-      BFD_JUMP_TABLE_COPY (coff),
-      BFD_JUMP_TABLE_CORE (coff),
-      BFD_JUMP_TABLE_ARCHIVE (_bfd_xcoff),
-      BFD_JUMP_TABLE_SYMBOLS (coff),
-      BFD_JUMP_TABLE_RELOCS (coff),
-      BFD_JUMP_TABLE_WRITE (coff),
-      BFD_JUMP_TABLE_LINK (_bfd_xcoff),
-      BFD_JUMP_TABLE_DYNAMIC (_bfd_xcoff),
- 
-   NULL,
-   
-   COFF_SWAP_TABLE
- };
--- 2259,2261 ----
Index: coff64-rs6000.c
===================================================================
RCS file: /cvs/src/src/bfd/coff64-rs6000.c,v
retrieving revision 1.1
diff -c -2 -p -r1.1 coff64-rs6000.c
*** coff64-rs6000.c	2000/04/26 15:09:42	1.1
--- coff64-rs6000.c	2000/04/28 15:14:43
*************** Foundation, Inc., 59 Temple Place - Suit
*** 71,76 ****
  #define COFF_DEBUG_STRING_WIDE_PREFIX
  
- #define TARGET_SYM rs6000coff64_vec
- #define TARGET_NAME "aixcoff64-rs6000"
  
  #define COFF_ADJUST_SCNHDR_OUT_POST(ABFD,INT,EXT) \
--- 71,74 ----
*************** xcoff64_swap_lineno_out (abfd, inp, outp
*** 132,136 ****
  }
  
- #define NO_COFF_SYMBOLS
  
  static void xcoff64_swap_sym_in PARAMS ((bfd *, PTR, PTR));
--- 130,133 ----
*************** end:
*** 351,369 ****
  }
  
- #define SELECT_RELOC(internal, howto)					\
-   {									\
-     internal.r_type = howto->type;					\
-     internal.r_size =							\
-       ((howto->complain_on_overflow == complain_overflow_signed		\
- 	? 0x80								\
- 	: 0)								\
-        | (howto->bitsize - 1));						\
-   }
- 
- #define COFF_DEFAULT_SECTION_ALIGNMENT_POWER (3)
- 
- #define COFF_LONG_FILENAMES
- 
- #define RTYPE2HOWTO(cache_ptr, dst) _bfd_xcoff_rtype2howto (cache_ptr, dst)
  
  #define coff_SWAP_sym_in xcoff64_swap_sym_in
--- 348,351 ----
*************** end:
*** 371,479 ****
  #define coff_SWAP_aux_in xcoff64_swap_aux_in
  #define coff_SWAP_aux_out xcoff64_swap_aux_out
! #define coff_mkobject _bfd_xcoff_mkobject
! #define coff_bfd_copy_private_bfd_data _bfd_xcoff_copy_private_bfd_data
! #define coff_bfd_is_local_label_name _bfd_xcoff_is_local_label_name
! #define coff_bfd_reloc_type_lookup _bfd_xcoff_reloc_type_lookup
! #define coff_relocate_section _bfd_ppc_xcoff_relocate_section
! 
! extern boolean _bfd_xcoff_mkobject PARAMS ((bfd *));
! extern boolean _bfd_xcoff_copy_private_bfd_data PARAMS ((bfd *, bfd *));
! extern boolean _bfd_xcoff_is_local_label_name PARAMS ((bfd *, const char *));
! extern void _bfd_xcoff_rtype2howto
!   PARAMS ((arelent *, struct internal_reloc *));
! extern reloc_howto_type *_bfd_xcoff_reloc_type_lookup
!   PARAMS ((bfd *, bfd_reloc_code_real_type));
! extern boolean _bfd_xcoff_slurp_armap PARAMS ((bfd *));
! extern const bfd_target *_bfd_xcoff_archive_p PARAMS ((bfd *));
! extern PTR _bfd_xcoff_read_ar_hdr PARAMS ((bfd *));
! extern bfd *_bfd_xcoff_openr_next_archived_file PARAMS ((bfd *, bfd *));
! extern int _bfd_xcoff_generic_stat_arch_elt PARAMS ((bfd *, struct stat *));
! extern boolean _bfd_xcoff_write_armap
!   PARAMS ((bfd *, unsigned int, struct orl *, unsigned int, int));
! extern boolean _bfd_xcoff_write_archive_contents PARAMS ((bfd *));
! extern int _bfd_xcoff_sizeof_headers PARAMS ((bfd *, boolean));
! 
! #define _bfd_xcoff_slurp_extended_name_table bfd_false
! #define _bfd_xcoff_construct_extended_name_table \
!   ((boolean (*) PARAMS ((bfd *, char **, bfd_size_type *, const char **))) \
!    bfd_false)
! #define _bfd_xcoff_truncate_arname bfd_dont_truncate_arname
! 
! /* We can use the standard get_elt_at_index routine.  */
! 
! #define _bfd_xcoff_get_elt_at_index _bfd_generic_get_elt_at_index
! 
! /* XCOFF archives do not have a timestamp.  */
! 
! #define _bfd_xcoff_update_armap_timestamp bfd_true
! 
! #include "coffcode.h"
! 
! #define CORE_FILE_P _bfd_dummy_target
! 
! #define coff_core_file_failing_command _bfd_nocore_core_file_failing_command
! #define coff_core_file_failing_signal _bfd_nocore_core_file_failing_signal
! #define coff_core_file_matches_executable_p \
!   _bfd_nocore_core_file_matches_executable_p
! 
! #define _bfd_xcoff_bfd_get_relocated_section_contents \
!   coff_bfd_get_relocated_section_contents
! #define _bfd_xcoff_bfd_relax_section coff_bfd_relax_section
! #define _bfd_xcoff_bfd_gc_sections coff_bfd_gc_sections
! #define _bfd_xcoff_bfd_link_split_section coff_bfd_link_split_section
! 
! /* The transfer vector that leads the outside world to all of the above. */
! 
! const bfd_target
! #ifdef TARGET_SYM
!   TARGET_SYM =
! #else
!   rs6000coff64_vec =
! #endif
! {
! #ifdef TARGET_NAME
!   TARGET_NAME,
! #else
!   "aixcoff64-rs6000",		/* name */
! #endif
!   bfd_target_coff_flavour,
!   BFD_ENDIAN_BIG,		/* data byte order is big */
!   BFD_ENDIAN_BIG,		/* header byte order is big */
! 
!   (HAS_RELOC | EXEC_P |		/* object flags */
!    HAS_LINENO | HAS_DEBUG | DYNAMIC |
!    HAS_SYMS | HAS_LOCALS | WP_TEXT),
! 
!   (SEC_HAS_CONTENTS | SEC_ALLOC | SEC_LOAD | SEC_RELOC), /* section flags */
!   0,				/* leading char */
!   '/',				/* ar_pad_char */
!   15,				/* ar_max_namelen??? FIXMEmgo */
! 
!   bfd_getb64, bfd_getb_signed_64, bfd_putb64,
!      bfd_getb32, bfd_getb_signed_32, bfd_putb32,
!      bfd_getb16, bfd_getb_signed_16, bfd_putb16, /* data */
!   bfd_getb64, bfd_getb_signed_64, bfd_putb64,
!      bfd_getb32, bfd_getb_signed_32, bfd_putb32,
!      bfd_getb16, bfd_getb_signed_16, bfd_putb16, /* hdrs */
! 
!   {_bfd_dummy_target, coff_object_p, 	/* bfd_check_format */
!      _bfd_xcoff_archive_p, CORE_FILE_P},
!   {bfd_false, coff_mkobject,		/* bfd_set_format */
!      _bfd_generic_mkarchive, bfd_false},
!   {bfd_false, coff_write_object_contents,	/* bfd_write_contents */
!      _bfd_xcoff_write_archive_contents, bfd_false},
! 
!      BFD_JUMP_TABLE_GENERIC (coff),
!      BFD_JUMP_TABLE_COPY (coff),
!      BFD_JUMP_TABLE_CORE (coff),
!      BFD_JUMP_TABLE_ARCHIVE (_bfd_xcoff),
!      BFD_JUMP_TABLE_SYMBOLS (coff),
!      BFD_JUMP_TABLE_RELOCS (coff),
!      BFD_JUMP_TABLE_WRITE (coff),
!      BFD_JUMP_TABLE_LINK (_bfd_xcoff),
!      BFD_JUMP_TABLE_DYNAMIC (_bfd_xcoff),
! 
!   NULL,
!   
!   COFF_SWAP_TABLE
! };
--- 353,360 ----
  #define coff_SWAP_aux_in xcoff64_swap_aux_in
  #define coff_SWAP_aux_out xcoff64_swap_aux_out
! 
! #define TARGET_NAME "aixcoff64-rs6000"
! #define TARGET_SYM rs6000coff64_vec
! 
! #include "xcoff.h"
! 
*** xcoff.h	Fri Apr 28 10:13:10 2000
--- xcoff.h	Fri Apr 28 09:59:03 2000
***************
*** 0 ****
--- 1,198 ----
+ /* Common definitions for backends based on IBM RS/6000 "XCOFF64" files.
+    Copyright 2000
+    Free Software Foundation, Inc.
+    Contributed by Cygnus Support.
+ 
+ This file is part of BFD, the Binary File Descriptor library.
+ 
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+ 
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ GNU General Public License for more details.
+ 
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+ 
+ /* Internalcoff.h and coffcode.h modify themselves based on this flag.  */
+ #define RS6000COFF_C 1
+ 
+ #define SELECT_RELOC(internal, howto)					\
+   {									\
+     internal.r_type = howto->type;					\
+     internal.r_size =							\
+       ((howto->complain_on_overflow == complain_overflow_signed		\
+ 	? 0x80								\
+ 	: 0)								\
+        | (howto->bitsize - 1));						\
+   }
+ 
+ #define COFF_DEFAULT_SECTION_ALIGNMENT_POWER (3)
+ 
+ #define COFF_LONG_FILENAMES
+ 
+ #define NO_COFF_SYMBOLS
+ 
+ #define RTYPE2HOWTO(cache_ptr, dst) _bfd_xcoff_rtype2howto (cache_ptr, dst)
+ 
+ #define coff_mkobject _bfd_xcoff_mkobject
+ #define coff_bfd_copy_private_bfd_data _bfd_xcoff_copy_private_bfd_data
+ #define coff_bfd_is_local_label_name _bfd_xcoff_is_local_label_name
+ #define coff_bfd_reloc_type_lookup _bfd_xcoff_reloc_type_lookup
+ #define coff_relocate_section _bfd_ppc_xcoff_relocate_section
+ 
+ #define CORE_FILE_P _bfd_dummy_target
+ 
+ #define coff_core_file_failing_command _bfd_nocore_core_file_failing_command
+ #define coff_core_file_failing_signal _bfd_nocore_core_file_failing_signal
+ #define coff_core_file_matches_executable_p \
+   _bfd_nocore_core_file_matches_executable_p
+ 
+ #ifdef AIX_CORE
+ #undef CORE_FILE_P
+ #define CORE_FILE_P rs6000coff_core_p
+ extern const bfd_target * rs6000coff_core_p ();
+ extern boolean rs6000coff_get_section_contents ();
+ extern boolean rs6000coff_core_file_matches_executable_p ();
+ 
+ #undef	coff_core_file_matches_executable_p
+ #define coff_core_file_matches_executable_p  \
+ 				     rs6000coff_core_file_matches_executable_p
+ 
+ extern char *rs6000coff_core_file_failing_command PARAMS ((bfd *abfd));
+ #undef coff_core_file_failing_command
+ #define coff_core_file_failing_command rs6000coff_core_file_failing_command
+ 
+ extern int rs6000coff_core_file_failing_signal PARAMS ((bfd *abfd));
+ #undef coff_core_file_failing_signal
+ #define coff_core_file_failing_signal rs6000coff_core_file_failing_signal
+ 
+ #undef	coff_get_section_contents
+ #define	coff_get_section_contents	rs6000coff_get_section_contents
+ #endif /* AIX_CORE */
+ 
+ #ifdef LYNX_CORE
+ 
+ #undef CORE_FILE_P
+ #define CORE_FILE_P lynx_core_file_p
+ extern const bfd_target *lynx_core_file_p PARAMS ((bfd *abfd));
+ 
+ extern boolean lynx_core_file_matches_executable_p PARAMS ((bfd *core_bfd,
+ 							    bfd *exec_bfd));
+ #undef	coff_core_file_matches_executable_p
+ #define coff_core_file_matches_executable_p lynx_core_file_matches_executable_p
+ 
+ extern char *lynx_core_file_failing_command PARAMS ((bfd *abfd));
+ #undef coff_core_file_failing_command
+ #define coff_core_file_failing_command lynx_core_file_failing_command
+ 
+ extern int lynx_core_file_failing_signal PARAMS ((bfd *abfd));
+ #undef coff_core_file_failing_signal
+ #define coff_core_file_failing_signal lynx_core_file_failing_signal
+ 
+ #endif /* LYNX_CORE */
+ 
+ #define _bfd_xcoff_bfd_get_relocated_section_contents \
+   coff_bfd_get_relocated_section_contents
+ #define _bfd_xcoff_bfd_relax_section coff_bfd_relax_section
+ #define _bfd_xcoff_bfd_gc_sections coff_bfd_gc_sections
+ #define _bfd_xcoff_bfd_link_split_section coff_bfd_link_split_section
+ 
+ /* XCOFF archives do not have anything which corresponds to an
+    extended name table.  */
+ 
+ #define _bfd_xcoff_slurp_extended_name_table bfd_false
+ #define _bfd_xcoff_construct_extended_name_table \
+   ((boolean (*) PARAMS ((bfd *, char **, bfd_size_type *, const char **))) \
+    bfd_false)
+ #define _bfd_xcoff_truncate_arname bfd_dont_truncate_arname
+ 
+ /* We can use the standard get_elt_at_index routine.  */
+ 
+ #define _bfd_xcoff_get_elt_at_index _bfd_generic_get_elt_at_index
+ 
+ /* XCOFF archives do not have a timestamp.  */
+ 
+ #define _bfd_xcoff_update_armap_timestamp bfd_true
+ 
+ extern boolean _bfd_xcoff_mkobject PARAMS ((bfd *));
+ extern boolean _bfd_xcoff_copy_private_bfd_data PARAMS ((bfd *, bfd *));
+ extern boolean _bfd_xcoff_is_local_label_name PARAMS ((bfd *, const char *));
+ extern void _bfd_xcoff_rtype2howto
+   PARAMS ((arelent *, struct internal_reloc *));
+ extern reloc_howto_type *_bfd_xcoff_reloc_type_lookup
+   PARAMS ((bfd *, bfd_reloc_code_real_type));
+ extern boolean _bfd_xcoff_slurp_armap PARAMS ((bfd *));
+ extern const bfd_target *_bfd_xcoff_archive_p PARAMS ((bfd *));
+ extern PTR _bfd_xcoff_read_ar_hdr PARAMS ((bfd *));
+ extern bfd *_bfd_xcoff_openr_next_archived_file PARAMS ((bfd *, bfd *));
+ extern int _bfd_xcoff_generic_stat_arch_elt PARAMS ((bfd *, struct stat *));
+ extern boolean _bfd_xcoff_write_armap
+   PARAMS ((bfd *, unsigned int, struct orl *, unsigned int, int));
+ extern boolean _bfd_xcoff_write_archive_contents PARAMS ((bfd *));
+ extern int _bfd_xcoff_sizeof_headers PARAMS ((bfd *, boolean));
+ extern void _bfd_xcoff_swap_sym_in PARAMS ((bfd *, PTR, PTR));
+ extern unsigned int _bfd_xcoff_swap_sym_out PARAMS ((bfd *, PTR, PTR));
+ extern void _bfd_xcoff_swap_aux_in PARAMS ((bfd *, PTR, int, int, int, int, PTR));
+ extern unsigned int _bfd_xcoff_swap_aux_out PARAMS ((bfd *, PTR, int, int, int, int, PTR));
+ 
+ #ifndef coff_SWAP_sym_in
+ #define coff_SWAP_sym_in _bfd_xcoff_swap_sym_in
+ #define coff_SWAP_sym_out _bfd_xcoff_swap_sym_out
+ #define coff_SWAP_aux_in _bfd_xcoff_swap_aux_in
+ #define coff_SWAP_aux_out _bfd_xcoff_swap_aux_out
+ #endif
+ 
+ #include "coffcode.h"
+ 
+ /* The transfer vector that leads the outside world to all of the above. */
+ 
+ const bfd_target TARGET_SYM =
+ {
+   TARGET_NAME,
+   bfd_target_coff_flavour,
+   BFD_ENDIAN_BIG,		/* data byte order is big */
+   BFD_ENDIAN_BIG,		/* header byte order is big */
+ 
+   (HAS_RELOC | EXEC_P |		/* object flags */
+    HAS_LINENO | HAS_DEBUG | DYNAMIC |
+    HAS_SYMS | HAS_LOCALS | WP_TEXT),
+ 
+   (SEC_HAS_CONTENTS | SEC_ALLOC | SEC_LOAD | SEC_RELOC), /* section flags */
+   0,				/* leading char */
+   '/',				/* ar_pad_char */
+   15,				/* ar_max_namelen??? FIXMEmgo */
+ 
+   bfd_getb64, bfd_getb_signed_64, bfd_putb64,
+      bfd_getb32, bfd_getb_signed_32, bfd_putb32,
+      bfd_getb16, bfd_getb_signed_16, bfd_putb16, /* data */
+   bfd_getb64, bfd_getb_signed_64, bfd_putb64,
+      bfd_getb32, bfd_getb_signed_32, bfd_putb32,
+      bfd_getb16, bfd_getb_signed_16, bfd_putb16, /* hdrs */
+ 
+   {_bfd_dummy_target, coff_object_p, 	/* bfd_check_format */
+      _bfd_xcoff_archive_p, CORE_FILE_P},
+   {bfd_false, coff_mkobject,		/* bfd_set_format */
+      _bfd_generic_mkarchive, bfd_false},
+   {bfd_false, coff_write_object_contents,	/* bfd_write_contents */
+      _bfd_xcoff_write_archive_contents, bfd_false},
+ 
+      BFD_JUMP_TABLE_GENERIC (coff),
+      BFD_JUMP_TABLE_COPY (coff),
+      BFD_JUMP_TABLE_CORE (coff),
+      BFD_JUMP_TABLE_ARCHIVE (_bfd_xcoff),
+      BFD_JUMP_TABLE_SYMBOLS (coff),
+      BFD_JUMP_TABLE_RELOCS (coff),
+      BFD_JUMP_TABLE_WRITE (coff),
+      BFD_JUMP_TABLE_LINK (_bfd_xcoff),
+      BFD_JUMP_TABLE_DYNAMIC (_bfd_xcoff),
+ 
+   NULL,
+   
+   COFF_SWAP_TABLE
+ };

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]