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]

Re: XCOFF64 bfd changes


These are the XCOFF64 support changes for bfd and gas.  This addresses Ian's
comments about 8.3 compliance, not having #ifdefs in include/coff/*, and not
doing includes of coff-rs6000.c.  It also adds -a64 to trigger xcoff64 
generation, for compliance with the native assembler.  This required 
hacking as.c to allow md_parse_option to supercede the default handling of
-a.  I don't know if that's kosher; I didn't see a cleaner way.

Many of the changes not present in the last version of this patch are just
making static functions in coff-rs6000.c global.

				-Clint


bfd/ChangeLog:

Mon Apr 24 15:20:35 2000  Clinton Popetz  <cpopetz@cygnus.com>

	* Makefile.am (coff64-rs6000.lo): New rule.
	* Makefile.in: Regenerate.
	* coff-rs6000.c (xcoff_mkobject, xcoff_copy_private_bfd_data,
	xcoff_is_local_label_name, xcoff_rtype2howto,
	xcoff_reloc_type_lookup, xcoff_slurp_armap, xcoff_archive_p,
	xcoff_read_ar_hdr, xcoff_openr_next_archived_file, xcoff_write_armap,
	xcoff_write_archive_contents): No longer static.
	(NO_COFF_SYMBOLS): Define.
	(xcoff64_swap_sym_in, xcoff64_swap_sym_out, xcoff64_swap_aux_in,
	xcoff64_swap_aux_out): New functions; handle xcoff symbol tables
	internally.
	(MINUS_ONE): New macro.
	(xcoff_howto_tabl, xcoff_reloc_type_lookup): Add 64 bit POS 
	relocation.
	(coff_SWAP_sym_in, coff_SWAP_sym_out, coff_SWAP_aux_in, 
	coff_SWAP_aux_out): Map to the new functions.
	* coff64-rs6000.c: New file.
	* libcoff.h (bfd_coff_backend_data): Add new fields 
	_bfd_coff_force_symnames_in_strings and 
	_bfd_coff_debug_string_prefix_length.
	(bfd_coff_force_symnames_in_strings, 
	bfd_coff_debug_string_prefix_length): New macros for above fields.
	* coffcode.h (coff_set_arch_mach_hook): Handle XCOFF64 magic.
	Set machine to 620 for XCOFF64.  Use bfd_coff_swap_sym_in instead 
	of using coff_swap_sym_in directly.
	(FORCE_SYMNAMES_IN_STRINGS): New macro, defined for XCOFF64.
	(coff_set_flags) Set magic for XCOFF64.	
	(coff_compute_section_file_positions): Add symbol name length to
	string section length if bfd_coff_debug_string_prefix_length is
	true.
	(coff_write_object_contents): Don't do reloc overflow for XCOFF64.
	(coff_slurp_line_table): Use bfd_coff_swap_lineno_in instead of
	using coff_swap_lineno_in directly.
	(bfd_coff_backend_data): Add _bfd_coff_force_symnames_in_strings
	and _bfd_coff_debug_string_prefix_length fields.
	* coffgen.c (coff_fix_symbol_name, coff_write_symbols): Force 
	symbol names into strings table when 
	bfd_coff_force_symnames_in_strings is true.
	* coffswap.h (MAX_SCNHDR_NRELOC, MAX_SCNHDR_NLNNO, GET_RELOC_VADDR,
	SET_RELOC_VADDR): New macros.
	(coff_swap_reloc_in, coff_swap_reloc_out): Use above macros.	
	(coff_swap_aux_in, coff_swap_aux_out): Remove RS6000COFF_C
	code.
	(coff_swap_aouthdr_in, coff_swap_aouthdr_out): Handle XCOFF64
	changes within RS6000COFF_C specific code.
	(coff_swap_scnhdr_out): Use PUT_SCNHDR_NLNNO, PUT_SCNHDR_NRELOC, 
	MAX_SCNHDR_NRELOC, and MAX_SCNHDR_NLNNO.
	* reloc.c (bfd_perform_relocation, bfd_install_relocation):
	Extend existing hack on target name.
	* xcofflink.c (XCOFF_XVECP): Extend existing hack on
	target name.
	* coff-tic54x.c (ticof): Keep up to date with new fields
	in bfd_coff_backend_data.
	* config.bfd: Add bfd_powerpc_64_arch to targ_arch and define
	targ_selvecs to include rs6000coff64_vec for rs6000.
	* configure.in: Add rs6000coff64_vec case.
 	* cpu-powerpc.c: New bfd_arch_info_type.

gas/ChangeLog:

Mon Apr 24 15:21:11 2000  Clinton Popetz  <cpopetz@cygnus.com>

	* as.c (parse_args): Allow md_parse_option to override -a listing
	option.
	* config/obj-coff.c (add_lineno): Change type of offset parameter
	from "int" to "bfd_vma."
	* config/tc-ppc.c (md_pseudo_table): Add "llong" and "machine."
	(ppc_mach, ppc_subseg_align, ppc_target_format): New.
	(ppc_change_csect): Align correctly for XCOFF64.	
	(ppc_machine): New function, which discards "ppc_machine" line.
	(ppc_tc): Cons for 8 when code is 64 bit.
	(md_apply_fix3): Don't check operand->insert.  Handle 64 bit
	relocations.
	(md_parse_option): Handle -a64 and -a32.
	(ppc_xcoff64): New.
	* config/tc-ppc.h (TARGET_MACH): Define.
	(TARGET_FORMAT): Move to function.
	(SUB_SEGMENT_ALIGN): Use ppc_subseg_align.

include/ChangeLog:

Mon Apr 24 15:20:51 2000  Clinton Popetz  <cpopetz@cygnus.com>

	* include/coff/rs6k64.h: New file.

opcodes/ChangeLog:

Mon Apr 24 15:21:35 2000  Clinton Popetz  <cpopetz@cygnus.com>

	* configure.in: Add bfd_powerpc_64_arch.
	* disassemble.c (disassembler): Use print_insn_big_powerpc for
	64 bit code.


*** include/coff/rs6k64.h	Mon Apr 24 15:36:44 2000
--- include/coff/rs6k64.h	Mon Apr 24 14:36:40 2000
***************
*** 0 ****
--- 1,236 ----
+ /* IBM RS/6000 "XCOFF64" file definitions for BFD.
+    Copyright (C) 2000 Free Software Foundation, Inc.  */
+ 
+ /********************** FILE HEADER **********************/
+ 
+ struct external_filehdr {
+ 	char f_magic[2];	/* magic number			*/
+ 	char f_nscns[2];	/* number of sections		*/
+ 	char f_timdat[4];	/* time & date stamp		*/
+ 	char f_symptr[8];/* file pointer to symtab 	*/
+ 	char f_opthdr[2];	/* sizeof(optional hdr)		*/
+ 	char f_flags[2];	/* flags			*/
+ 	char f_nsyms[4];	/* number of symtab entries	*/
+ };
+ 
+         /* IBM RS/6000 */
+ #define U802TOC64MAGIC	0757	/* readonly text segments and TOC, XCOFF64 */
+ 
+ #define BADMAG(x) ((x).f_magic != U802TOC64MAGIC)
+ 
+ #define	FILHDR	struct external_filehdr
+ #define	FILHSZ	24
+ 
+ /********************** AOUT "OPTIONAL HEADER" **********************/
+ 
+ 
+ typedef struct 
+ {
+   unsigned char	magic[2];		/* type of file			*/
+   unsigned char	vstamp[2];		/* version stamp		*/
+   unsigned char	o_debugger[4];		/* reserved 			*/
+   unsigned char	text_start[8];	/* base of text used for this file */
+   unsigned char	data_start[8];	/* base of data used for this file */
+   unsigned char	o_toc[8];	/* address of TOC */
+   unsigned char	o_snentry[2];		/* section number of entry point */
+   unsigned char	o_sntext[2];		/* section number of .text section */
+   unsigned char	o_sndata[2];		/* section number of .data section */
+   unsigned char	o_sntoc[2];		/* section number of TOC */
+   unsigned char	o_snloader[2];		/* section number of .loader section */
+   unsigned char	o_snbss[2];		/* section number of .bss section */
+   unsigned char	o_algntext[2];		/* .text alignment */
+   unsigned char	o_algndata[2];		/* .data alignment */
+   unsigned char	o_modtype[2];		/* module type (??) */
+   unsigned char o_cputype[2];		/* cpu type */
+   unsigned char	o_resv2[4];		/* reserved 			*/
+   unsigned char	tsize[8];		/* text size bytes, padded to FW bdry */
+   unsigned char	dsize[8];		/* initialized data "  "	*/
+   unsigned char	bsize[8];		/* uninitialized data "   "	*/
+   unsigned char	entry[8];		/* entry pt.			*/
+   unsigned char	o_maxstack[8];	/* max stack size (??) 		*/
+   unsigned char o_maxdata[8];	/* max data size (??) 		*/
+   unsigned char	o_resv3[116];		/* reserved 			*/
+ }
+ AOUTHDR;
+ 
+ #define AOUTSZ 220
+ #define SMALL_AOUTSZ (0)
+ #define AOUTHDRSZ 72
+ 
+ #define	RS6K_AOUTHDR_OMAGIC	0x0107	/* old: text & data writeable */
+ #define	RS6K_AOUTHDR_NMAGIC	0x0108	/* new: text r/o, data r/w */
+ #define	RS6K_AOUTHDR_ZMAGIC	0x010B	/* paged: text r/o, both page-aligned */
+ 
+ 
+ /********************** SECTION HEADER **********************/
+ 
+ 
+ struct external_scnhdr {
+ 	char	s_name[8];		/* section name			*/
+ 	char	s_paddr[8];	/* physical address, aliased s_nlib */
+ 	char	s_vaddr[8];	/* virtual address		*/
+ 	char	s_size[8];	/* section size			*/
+ 	char	s_scnptr[8];	/* file ptr to raw data for section */
+ 	char	s_relptr[8];	/* file ptr to relocation	*/
+ 	char	s_lnnoptr[8];	/* file ptr to line numbers	*/
+ 	char	s_nreloc[4];	/* number of relocation entries	*/
+ 	char	s_nlnno[4];	/* number of line number entries*/
+ 	char	s_flags[4];		/* flags			*/
+ 	char    s_pad[4];		/* padding */  
+ };
+ 
+ /*
+  * names of "special" sections
+  */
+ #define _TEXT	".text"
+ #define _DATA	".data"
+ #define _BSS	".bss"
+ #define _PAD	".pad"
+ #define _LOADER	".loader"
+ 
+ #define	SCNHDR	struct external_scnhdr
+ 
+ #define	SCNHSZ	72
+ 
+ /* XCOFF uses a special .loader section with type STYP_LOADER.  */
+ #define STYP_LOADER 0x1000
+ 
+ /* XCOFF uses a special .debug section with type STYP_DEBUG.  */
+ #define STYP_DEBUG 0x2000
+ 
+ /* XCOFF handles line number or relocation overflow by creating
+    another section header with STYP_OVRFLO set.  */
+ #define STYP_OVRFLO 0x8000
+ 
+ /********************** LINE NUMBERS **********************/
+ 
+ /* 1 line number entry for every "breakpointable" source line in a section.
+  * Line numbers are grouped on a per function basis; first entry in a function
+  * grouping will have l_lnno = 0 and in place of physical address will be the
+  * symbol table index of the function name.
+  */
+ struct external_lineno {
+ 	union {
+ 		char l_symndx[8];/* function name symbol index, iff l_lnno == 0*/
+ 		char l_paddr[8];	/* (physical) address of line number	*/
+ 	} l_addr;
+ 	char l_lnno[4];		/* line number		*/
+ };
+ 
+ 
+ #define	LINENO	struct external_lineno
+ 
+ #define	LINESZ	12
+ 
+ 
+ /********************** SYMBOLS **********************/
+ 
+ #define E_SYMNMLEN	8	/* # characters in a symbol name	*/
+ #define E_FILNMLEN	14	/* # characters in a file name		*/
+ #define E_DIMNUM	4	/* # array dimensions in auxiliary entry */
+ 
+ struct external_syment 
+ {
+   union {
+     char e_value[8];
+   } e;
+   char e_offset[4];
+   char e_scnum[2];
+   char e_type[2];
+   char e_sclass[1];
+   char e_numaux[1];
+ };
+ 
+ 
+ 
+ #define N_BTMASK	(017)
+ #define N_TMASK		(060)
+ #define N_BTSHFT	(4)
+ #define N_TSHIFT	(2)
+   
+ 
+ union external_auxent {
+ 
+     struct {
+     	union {
+ 	    struct {
+ 		char x_lnno[4]; 	/* declaration line number */
+ 		char x_size[2]; 	/* str/union/array size */
+ 	    } x_lnsz;
+ 	    struct {
+ 		char x_lnnoptr[8];/* ptr to fcn line */
+ 		char x_fsize[4];	 /* size of function */
+ 		char x_endndx[4];	 /* entry ndx past block end */
+ 	    } x_fcn;
+  	} x_fcnary;
+     } x_sym;
+          
+     union {
+ 	char x_fname[E_FILNMLEN];
+ 	struct {
+ 	    char x_zeroes[4];
+ 	    char x_offset[4];
+ 	    char          x_pad[6];
+ 	    unsigned char x_ftype[1];
+ 	    unsigned char x_resv[2];
+ 	} x_n;
+     } x_file;
+ 
+     struct {
+ 	char x_exptr[8];
+ 	char x_fsize[4];
+ 	char x_endndx[4];
+ 	char x_pad[1];
+     } x_except;
+ 
+     struct {
+ 	    unsigned char x_scnlen_lo[4];
+ 	    unsigned char x_parmhash[4];
+ 	    unsigned char x_snhash[2];
+ 	    unsigned char x_smtyp[1];
+ 	    unsigned char x_smclas[1];
+ 	    unsigned char x_scnlen_hi[4];
+ 	    unsigned char x_pad[1];
+     } x_csect;	
+ 
+     struct {
+ 	char x_pad[17];
+ 	char x_auxtype[1];
+     } x_auxtype;
+ };
+ 
+ #define	SYMENT	struct external_syment
+ #define	SYMESZ	18	
+ #define	AUXENT	union external_auxent
+ #define	AUXESZ	18
+ #define DBXMASK 0x80		/* for dbx storage mask */
+ #define SYMNAME_IN_DEBUG(symptr) ((symptr)->n_sclass & DBXMASK)
+ 
+ /* Values for auxtype field in XCOFF64, taken from AIX 4.3 sym.h */
+ #define _AUX_EXCEPT     255
+ #define _AUX_FCN        254
+ #define _AUX_SYM        253
+ #define _AUX_FILE       252
+ #define _AUX_CSECT      251
+ 
+ 
+ 
+ /********************** RELOCATION DIRECTIVES **********************/
+ 
+ 
+ struct external_reloc {
+   char r_vaddr[8];
+   char r_symndx[4];
+   char r_size[1];
+   char r_type[1];
+ };
+ 
+ 
+ #define RELOC struct external_reloc
+ #define RELSZ 14
+ 
+ #define DEFAULT_DATA_SECTION_ALIGNMENT 4
+ #define DEFAULT_BSS_SECTION_ALIGNMENT 4
+ #define DEFAULT_TEXT_SECTION_ALIGNMENT 4
+ /* For new sections we havn't heard of before */
+ #define DEFAULT_SECTION_ALIGNMENT 4


*** bfd/coff64-rs6000.c	Mon Apr 24 15:36:44 2000
--- bfd/coff64-rs6000.c	Mon Apr 24 15:31:36 2000
***************
*** 0 ****
--- 1,479 ----
+ /* BFD back-end for IBM RS/6000 "XCOFF64" files.
+    Copyright 2000
+    Free Software Foundation, Inc.
+    Written Clinton Popetz.
+    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 these flags.  */
+ #define XCOFF64 
+ #define RS6000COFF_C 1
+ 
+ #include "bfd.h"
+ #include "sysdep.h"
+ #include "libbfd.h"
+ #include "coff/internal.h"
+ #include "coff/rs6k64.h"
+ #include "libcoff.h"
+ 
+ 
+ #define GET_FILEHDR_SYMPTR bfd_h_get_64
+ #define PUT_FILEHDR_SYMPTR bfd_h_put_64
+ #define GET_AOUTHDR_DATA_START bfd_h_get_64
+ #define PUT_AOUTHDR_DATA_START bfd_h_put_64
+ #define GET_AOUTHDR_TEXT_START bfd_h_get_64
+ #define PUT_AOUTHDR_TEXT_START bfd_h_put_64
+ #define GET_AOUTHDR_TSIZE bfd_h_get_64
+ #define PUT_AOUTHDR_TSIZE bfd_h_put_64
+ #define GET_AOUTHDR_DSIZE bfd_h_get_64
+ #define PUT_AOUTHDR_DSIZE bfd_h_put_64
+ #define GET_AOUTHDR_BSIZE bfd_h_get_64
+ #define PUT_AOUTHDR_BSIZE bfd_h_put_64
+ #define GET_AOUTHDR_ENTRY bfd_h_get_64
+ #define PUT_AOUTHDR_ENTRY bfd_h_put_64
+ #define GET_SCNHDR_PADDR bfd_h_get_64
+ #define PUT_SCNHDR_PADDR bfd_h_put_64
+ #define GET_SCNHDR_VADDR bfd_h_get_64
+ #define PUT_SCNHDR_VADDR bfd_h_put_64
+ #define GET_SCNHDR_SIZE bfd_h_get_64
+ #define PUT_SCNHDR_SIZE bfd_h_put_64
+ #define GET_SCNHDR_SCNPTR bfd_h_get_64
+ #define PUT_SCNHDR_SCNPTR bfd_h_put_64
+ #define GET_SCNHDR_RELPTR bfd_h_get_64
+ #define PUT_SCNHDR_RELPTR bfd_h_put_64
+ #define GET_SCNHDR_LNNOPTR bfd_h_get_64
+ #define PUT_SCNHDR_LNNOPTR bfd_h_put_64
+ #define GET_SCNHDR_NRELOC bfd_h_get_32
+ #define MAX_SCNHDR_NRELOC 0xffffffff
+ #define PUT_SCNHDR_NRELOC bfd_h_put_32
+ #define GET_SCNHDR_NLNNO bfd_h_get_32
+ #define MAX_SCNHDR_NLNNO 0xffffffff
+ #define PUT_SCNHDR_NLNNO bfd_h_put_32
+ #define GET_RELOC_VADDR bfd_h_get_64
+ #define PUT_RELOC_VADDR bfd_h_put_64
+ 
+ #define COFF_FORCE_SYMBOLS_IN_STRINGS
+ #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) \
+ do { \
+   memset (((SCNHDR *)EXT)->s_pad, 0, sizeof (((SCNHDR *)EXT)->s_pad));\
+ } while(0)
+ 
+ #define NO_COFF_LINENOS
+ 
+ #define coff_SWAP_lineno_in xcoff64_swap_lineno_in
+ #define coff_SWAP_lineno_out xcoff64_swap_lineno_out
+ 
+ #define PUTWORD bfd_h_put_32
+ #define PUTHALF bfd_h_put_16
+ #define PUTBYTE bfd_h_put_8
+ #define GETWORD bfd_h_get_32
+ #define GETHALF bfd_h_get_16
+ #define GETBYTE bfd_h_get_8
+ 
+ 
+ /* For XCOFF64, the effective width of symndx changes depending on 
+    whether we are the first entry.  Sigh.  */
+ static void
+ xcoff64_swap_lineno_in (abfd, ext1, in1)
+      bfd            *abfd;
+      PTR ext1;
+      PTR in1;
+ {
+   LINENO *ext = (LINENO *)ext1;
+   struct internal_lineno      *in = (struct internal_lineno *)in1;
+ 
+   in->l_lnno = bfd_h_get_32(abfd, (bfd_byte *) (ext->l_lnno));
+   if (in->l_lnno == 0)
+     in->l_addr.l_symndx = 
+ 	    bfd_h_get_32(abfd, (bfd_byte *) ext->l_addr.l_symndx);
+   else
+     in->l_addr.l_symndx = 
+ 	    bfd_h_get_64(abfd, (bfd_byte *) ext->l_addr.l_symndx);
+ }
+ 
+ static unsigned int
+ xcoff64_swap_lineno_out (abfd, inp, outp)
+      bfd       *abfd;
+      PTR	inp;
+      PTR	outp;
+ {
+   struct internal_lineno *in = (struct internal_lineno *)inp;
+   struct external_lineno *ext = (struct external_lineno *)outp;
+   PUTWORD(abfd, in->l_addr.l_symndx, (bfd_byte *)
+ 	  ext->l_addr.l_symndx);
+ 
+   bfd_h_put_32 (abfd, in->l_lnno,  (bfd_byte *) (ext->l_lnno));
+   if (in->l_lnno == 0)
+     bfd_h_put_32 (abfd, in->l_addr.l_symndx, (bfd_byte *)ext->l_addr.l_symndx);
+   else
+     bfd_h_put_64 (abfd, in->l_addr.l_symndx, (bfd_byte *)ext->l_addr.l_symndx);
+ 
+   return bfd_coff_linesz (abfd);
+ }
+ 
+ #define NO_COFF_SYMBOLS
+ 
+ static void xcoff64_swap_sym_in PARAMS ((bfd *, PTR, PTR));
+ static unsigned int xcoff64_swap_sym_out PARAMS ((bfd *, PTR, PTR));
+ static void xcoff64_swap_aux_in PARAMS ((bfd *, PTR, int, int, int, int, PTR));
+ static unsigned int xcoff64_swap_aux_out PARAMS ((bfd *, PTR, int, int, int, int, PTR));
+ 
+ static void
+ xcoff64_swap_sym_in (abfd, ext1, in1)
+      bfd            *abfd;
+      PTR ext1;
+      PTR in1;
+ {
+   SYMENT *ext = (SYMENT *)ext1;
+   struct internal_syment      *in = (struct internal_syment *)in1;
+ 
+ 
+   in->_n._n_n._n_zeroes = 0;
+   in->_n._n_n._n_offset = bfd_h_get_32(abfd, (bfd_byte *) ext->e_offset);
+   in->n_value = bfd_h_get_64(abfd, (bfd_byte *) ext->e.e_value); 
+   in->n_scnum = bfd_h_get_16(abfd, (bfd_byte *) ext->e_scnum);
+   in->n_type = bfd_h_get_16(abfd, (bfd_byte *) ext->e_type);
+   in->n_sclass = bfd_h_get_8(abfd, ext->e_sclass);
+   in->n_numaux = bfd_h_get_8(abfd, ext->e_numaux);
+ }
+ 
+ static unsigned int
+ xcoff64_swap_sym_out (abfd, inp, extp)
+      bfd       *abfd;
+      PTR	inp;
+      PTR	extp;
+ {
+   struct internal_syment *in = (struct internal_syment *)inp;
+   SYMENT *ext =(SYMENT *)extp;
+ 
+   bfd_h_put_32(abfd, in->_n._n_n._n_offset, (bfd_byte *)  ext->e_offset);
+   bfd_h_put_64(abfd,  in->n_value , (bfd_byte *) ext->e.e_value);
+   bfd_h_put_16(abfd,  in->n_scnum , (bfd_byte *) ext->e_scnum);
+   bfd_h_put_16(abfd,  in->n_type , (bfd_byte *) ext->e_type);
+   bfd_h_put_8(abfd,  in->n_sclass , ext->e_sclass);
+   bfd_h_put_8(abfd,  in->n_numaux , ext->e_numaux);
+   return bfd_coff_symesz (abfd);
+ }
+ 
+ static void
+ xcoff64_swap_aux_in (abfd, ext1, type, class, indx, numaux, in1)
+      bfd            *abfd;
+      PTR 	      ext1;
+      int             type;
+      int             class;
+      int	      indx;
+      int	      numaux;
+      PTR 	      in1;
+ {
+   AUXENT    *ext = (AUXENT *)ext1;
+   union internal_auxent *in = (union internal_auxent *)in1;
+ 
+   switch (class) {
+     case C_FILE:
+       if (ext->x_file.x_fname[0] == 0) {
+ 	  in->x_file.x_n.x_zeroes = 0;
+ 	  in->x_file.x_n.x_offset = 
+ 	   bfd_h_get_32(abfd, (bfd_byte *) ext->x_file.x_n.x_offset);
+ 	} else {
+ 	    if (numaux > 1)
+ 	      {
+ 		if (indx == 0)
+ 	  memcpy (in->x_file.x_fname, ext->x_file.x_fname,
+ 			  numaux * sizeof (AUXENT));
+ 	      }
+ 	    else
+ 	      {
+ 		memcpy (in->x_file.x_fname, ext->x_file.x_fname, FILNMLEN);
+ 	      }
+ 	  }
+       goto end;
+ 
+       /* RS/6000 "csect" auxents */
+     case C_EXT:
+     case C_HIDEXT:
+       if (indx + 1 == numaux)
+ 	{
+ 	  in->x_csect.x_scnlen.l = 
+ 	      bfd_h_get_32(abfd, ext->x_csect.x_scnlen_lo);
+ 	  /* FIXME: If we want section lengths larger than 32 bits, we need 
+ 	     to modify the internal coff structures to support it.  */
+ 	  in->x_csect.x_parmhash = bfd_h_get_32 (abfd,
+ 						 ext->x_csect.x_parmhash);
+ 	  in->x_csect.x_snhash   = bfd_h_get_16 (abfd, ext->x_csect.x_snhash);
+ 	  /* We don't have to hack bitfields in x_smtyp because it's
+ 	     defined by shifts-and-ands, which are equivalent on all
+ 	     byte orders.  */
+ 	  in->x_csect.x_smtyp    = bfd_h_get_8  (abfd, ext->x_csect.x_smtyp);
+ 	  in->x_csect.x_smclas   = bfd_h_get_8  (abfd, ext->x_csect.x_smclas);
+ 	  goto end;
+ 	}
+       break;
+ 
+     case C_STAT:
+     case C_LEAFSTAT:
+     case C_HIDDEN:
+       if (type == T_NULL) {
+ 	  /* PE defines some extra fields; we zero them out for
+              safety.  */
+ 	  in->x_scn.x_checksum = 0;
+ 	  in->x_scn.x_associated = 0;
+ 	  in->x_scn.x_comdat = 0;
+ 
+ 	  goto end;
+ 	}
+       break;
+     }
+ 
+   if (class == C_BLOCK || class == C_FCN || ISFCN (type) || ISTAG (class))
+     {
+       in->x_sym.x_fcnary.x_fcn.x_lnnoptr = bfd_h_get_64(abfd, (bfd_byte *)
+ 	      ext->x_sym.x_fcnary.x_fcn.x_lnnoptr);
+       in->x_sym.x_fcnary.x_fcn.x_endndx.l = bfd_h_get_32(abfd, (bfd_byte *)
+ 	      ext->x_sym.x_fcnary.x_fcn.x_endndx);
+     }
+   if (ISFCN(type)) {
+     in->x_sym.x_misc.x_fsize = bfd_h_get_32(abfd, (bfd_byte *) ext->x_sym.x_fcnary.x_fcn.x_fsize);
+   }
+   else {
+     in->x_sym.x_misc.x_lnsz.x_lnno = bfd_h_get_32(abfd, (bfd_byte *)
+ 	    ext->x_sym.x_fcnary.x_lnsz.x_lnno);
+     in->x_sym.x_misc.x_lnsz.x_size = bfd_h_get_16(abfd, (bfd_byte *)
+ 	    ext->x_sym.x_fcnary.x_lnsz.x_size);
+   }
+ 
+ end: ;
+   /* the semicolon is because MSVC doesn't like labels at
+      end of block. */
+ 
+ }
+ 
+ 
+ 
+ static unsigned int
+ xcoff64_swap_aux_out (abfd, inp, type, class, indx, numaux, extp)
+      bfd   *abfd;
+      PTR 	inp;
+      int   type;
+      int   class;
+      int   indx ATTRIBUTE_UNUSED;
+      int   numaux ATTRIBUTE_UNUSED;
+      PTR	extp;
+ {
+   union internal_auxent *in = (union internal_auxent *)inp;
+   AUXENT *ext = (AUXENT *)extp;
+ 
+   memset((PTR)ext, 0, bfd_coff_auxesz (abfd));
+   switch (class)
+     {
+   case C_FILE:
+     if (in->x_file.x_fname[0] == 0)
+       {
+       PUTWORD(abfd, 0, (bfd_byte *) ext->x_file.x_n.x_zeroes);
+       PUTWORD(abfd,
+ 	      in->x_file.x_n.x_offset,
+ 	      (bfd_byte *) ext->x_file.x_n.x_offset);
+     }
+     else
+       {
+       memcpy (ext->x_file.x_fname, in->x_file.x_fname, FILNMLEN);
+       }
+     PUTBYTE (abfd, _AUX_FILE, (bfd_byte *) ext->x_auxtype.x_auxtype);
+     goto end;
+ 
+   /* RS/6000 "csect" auxents */
+   case C_EXT:
+   case C_HIDEXT:
+     if (indx + 1 == numaux)
+       {
+ 	PUTWORD (abfd, in->x_csect.x_scnlen.l, ext->x_csect.x_scnlen_lo);
+ 	PUTWORD (abfd, in->x_csect.x_parmhash,	ext->x_csect.x_parmhash);
+ 	PUTHALF (abfd, in->x_csect.x_snhash,	ext->x_csect.x_snhash);
+ 	/* We don't have to hack bitfields in x_smtyp because it's
+ 	   defined by shifts-and-ands, which are equivalent on all
+ 	   byte orders.  */
+ 	PUTBYTE (abfd, in->x_csect.x_smtyp,	ext->x_csect.x_smtyp);
+ 	PUTBYTE (abfd, in->x_csect.x_smclas,	ext->x_csect.x_smclas);
+     	PUTBYTE (abfd, _AUX_CSECT, (bfd_byte *) ext->x_auxtype.x_auxtype);
+ 	goto end;
+       }
+     break;
+ 
+   case C_STAT:
+   case C_LEAFSTAT:
+   case C_HIDDEN:
+     if (type == T_NULL) {
+       goto end;
+     }
+     break;
+   }
+ 
+   if (class == C_BLOCK || class == C_FCN || ISFCN (type) || ISTAG (class))
+     {
+       bfd_h_put_64(abfd,  in->x_sym.x_fcnary.x_fcn.x_lnnoptr, 
+ 	      (bfd_byte *) ext->x_sym.x_fcnary.x_fcn.x_lnnoptr);
+       PUTBYTE (abfd, _AUX_FCN, (bfd_byte *) ext->x_auxtype.x_auxtype);
+       PUTWORD(abfd,  in->x_sym.x_fcnary.x_fcn.x_endndx.l, 
+ 	      (bfd_byte *) ext->x_sym.x_fcnary.x_fcn.x_endndx);
+     }
+   if (ISFCN (type))
+     PUTWORD (abfd, in->x_sym.x_misc.x_fsize,
+ 	     (bfd_byte *)  ext->x_sym.x_fcnary.x_fcn.x_fsize);
+   else
+     {
+       bfd_h_put_32(abfd, in->x_sym.x_misc.x_lnsz.x_lnno, 
+ 	      (bfd_byte *)ext->x_sym.x_fcnary.x_lnsz.x_lnno);
+       bfd_h_put_16(abfd, in->x_sym.x_misc.x_lnsz.x_size, 
+ 	      (bfd_byte *)ext->x_sym.x_fcnary.x_lnsz.x_size);
+     }
+ 
+ end:
+   return bfd_coff_auxesz (abfd);
+ }
+ 
+ #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) xcoff_rtype2howto (cache_ptr, dst)
+ 
+ #define coff_SWAP_sym_in xcoff64_swap_sym_in
+ #define coff_SWAP_sym_out xcoff64_swap_sym_out
+ #define coff_SWAP_aux_in xcoff64_swap_aux_in
+ #define coff_SWAP_aux_out xcoff64_swap_aux_out
+ #define coff_mkobject xcoff_mkobject
+ #define coff_bfd_copy_private_bfd_data xcoff_copy_private_bfd_data
+ #define coff_bfd_is_local_label_name xcoff_is_local_label_name
+ #define coff_bfd_reloc_type_lookup xcoff_reloc_type_lookup
+ #define coff_relocate_section _bfd_ppc_xcoff_relocate_section
+ 
+ extern boolean xcoff_mkobject PARAMS ((bfd *));
+ extern boolean xcoff_copy_private_bfd_data PARAMS ((bfd *, bfd *));
+ extern boolean xcoff_is_local_label_name PARAMS ((bfd *, const char *));
+ extern void xcoff_rtype2howto
+   PARAMS ((arelent *, struct internal_reloc *));
+ extern reloc_howto_type *xcoff_reloc_type_lookup
+   PARAMS ((bfd *, bfd_reloc_code_real_type));
+ extern boolean xcoff_slurp_armap PARAMS ((bfd *));
+ extern const bfd_target *xcoff_archive_p PARAMS ((bfd *));
+ extern PTR xcoff_read_ar_hdr PARAMS ((bfd *));
+ extern bfd *xcoff_openr_next_archived_file PARAMS ((bfd *, bfd *));
+ extern int xcoff_generic_stat_arch_elt PARAMS ((bfd *, struct stat *));
+ extern boolean xcoff_write_armap
+   PARAMS ((bfd *, unsigned int, struct orl *, unsigned int, int));
+ extern boolean xcoff_write_archive_contents PARAMS ((bfd *));
+ extern int _bfd_xcoff_sizeof_headers PARAMS ((bfd *, boolean));
+ 
+ #define xcoff_slurp_extended_name_table bfd_false
+ #define xcoff_construct_extended_name_table \
+   ((boolean (*) PARAMS ((bfd *, char **, bfd_size_type *, const char **))) \
+    bfd_false)
+ #define xcoff_truncate_arname bfd_dont_truncate_arname
+ 
+ /* We can use the standard get_elt_at_index routine.  */
+ 
+ #define xcoff_get_elt_at_index _bfd_generic_get_elt_at_index
+ 
+ /* XCOFF archives do not have a timestamp.  */
+ 
+ #define 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 */
+      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 */
+      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 (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: bfd/Makefile.am
===================================================================
RCS file: /cvs/src/src/bfd/Makefile.am,v
retrieving revision 1.24
diff -c -2 -p -r1.24 Makefile.am
*** bfd/Makefile.am	2000/04/24 08:23:47	1.24
--- bfd/Makefile.am	2000/04/24 20:35:01
*************** coff-rs6000.lo: coff-rs6000.c $(INCDIR)/
*** 819,822 ****
--- 819,825 ----
    $(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
  coff-sh.lo: coff-sh.c $(INCDIR)/bfdlink.h $(INCDIR)/coff/sh.h \
    $(INCDIR)/coff/internal.h libcoff.h coffcode.h coffswap.h
Index: bfd/Makefile.in
===================================================================
RCS file: /cvs/src/src/bfd/Makefile.in,v
retrieving revision 1.26
diff -c -2 -p -r1.26 Makefile.in
*** bfd/Makefile.in	2000/04/24 08:23:47	1.26
--- bfd/Makefile.in	2000/04/24 20:35:03
*************** coff-rs6000.lo: coff-rs6000.c $(INCDIR)/
*** 1347,1350 ****
--- 1347,1353 ----
    $(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
  coff-sh.lo: coff-sh.c $(INCDIR)/bfdlink.h $(INCDIR)/coff/sh.h \
    $(INCDIR)/coff/internal.h libcoff.h coffcode.h coffswap.h
Index: bfd/coff-rs6000.c
===================================================================
RCS file: /cvs/src/src/bfd/coff-rs6000.c,v
retrieving revision 1.6
diff -c -2 -p -r1.6 coff-rs6000.c
*** bfd/coff-rs6000.c	2000/02/19 00:59:26	1.6
--- bfd/coff-rs6000.c	2000/04/24 20:35:06
*************** Foundation, Inc., 59 Temple Place - Suit
*** 39,64 ****
  /* The main body of code is in coffcode.h.  */
  
! static boolean xcoff_mkobject PARAMS ((bfd *));
! static boolean xcoff_copy_private_bfd_data PARAMS ((bfd *, bfd *));
! static boolean xcoff_is_local_label_name PARAMS ((bfd *, const char *));
! static void xcoff_rtype2howto
    PARAMS ((arelent *, struct internal_reloc *));
! static reloc_howto_type *xcoff_reloc_type_lookup
    PARAMS ((bfd *, bfd_reloc_code_real_type));
! static boolean xcoff_slurp_armap PARAMS ((bfd *));
! static const bfd_target *xcoff_archive_p PARAMS ((bfd *));
! static PTR xcoff_read_ar_hdr PARAMS ((bfd *));
! static bfd *xcoff_openr_next_archived_file PARAMS ((bfd *, bfd *));
! static int xcoff_generic_stat_arch_elt PARAMS ((bfd *, struct stat *));
  static const char *normalize_filename PARAMS ((bfd *));
! static boolean xcoff_write_armap
    PARAMS ((bfd *, unsigned int, struct orl *, unsigned int, int));
! static boolean xcoff_write_archive_contents PARAMS ((bfd *));
! static 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.  */
  
! static boolean
  xcoff_mkobject (abfd)
       bfd *abfd;
--- 39,64 ----
  /* The main body of code is in coffcode.h.  */
  
! boolean xcoff_mkobject PARAMS ((bfd *));
! boolean xcoff_copy_private_bfd_data PARAMS ((bfd *, bfd *));
! boolean xcoff_is_local_label_name PARAMS ((bfd *, const char *));
! void xcoff_rtype2howto
    PARAMS ((arelent *, struct internal_reloc *));
! reloc_howto_type *xcoff_reloc_type_lookup
    PARAMS ((bfd *, bfd_reloc_code_real_type));
! boolean xcoff_slurp_armap PARAMS ((bfd *));
! const bfd_target *xcoff_archive_p PARAMS ((bfd *));
! PTR xcoff_read_ar_hdr PARAMS ((bfd *));
! bfd *xcoff_openr_next_archived_file PARAMS ((bfd *, bfd *));
! int xcoff_generic_stat_arch_elt PARAMS ((bfd *, struct stat *));
  static const char *normalize_filename PARAMS ((bfd *));
! boolean xcoff_write_armap
    PARAMS ((bfd *, unsigned int, struct orl *, unsigned int, int));
! boolean 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.  */
  
! boolean
  xcoff_mkobject (abfd)
       bfd *abfd;
*************** xcoff_mkobject (abfd)
*** 91,95 ****
  /* Copy XCOFF data from one BFD to another.  */
  
! static boolean
  xcoff_copy_private_bfd_data (ibfd, obfd)
       bfd *ibfd;
--- 91,95 ----
  /* Copy XCOFF data from one BFD to another.  */
  
! boolean
  xcoff_copy_private_bfd_data (ibfd, obfd)
       bfd *ibfd;
*************** xcoff_copy_private_bfd_data (ibfd, obfd)
*** 139,143 ****
     -x option.  */
  
! static boolean
  xcoff_is_local_label_name (abfd, name)
       bfd *abfd ATTRIBUTE_UNUSED;
--- 139,143 ----
     -x option.  */
  
! boolean
  xcoff_is_local_label_name (abfd, name)
       bfd *abfd ATTRIBUTE_UNUSED;
*************** xcoff_is_local_label_name (abfd, name)
*** 147,150 ****
--- 147,435 ----
  }
  
+ 
+ #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;
+      PTR in1;
+ {
+   SYMENT *ext = (SYMENT *)ext1;
+   struct internal_syment      *in = (struct internal_syment *)in1;
+ 
+ 
+   if(ext->e.e_name[0] != 0)
+     {
+       memcpy(in->_n._n_name, ext->e.e_name, SYMNMLEN);
+     }
+   else 
+     {
+       in->_n._n_n._n_zeroes = 0;
+       in->_n._n_n._n_offset = 
+ 	  bfd_h_get_32(abfd, (bfd_byte *) ext->e.e.e_offset);
+     }
+ 
+   in->n_value = bfd_h_get_32(abfd, (bfd_byte *) ext->e_value); 
+   in->n_scnum = bfd_h_get_16(abfd, (bfd_byte *) ext->e_scnum);
+   in->n_type = bfd_h_get_16(abfd, (bfd_byte *) ext->e_type);
+   in->n_sclass = bfd_h_get_8(abfd, ext->e_sclass);
+   in->n_numaux = bfd_h_get_8(abfd, ext->e_numaux);
+ }
+ 
+ static unsigned int
+ xcoff_swap_sym_out (abfd, inp, extp)
+      bfd       *abfd;
+      PTR	inp;
+      PTR	extp;
+ {
+   struct internal_syment *in = (struct internal_syment *)inp;
+   SYMENT *ext =(SYMENT *)extp;
+ 
+   if(in->_n._n_name[0] != 0)
+     {
+       memcpy(ext->e.e_name, in->_n._n_name, SYMNMLEN);
+     }
+   else
+     {
+       bfd_h_put_32(abfd, 0, (bfd_byte *) ext->e.e.e_zeroes);
+       bfd_h_put_32(abfd, in->_n._n_n._n_offset, 
+ 	      (bfd_byte *)  ext->e.e.e_offset);
+     }
+ 
+   bfd_h_put_32(abfd,  in->n_value , (bfd_byte *) ext->e_value);
+   bfd_h_put_16(abfd,  in->n_scnum , (bfd_byte *) ext->e_scnum);
+   bfd_h_put_16(abfd,  in->n_type , (bfd_byte *) ext->e_type);
+   bfd_h_put_8(abfd,  in->n_sclass , ext->e_sclass);
+   bfd_h_put_8(abfd,  in->n_numaux , ext->e_numaux);
+   return bfd_coff_symesz (abfd);
+ }
+ 
+ #define PUTWORD bfd_h_put_32
+ #define PUTHALF bfd_h_put_16
+ #define PUTBYTE bfd_h_put_8
+ #define GETWORD bfd_h_get_32
+ #define GETHALF bfd_h_get_16
+ #define GETBYTE bfd_h_get_8
+ 
+ static void
+ xcoff_swap_aux_in (abfd, ext1, type, class, indx, numaux, in1)
+      bfd            *abfd;
+      PTR 	      ext1;
+      int             type;
+      int             class;
+      int	      indx;
+      int	      numaux;
+      PTR 	      in1;
+ {
+   AUXENT    *ext = (AUXENT *)ext1;
+   union internal_auxent *in = (union internal_auxent *)in1;
+ 
+   switch (class) {
+     case C_FILE:
+       if (ext->x_file.x_fname[0] == 0) {
+ 	  in->x_file.x_n.x_zeroes = 0;
+ 	  in->x_file.x_n.x_offset = 
+ 	   bfd_h_get_32(abfd, (bfd_byte *) ext->x_file.x_n.x_offset);
+ 	} else {
+ 	    if (numaux > 1)
+ 	      {
+ 		if (indx == 0)
+ 		  memcpy (in->x_file.x_fname, ext->x_file.x_fname,
+ 			  numaux * sizeof (AUXENT));
+ 	      }
+ 	    else
+ 	      {
+ 		memcpy (in->x_file.x_fname, ext->x_file.x_fname, FILNMLEN);
+ 	      }
+ 	  }
+       goto end;
+ 
+       /* RS/6000 "csect" auxents */
+     case C_EXT:
+     case C_HIDEXT:
+       if (indx + 1 == numaux)
+ 	{
+ 	  in->x_csect.x_scnlen.l = 
+ 	      bfd_h_get_32 (abfd, ext->x_csect.x_scnlen);
+ 	  in->x_csect.x_parmhash = bfd_h_get_32 (abfd,
+ 						 ext->x_csect.x_parmhash);
+ 	  in->x_csect.x_snhash   = bfd_h_get_16 (abfd, ext->x_csect.x_snhash);
+ 	  /* We don't have to hack bitfields in x_smtyp because it's
+ 	     defined by shifts-and-ands, which are equivalent on all
+ 	     byte orders.  */
+ 	  in->x_csect.x_smtyp    = bfd_h_get_8  (abfd, ext->x_csect.x_smtyp);
+ 	  in->x_csect.x_smclas   = bfd_h_get_8  (abfd, ext->x_csect.x_smclas);
+ 	  in->x_csect.x_stab     = bfd_h_get_32 (abfd, ext->x_csect.x_stab);
+ 	  in->x_csect.x_snstab   = bfd_h_get_16 (abfd, ext->x_csect.x_snstab);
+ 	  goto end;
+ 	}
+       break;
+ 
+     case C_STAT:
+     case C_LEAFSTAT:
+     case C_HIDDEN:
+       if (type == T_NULL) {
+ 	  in->x_scn.x_scnlen = bfd_h_get_32(abfd, 
+ 		  (bfd_byte *) ext->x_scn.x_scnlen);
+ 	  in->x_scn.x_nreloc = bfd_h_get_16(abfd, 
+ 		  (bfd_byte *) ext->x_scn.x_nreloc);
+ 	  in->x_scn.x_nlinno = bfd_h_get_16(abfd, 
+ 		  (bfd_byte *) ext->x_scn.x_nlinno);
+ 	  /* PE defines some extra fields; we zero them out for
+              safety.  */
+ 	  in->x_scn.x_checksum = 0;
+ 	  in->x_scn.x_associated = 0;
+ 	  in->x_scn.x_comdat = 0;
+ 
+ 	  goto end;
+ 	}
+       break;
+     }
+ 
+   in->x_sym.x_tagndx.l = bfd_h_get_32(abfd, (bfd_byte *) ext->x_sym.x_tagndx);
+   in->x_sym.x_tvndx = bfd_h_get_16(abfd, (bfd_byte *) ext->x_sym.x_tvndx);
+ 
+   if (class == C_BLOCK || class == C_FCN || ISFCN (type) || ISTAG (class))
+     {
+       in->x_sym.x_fcnary.x_fcn.x_lnnoptr = bfd_h_get_32(abfd, (bfd_byte *)
+ 	      ext->x_sym.x_fcnary.x_fcn.x_lnnoptr);
+       in->x_sym.x_fcnary.x_fcn.x_endndx.l = bfd_h_get_32(abfd, (bfd_byte *)
+ 	      ext->x_sym.x_fcnary.x_fcn.x_endndx);
+     }
+   else
+     {
+       in->x_sym.x_fcnary.x_ary.x_dimen[0] =
+ 	bfd_h_get_16 (abfd, (bfd_byte *) ext->x_sym.x_fcnary.x_ary.x_dimen[0]);
+       in->x_sym.x_fcnary.x_ary.x_dimen[1] =
+ 	bfd_h_get_16 (abfd, (bfd_byte *) ext->x_sym.x_fcnary.x_ary.x_dimen[1]);
+       in->x_sym.x_fcnary.x_ary.x_dimen[2] =
+ 	bfd_h_get_16 (abfd, (bfd_byte *) ext->x_sym.x_fcnary.x_ary.x_dimen[2]);
+       in->x_sym.x_fcnary.x_ary.x_dimen[3] =
+ 	bfd_h_get_16 (abfd, (bfd_byte *) ext->x_sym.x_fcnary.x_ary.x_dimen[3]);
+     }
+   if (ISFCN(type)) {
+     in->x_sym.x_misc.x_fsize = bfd_h_get_32(abfd, (bfd_byte *) ext->x_sym.x_misc.x_fsize);
+   }
+   else {
+     in->x_sym.x_misc.x_lnsz.x_lnno = bfd_h_get_16(abfd, (bfd_byte *)
+ 	    ext->x_sym.x_misc.x_lnsz.x_lnno);
+     in->x_sym.x_misc.x_lnsz.x_size = bfd_h_get_16(abfd, (bfd_byte *)
+ 	    ext->x_sym.x_misc.x_lnsz.x_size);
+   }
+ 
+ end: ;
+   /* the semicolon is because MSVC doesn't like labels at
+      end of block. */
+ 
+ }
+ 
+ 
+ 
+ static unsigned int
+ xcoff_swap_aux_out (abfd, inp, type, class, indx, numaux, extp)
+      bfd   *abfd;
+      PTR 	inp;
+      int   type;
+      int   class;
+      int   indx ATTRIBUTE_UNUSED;
+      int   numaux ATTRIBUTE_UNUSED;
+      PTR	extp;
+ {
+   union internal_auxent *in = (union internal_auxent *)inp;
+   AUXENT *ext = (AUXENT *)extp;
+ 
+   memset((PTR)ext, 0, bfd_coff_auxesz (abfd));
+   switch (class)
+     {
+   case C_FILE:
+     if (in->x_file.x_fname[0] == 0)
+       {
+       PUTWORD(abfd, 0, (bfd_byte *) ext->x_file.x_n.x_zeroes);
+       PUTWORD(abfd,
+ 	      in->x_file.x_n.x_offset,
+ 	      (bfd_byte *) ext->x_file.x_n.x_offset);
+     }
+     else
+       {
+       memcpy (ext->x_file.x_fname, in->x_file.x_fname, FILNMLEN);
+       }
+     goto end;
+ 
+   /* RS/6000 "csect" auxents */
+   case C_EXT:
+   case C_HIDEXT:
+     if (indx + 1 == numaux)
+       {
+ 	PUTWORD (abfd, in->x_csect.x_scnlen.l,ext->x_csect.x_scnlen);
+ 	PUTWORD (abfd, in->x_csect.x_parmhash,	ext->x_csect.x_parmhash);
+ 	PUTHALF (abfd, in->x_csect.x_snhash,	ext->x_csect.x_snhash);
+ 	/* We don't have to hack bitfields in x_smtyp because it's
+ 	   defined by shifts-and-ands, which are equivalent on all
+ 	   byte orders.  */
+ 	PUTBYTE (abfd, in->x_csect.x_smtyp,	ext->x_csect.x_smtyp);
+ 	PUTBYTE (abfd, in->x_csect.x_smclas,	ext->x_csect.x_smclas);
+ 	PUTWORD (abfd, in->x_csect.x_stab,	ext->x_csect.x_stab);
+ 	PUTHALF (abfd, in->x_csect.x_snstab,	ext->x_csect.x_snstab);
+ 	goto end;
+       }
+     break;
+ 
+   case C_STAT:
+   case C_LEAFSTAT:
+   case C_HIDDEN:
+     if (type == T_NULL) {
+       bfd_h_put_32(abfd, in->x_scn.x_scnlen, (bfd_byte *) ext->x_scn.x_scnlen);
+       bfd_h_put_16(abfd, in->x_scn.x_nreloc, (bfd_byte *) ext->x_scn.x_nreloc);
+       bfd_h_put_16(abfd, in->x_scn.x_nlinno, (bfd_byte *) ext->x_scn.x_nlinno);
+       goto end;
+     }
+     break;
+   }
+ 
+   PUTWORD(abfd, in->x_sym.x_tagndx.l, (bfd_byte *) ext->x_sym.x_tagndx);
+   PUTWORD(abfd, in->x_sym.x_tvndx , (bfd_byte *) ext->x_sym.x_tvndx);
+ 
+   if (class == C_BLOCK || class == C_FCN || ISFCN (type) || ISTAG (class))
+     {
+       bfd_h_put_32(abfd,  in->x_sym.x_fcnary.x_fcn.x_lnnoptr, 
+ 	      (bfd_byte *) ext->x_sym.x_fcnary.x_fcn.x_lnnoptr);
+       PUTWORD(abfd,  in->x_sym.x_fcnary.x_fcn.x_endndx.l, 
+ 	      (bfd_byte *) ext->x_sym.x_fcnary.x_fcn.x_endndx);
+     }
+   else
+     {
+       bfd_h_put_16 (abfd, in->x_sym.x_fcnary.x_ary.x_dimen[0],
+ 		    (bfd_byte *) ext->x_sym.x_fcnary.x_ary.x_dimen[0]);
+       bfd_h_put_16 (abfd, in->x_sym.x_fcnary.x_ary.x_dimen[1],
+ 		    (bfd_byte *) ext->x_sym.x_fcnary.x_ary.x_dimen[1]);
+       bfd_h_put_16 (abfd, in->x_sym.x_fcnary.x_ary.x_dimen[2],
+ 		    (bfd_byte *) ext->x_sym.x_fcnary.x_ary.x_dimen[2]);
+       bfd_h_put_16 (abfd, in->x_sym.x_fcnary.x_ary.x_dimen[3],
+ 		    (bfd_byte *) ext->x_sym.x_fcnary.x_ary.x_dimen[3]);
+     }
+ 
+   if (ISFCN (type))
+     PUTWORD (abfd, in->x_sym.x_misc.x_fsize,
+ 	     (bfd_byte *)  ext->x_sym.x_misc.x_fsize);
+   else
+     {
+       bfd_h_put_16(abfd, in->x_sym.x_misc.x_lnsz.x_lnno, 
+ 	      (bfd_byte *)ext->x_sym.x_misc.x_lnsz.x_lnno);
+       bfd_h_put_16(abfd, in->x_sym.x_misc.x_lnsz.x_size, 
+ 	      (bfd_byte *)ext->x_sym.x_misc.x_lnsz.x_size);
+     }
+ 
+ end:
+   return bfd_coff_auxesz (abfd);
+ }
+ 
+ 
+ 
  /* The XCOFF reloc table.  Actually, XCOFF relocations specify the
     bitsize and whether they are signed or not, along with a
*************** xcoff_is_local_label_name (abfd, name)
*** 153,157 ****
     relocs need special_function entries, which I have not written.  */
  
! static reloc_howto_type xcoff_howto_table[] =
  {
    /* Standard 32 bit relocation.  */
--- 438,446 ----
     relocs need special_function entries, which I have not written.  */
  
! /* In case we're on a 32-bit machine, construct a 64-bit "-1" value
!    from smaller values.  Start with zero, widen, *then* decrement.  */
! #define MINUS_ONE       (((bfd_vma)0) - 1)
! 
! reloc_howto_type xcoff_howto_table[] =
  {
    /* Standard 32 bit relocation.  */
*************** static reloc_howto_type xcoff_howto_tabl
*** 544,550 ****
  	 0xffffffff,            /* dst_mask */                             
  	 false),                /* pcrel_offset */
  };
    
! static void
  xcoff_rtype2howto (relent, internal)
       arelent *relent;
--- 833,852 ----
  	 0xffffffff,            /* dst_mask */                             
  	 false),                /* pcrel_offset */
+   HOWTO (0,                     /* type */
+          0,                     /* rightshift */
+          4,                     /* size (0 = byte, 1 = short, 2 = long) */
+          64,                    /* bitsize */
+          false,                 /* pc_relative */
+          0,                     /* bitpos */
+          complain_overflow_bitfield, /* complain_on_overflow */
+          0,                     /* special_function */
+          "R_POS",               /* name */
+          true,                  /* partial_inplace */
+          MINUS_ONE,             /* src_mask */
+ 	 MINUS_ONE,             /* dst_mask */
+ 	 false)                 /* pcrel_offset */
  };
    
! void
  xcoff_rtype2howto (relent, internal)
       arelent *relent;
*************** xcoff_rtype2howto (relent, internal)
*** 572,576 ****
  }
  
! static reloc_howto_type *
  xcoff_reloc_type_lookup (abfd, code)
       bfd *abfd ATTRIBUTE_UNUSED;
--- 874,878 ----
  }
  
! reloc_howto_type *
  xcoff_reloc_type_lookup (abfd, code)
       bfd *abfd ATTRIBUTE_UNUSED;
*************** xcoff_reloc_type_lookup (abfd, code)
*** 588,591 ****
--- 890,895 ----
      case BFD_RELOC_CTOR:
        return &xcoff_howto_table[0];
+     case BFD_RELOC_64:
+       return &xcoff_howto_table[0x1c];
      default:
        return NULL;
*************** xcoff_reloc_type_lookup (abfd, code)
*** 609,612 ****
--- 913,920 ----
  #define RTYPE2HOWTO(cache_ptr, dst) 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 xcoff_mkobject
  #define coff_bfd_copy_private_bfd_data xcoff_copy_private_bfd_data
*************** struct xcoff_ar_hdr_big
*** 846,850 ****
  /* Read in the armap of an XCOFF archive.  */
  
! static boolean
  xcoff_slurp_armap (abfd)
       bfd *abfd;
--- 1154,1158 ----
  /* Read in the armap of an XCOFF archive.  */
  
! boolean
  xcoff_slurp_armap (abfd)
       bfd *abfd;
*************** xcoff_slurp_armap (abfd)
*** 970,974 ****
  /* See if this is an XCOFF archive.  */
  
! static const bfd_target *
  xcoff_archive_p (abfd)
       bfd *abfd;
--- 1278,1282 ----
  /* See if this is an XCOFF archive.  */
  
! const bfd_target *
  xcoff_archive_p (abfd)
       bfd *abfd;
*************** xcoff_archive_p (abfd)
*** 1073,1077 ****
  /* Read the archive header in an XCOFF archive.  */
  
! static PTR
  xcoff_read_ar_hdr (abfd)
       bfd *abfd;
--- 1381,1385 ----
  /* Read the archive header in an XCOFF archive.  */
  
! PTR
  xcoff_read_ar_hdr (abfd)
       bfd *abfd;
*************** xcoff_read_ar_hdr (abfd)
*** 1161,1165 ****
  /* Open the next element in an XCOFF archive.  */
  
! static bfd *
  xcoff_openr_next_archived_file (archive, last_file)
       bfd *archive;
--- 1469,1473 ----
  /* Open the next element in an XCOFF archive.  */
  
! bfd *
  xcoff_openr_next_archived_file (archive, last_file)
       bfd *archive;
*************** xcoff_openr_next_archived_file (archive,
*** 1222,1226 ****
  /* Stat an element in an XCOFF archive.  */
  
! static int
  xcoff_generic_stat_arch_elt (abfd, s)
       bfd *abfd;
--- 1530,1534 ----
  /* Stat an element in an XCOFF archive.  */
  
! int
  xcoff_generic_stat_arch_elt (abfd, s)
       bfd *abfd;
*************** xcoff_write_armap_big (abfd, elength, ma
*** 1453,1457 ****
  
  /*ARGSUSED*/
! static boolean
  xcoff_write_armap (abfd, elength, map, orl_count, stridx)
       bfd *abfd;
--- 1761,1765 ----
  
  /*ARGSUSED*/
! boolean
  xcoff_write_armap (abfd, elength, map, orl_count, stridx)
       bfd *abfd;
*************** xcoff_write_archive_contents_big (abfd)
*** 1984,1988 ****
  }
  
! static boolean
  xcoff_write_archive_contents (abfd)
       bfd *abfd;
--- 2292,2296 ----
  }
  
! boolean
  xcoff_write_archive_contents (abfd)
       bfd *abfd;
*************** xcoff_write_archive_contents (abfd)
*** 1998,2002 ****
  
  /*ARGSUSED*/
! static int
  _bfd_xcoff_sizeof_headers (abfd, reloc)
       bfd *abfd;
--- 2306,2310 ----
  
  /*ARGSUSED*/
! int
  _bfd_xcoff_sizeof_headers (abfd, reloc)
       bfd *abfd;
Index: bfd/coff-tic54x.c
===================================================================
RCS file: /cvs/src/src/bfd/coff-tic54x.c,v
retrieving revision 1.4
diff -c -2 -p -r1.4 coff-tic54x.c
*** bfd/coff-tic54x.c	2000/04/18 02:21:27	1.4
--- bfd/coff-tic54x.c	2000/04/24 20:35:06
*************** static CONST bfd_coff_backend_data ticof
*** 429,432 ****
--- 429,442 ----
    false,
  #endif
+ #ifdef COFF_FORCE_SYMBOLS_IN_STRINGS
+   true,
+ #else
+   false,
+ #endif
+ #ifdef COFF_DEBUG_STRING_WIDE_PREFIX
+   4,
+ #else
+   2,
+ #endif
    COFF_DEFAULT_SECTION_ALIGNMENT_POWER,
    coff_SWAP_filehdr_in, coff_SWAP_aouthdr_in, coff_SWAP_scnhdr_in,
*************** static CONST bfd_coff_backend_data ticof
*** 461,464 ****
--- 471,484 ----
  #endif
    COFF_DEFAULT_SECTION_ALIGNMENT_POWER,
+ #ifdef COFF_FORCE_SYMBOLS_IN_STRINGS
+   true,
+ #else
+   false,
+ #endif
+ #ifdef COFF_DEBUG_STRING_WIDE_PREFIX
+   4,
+ #else
+   2,
+ #endif
    coff_SWAP_filehdr_in, coff_SWAP_aouthdr_in, coff_SWAP_scnhdr_in,
    coff_SWAP_reloc_in, ticoff1_bad_format_hook, coff_set_arch_mach_hook,
Index: bfd/coffcode.h
===================================================================
RCS file: /cvs/src/src/bfd/coffcode.h,v
retrieving revision 1.38
diff -c -2 -p -r1.38 coffcode.h
*** bfd/coffcode.h	2000/04/18 04:03:16	1.38
--- bfd/coffcode.h	2000/04/24 20:35:09
*************** coff_set_arch_mach_hook (abfd, filehdr)
*** 1902,1908 ****
--- 1902,1912 ----
  
  #ifdef RS6000COFF_C
+ #ifdef XCOFF64
+     case U802TOC64MAGIC:
+ #else
      case U802ROMAGIC:
      case U802WRMAGIC:
      case U802TOCMAGIC:
+ #endif
        {
  	int cputype;
*************** coff_set_arch_mach_hook (abfd, filehdr)
*** 1931,1935 ****
  		    return false;
  		  }
! 		coff_swap_sym_in (abfd, (PTR) buf, (PTR) &sym);
  		if (sym.n_sclass == C_FILE)
  		  cputype = sym.n_type & 0xff;
--- 1935,1939 ----
  		    return false;
  		  }
! 		bfd_coff_swap_sym_in (abfd, (PTR) buf, (PTR) &sym);
  		if (sym.n_sclass == C_FILE)
  		  cputype = sym.n_type & 0xff;
*************** coff_set_arch_mach_hook (abfd, filehdr)
*** 1953,1957 ****
--- 1957,1965 ----
  #else
  	    arch = bfd_arch_rs6000;
+ #ifdef XCOFF64
+ 	    machine = 620;
+ #else
  	    machine = 6000;
+ #endif
  #endif /* POWERMAC */
  	    break;
*************** symname_in_debug_hook (abfd, sym)
*** 2126,2129 ****
--- 2134,2141 ----
  #ifdef RS6000COFF_C
  
+ #ifdef XCOFF64
+ #define FORCE_SYMNAMES_IN_STRINGS
+ #endif
+   
  /* Handle the csect auxent of a C_EXT or C_HIDEXT symbol.  */
  
*************** coff_set_flags (abfd, magicp, flagsp)
*** 2668,2677 ****
  #endif
  
! #ifdef U802TOCMAGIC
      case bfd_arch_rs6000:
  #ifndef PPCMAGIC
      case bfd_arch_powerpc:
  #endif
!       *magicp = U802TOCMAGIC;
        return true;
        break;
--- 2680,2695 ----
  #endif
  
! #ifdef RS6000COFF_C
      case bfd_arch_rs6000:
  #ifndef PPCMAGIC
      case bfd_arch_powerpc:
  #endif
! #ifdef XCOFF64
!       if (bfd_get_mach (abfd) == 620 && !strncmp (abfd->xvec->name,"aix", 3))
! 	*magicp = U802TOC64MAGIC; 
!       else
! #else
!     	*magicp = U802TOCMAGIC; 
! #endif
        return true;
        break;
*************** coff_compute_section_file_positions (abf
*** 2781,2786 ****
  
  	      len = strlen (bfd_asymbol_name (*symp));
! 	      if (len > SYMNMLEN)
! 		sz += len + 3;
  	    }
  	}
--- 2799,2804 ----
  
  	      len = strlen (bfd_asymbol_name (*symp));
! 	      if (len > SYMNMLEN || bfd_coff_force_symnames_in_strings (abfd))
! 		sz += len + 1 + bfd_coff_debug_string_prefix_length (abfd);
  	    }
  	}
*************** coff_write_object_contents (abfd)
*** 3310,3314 ****
  	hasdebug = true;
  
! #ifdef RS6000COFF_C
        /* Indicate the use of an XCOFF overflow section header.  */
        if (current->reloc_count >= 0xffff || current->lineno_count >= 0xffff)
--- 3328,3333 ----
  	hasdebug = true;
  
! #ifdef RS6000COFF_C 
! #ifndef XCOFF64
        /* Indicate the use of an XCOFF overflow section header.  */
        if (current->reloc_count >= 0xffff || current->lineno_count >= 0xffff)
*************** coff_write_object_contents (abfd)
*** 3318,3321 ****
--- 3337,3341 ----
  	}
  #endif
+ #endif
  
        section.s_flags = sec_to_styp_flags (current->name, current->flags);
*************** coff_slurp_line_table (abfd, asect)
*** 4069,4073 ****
  	{
  	  struct internal_lineno dst;
! 	  coff_swap_lineno_in (abfd, src, &dst);
  	  cache_ptr->line_number = dst.l_lnno;
  
--- 4089,4093 ----
  	{
  	  struct internal_lineno dst;
! 	  bfd_coff_swap_lineno_in (abfd, src, &dst);
  	  cache_ptr->line_number = dst.l_lnno;
  
*************** static const bfd_coff_backend_data bfd_c
*** 5009,5014 ****
  #else
    false,
  #endif
-   COFF_DEFAULT_SECTION_ALIGNMENT_POWER,
    coff_SWAP_filehdr_in, coff_SWAP_aouthdr_in, coff_SWAP_scnhdr_in,
    coff_SWAP_reloc_in, coff_bad_format_hook, coff_set_arch_mach_hook,
--- 5029,5044 ----
  #else
    false,
+ #endif
+   COFF_DEFAULT_SECTION_ALIGNMENT_POWER, 
+ #ifdef COFF_FORCE_SYMBOLS_IN_STRINGS
+   true,
+ #else
+   false,
+ #endif
+ #ifdef COFF_DEBUG_STRING_WIDE_PREFIX
+   4,
+ #else
+   2,
  #endif
    coff_SWAP_filehdr_in, coff_SWAP_aouthdr_in, coff_SWAP_scnhdr_in,
    coff_SWAP_reloc_in, coff_bad_format_hook, coff_set_arch_mach_hook,
Index: bfd/coffgen.c
===================================================================
RCS file: /cvs/src/src/bfd/coffgen.c,v
retrieving revision 1.12
diff -c -2 -p -r1.12 coffgen.c
*** bfd/coffgen.c	2000/04/07 00:58:06	1.12
--- bfd/coffgen.c	2000/04/24 20:35:11
*************** coff_fix_symbol_name (abfd, symbol, nati
*** 820,824 ****
        unsigned int filnmlen;
  
!       strncpy (native->u.syment._n._n_name, ".file", SYMNMLEN);
        auxent = &(native + 1)->u.auxent;
  
--- 820,833 ----
        unsigned int filnmlen;
  
!       if (bfd_coff_force_symnames_in_strings (abfd))
! 	{
!           native->u.syment._n._n_n._n_offset = 
! 	      (*string_size_p + STRING_SIZE_SIZE);
! 	  native->u.syment._n._n_n._n_zeroes = 0;
! 	  *string_size_p += 6;  /* strlen(".file") + 1 */
! 	}
!       else
!   	strncpy (native->u.syment._n._n_name, ".file", SYMNMLEN);
! 
        auxent = &(native + 1)->u.auxent;
  
*************** coff_fix_symbol_name (abfd, symbol, nati
*** 847,851 ****
    else
      {
!       if (name_length <= SYMNMLEN)
  	{
  	  /* This name will fit into the symbol neatly */
--- 856,860 ----
    else
      {
!       if (name_length <= SYMNMLEN && !bfd_coff_force_symnames_in_strings (abfd))
  	{
  	  /* This name will fit into the symbol neatly */
*************** coff_fix_symbol_name (abfd, symbol, nati
*** 862,866 ****
  	{
  	  long filepos;
! 	  bfd_byte buf[2];
  
  	  /* This name should be written into the .debug section.  For
--- 871,876 ----
  	{
  	  long filepos;
! 	  bfd_byte buf[4];
! 	  int prefix_len = bfd_coff_debug_string_prefix_length (abfd);
  
  	  /* This name should be written into the .debug section.  For
*************** coff_fix_symbol_name (abfd, symbol, nati
*** 872,893 ****
  	    *debug_string_section_p = bfd_get_section_by_name (abfd, ".debug");
  	  filepos = bfd_tell (abfd);
! 	  bfd_put_16 (abfd, name_length + 1, buf);
  	  if (!bfd_set_section_contents (abfd,
  					 *debug_string_section_p,
  					 (PTR) buf,
  					 (file_ptr) *debug_string_size_p,
! 					 (bfd_size_type) 2)
  	      || !bfd_set_section_contents (abfd,
  					    *debug_string_section_p,
  					    (PTR) symbol->name,
  					    ((file_ptr) *debug_string_size_p
! 					     + 2),
  					    (bfd_size_type) name_length + 1))
  	    abort ();
  	  if (bfd_seek (abfd, filepos, SEEK_SET) != 0)
  	    abort ();
! 	  native->u.syment._n._n_n._n_offset = *debug_string_size_p + 2;
  	  native->u.syment._n._n_n._n_zeroes = 0;
! 	  *debug_string_size_p += name_length + 3;
  	}
      }
--- 882,908 ----
  	    *debug_string_section_p = bfd_get_section_by_name (abfd, ".debug");
  	  filepos = bfd_tell (abfd);
! 	  if (prefix_len == 4)
! 	    bfd_put_32 (abfd, name_length + 1, buf);
! 	  else
! 	    bfd_put_16 (abfd, name_length + 1, buf);
! 
  	  if (!bfd_set_section_contents (abfd,
  					 *debug_string_section_p,
  					 (PTR) buf,
  					 (file_ptr) *debug_string_size_p,
! 					 (bfd_size_type) prefix_len)
  	      || !bfd_set_section_contents (abfd,
  					    *debug_string_section_p,
  					    (PTR) symbol->name,
  					    ((file_ptr) *debug_string_size_p
! 					     + prefix_len),
  					    (bfd_size_type) name_length + 1))
  	    abort ();
  	  if (bfd_seek (abfd, filepos, SEEK_SET) != 0)
  	    abort ();
! 	  native->u.syment._n._n_n._n_offset = 
! 	      *debug_string_size_p + prefix_len;
  	  native->u.syment._n._n_n._n_zeroes = 0;
! 	  *debug_string_size_p += name_length + 1 + prefix_len;
  	}
      }
*************** coff_write_symbols (abfd)
*** 1245,1249 ****
  	      /* This is not a COFF symbol, so it certainly is not a
  	         file name, nor does it go in the .debug section.  */
! 	      maxlen = SYMNMLEN;
  	    }
  	  else if (bfd_coff_symname_in_debug (abfd,
--- 1260,1264 ----
  	      /* This is not a COFF symbol, so it certainly is not a
  	         file name, nor does it go in the .debug section.  */
! 	      maxlen = bfd_coff_force_symnames_in_strings (abfd) ? 0 : SYMNMLEN;
  	    }
  	  else if (bfd_coff_symname_in_debug (abfd,
*************** coff_write_symbols (abfd)
*** 1256,1262 ****
  	  else if (c_symbol->native->u.syment.n_sclass == C_FILE
  		   && c_symbol->native->u.syment.n_numaux > 0)
! 	    maxlen = bfd_coff_filnmlen (abfd);
  	  else
! 	    maxlen = SYMNMLEN;
  
  	  if (name_length > maxlen)
--- 1271,1281 ----
  	  else if (c_symbol->native->u.syment.n_sclass == C_FILE
  		   && c_symbol->native->u.syment.n_numaux > 0)
! 	    {
! 	      if (bfd_coff_force_symnames_in_strings (abfd)) 
!       		bfd_write (".file", 1, 6, abfd);
! 	      maxlen = bfd_coff_filnmlen (abfd);
! 	    }
  	  else
! 	    maxlen = bfd_coff_force_symnames_in_strings (abfd) ? 0 : SYMNMLEN;
  
  	  if (name_length > maxlen)
Index: bfd/coffswap.h
===================================================================
RCS file: /cvs/src/src/bfd/coffswap.h,v
retrieving revision 1.6
diff -c -2 -p -r1.6 coffswap.h
*** bfd/coffswap.h	2000/02/10 21:21:55	1.6
--- bfd/coffswap.h	2000/04/24 20:35:11
*************** Foundation, Inc., 59 Temple Place - Suit
*** 169,172 ****
--- 169,175 ----
  #define GET_SCNHDR_NRELOC bfd_h_get_16
  #endif
+ #ifndef MAX_SCNHDR_NRELOC
+ #define MAX_SCNHDR_NRELOC 0xffff
+ #endif
  #ifndef PUT_SCNHDR_NRELOC
  #define PUT_SCNHDR_NRELOC bfd_h_put_16
*************** Foundation, Inc., 59 Temple Place - Suit
*** 175,178 ****
--- 178,184 ----
  #define GET_SCNHDR_NLNNO bfd_h_get_16
  #endif
+ #ifndef MAX_SCNHDR_NLNNO
+ #define MAX_SCNHDR_NLNNO 0xffff
+ #endif
  #ifndef PUT_SCNHDR_NLNNO
  #define PUT_SCNHDR_NLNNO bfd_h_put_16
*************** Foundation, Inc., 59 Temple Place - Suit
*** 185,188 ****
--- 191,200 ----
  #endif
  
+ #ifndef GET_RELOC_VADDR
+ #define GET_RELOC_VADDR bfd_h_get_32
+ #endif
+ #ifndef PUT_RELOC_VADDR
+ #define PUT_RELOC_VADDR bfd_h_put_32
+ #endif
  
  static void coff_swap_aouthdr_in PARAMS ((bfd *, PTR, PTR));
*************** coff_swap_reloc_in (abfd, src, dst)
*** 218,222 ****
    struct internal_reloc *reloc_dst = (struct internal_reloc *) dst;
  
!   reloc_dst->r_vaddr = bfd_h_get_32(abfd, (bfd_byte *)reloc_src->r_vaddr);
    reloc_dst->r_symndx = bfd_h_get_signed_32(abfd, (bfd_byte *) reloc_src->r_symndx);
  
--- 230,234 ----
    struct internal_reloc *reloc_dst = (struct internal_reloc *) dst;
  
!   reloc_dst->r_vaddr = GET_RELOC_VADDR (abfd, (bfd_byte *)reloc_src->r_vaddr);
    reloc_dst->r_symndx = bfd_h_get_signed_32(abfd, (bfd_byte *) reloc_src->r_symndx);
  
*************** coff_swap_reloc_out (abfd, src, dst)
*** 242,246 ****
    struct internal_reloc *reloc_src = (struct internal_reloc *)src;
    struct external_reloc *reloc_dst = (struct external_reloc *)dst;
!   bfd_h_put_32(abfd, reloc_src->r_vaddr, (bfd_byte *) reloc_dst->r_vaddr);
    bfd_h_put_32(abfd, reloc_src->r_symndx, (bfd_byte *) reloc_dst->r_symndx);
  
--- 254,258 ----
    struct internal_reloc *reloc_src = (struct internal_reloc *)src;
    struct external_reloc *reloc_dst = (struct external_reloc *)dst;
!   PUT_RELOC_VADDR (abfd, reloc_src->r_vaddr, (bfd_byte *) reloc_dst->r_vaddr);
    bfd_h_put_32(abfd, reloc_src->r_symndx, (bfd_byte *) reloc_dst->r_symndx);
  
*************** coff_swap_aux_in (abfd, ext1, type, clas
*** 440,465 ****
        goto end;
  
-       /* RS/6000 "csect" auxents */
- #ifdef RS6000COFF_C
-     case C_EXT:
-     case C_HIDEXT:
-       if (indx + 1 == numaux)
- 	{
- 	  in->x_csect.x_scnlen.l = bfd_h_get_32 (abfd, ext->x_csect.x_scnlen);
- 	  in->x_csect.x_parmhash = bfd_h_get_32 (abfd,
- 						 ext->x_csect.x_parmhash);
- 	  in->x_csect.x_snhash   = bfd_h_get_16 (abfd, ext->x_csect.x_snhash);
- 	  /* We don't have to hack bitfields in x_smtyp because it's
- 	     defined by shifts-and-ands, which are equivalent on all
- 	     byte orders.  */
- 	  in->x_csect.x_smtyp    = bfd_h_get_8  (abfd, ext->x_csect.x_smtyp);
- 	  in->x_csect.x_smclas   = bfd_h_get_8  (abfd, ext->x_csect.x_smclas);
- 	  in->x_csect.x_stab     = bfd_h_get_32 (abfd, ext->x_csect.x_stab);
- 	  in->x_csect.x_snstab   = bfd_h_get_16 (abfd, ext->x_csect.x_snstab);
- 	  goto end;
- 	}
-       break;
- #endif
- 
      case C_STAT:
  #ifdef C_LEAFSTAT
--- 452,455 ----
*************** coff_swap_aux_out (abfd, inp, type, clas
*** 559,583 ****
      goto end;
  
- #ifdef RS6000COFF_C
-   /* RS/6000 "csect" auxents */
-   case C_EXT:
-   case C_HIDEXT:
-     if (indx + 1 == numaux)
-       {
- 	PUTWORD (abfd, in->x_csect.x_scnlen.l,	ext->x_csect.x_scnlen);
- 	PUTWORD (abfd, in->x_csect.x_parmhash,	ext->x_csect.x_parmhash);
- 	PUTHALF (abfd, in->x_csect.x_snhash,	ext->x_csect.x_snhash);
- 	/* We don't have to hack bitfields in x_smtyp because it's
- 	   defined by shifts-and-ands, which are equivalent on all
- 	   byte orders.  */
- 	PUTBYTE (abfd, in->x_csect.x_smtyp,	ext->x_csect.x_smtyp);
- 	PUTBYTE (abfd, in->x_csect.x_smclas,	ext->x_csect.x_smclas);
- 	PUTWORD (abfd, in->x_csect.x_stab,	ext->x_csect.x_stab);
- 	PUTHALF (abfd, in->x_csect.x_snstab,	ext->x_csect.x_snstab);
- 	goto end;
-       }
-     break;
- #endif
- 
    case C_STAT:
  #ifdef C_LEAFSTAT
--- 549,552 ----
*************** coff_swap_aouthdr_in (abfd, aouthdr_ext1
*** 706,710 ****
--- 675,683 ----
  
  #ifdef RS6000COFF_C
+ #ifdef XCOFF64
+   aouthdr_int->o_toc = bfd_h_get_64(abfd, aouthdr_ext->o_toc);
+ #else
    aouthdr_int->o_toc = bfd_h_get_32(abfd, aouthdr_ext->o_toc);
+ #endif
    aouthdr_int->o_snentry = bfd_h_get_16(abfd, aouthdr_ext->o_snentry);
    aouthdr_int->o_sntext = bfd_h_get_16(abfd, aouthdr_ext->o_sntext);
*************** coff_swap_aouthdr_in (abfd, aouthdr_ext1
*** 717,723 ****
--- 690,701 ----
    aouthdr_int->o_modtype = bfd_h_get_16(abfd, aouthdr_ext->o_modtype);
    aouthdr_int->o_cputype = bfd_h_get_16(abfd, aouthdr_ext->o_cputype);
+ #ifdef XCOFF64
+   aouthdr_int->o_maxstack = bfd_h_get_64(abfd, aouthdr_ext->o_maxstack);
+   aouthdr_int->o_maxdata = bfd_h_get_64(abfd, aouthdr_ext->o_maxdata);
+ #else
    aouthdr_int->o_maxstack = bfd_h_get_32(abfd, aouthdr_ext->o_maxstack);
    aouthdr_int->o_maxdata = bfd_h_get_32(abfd, aouthdr_ext->o_maxdata);
  #endif
+ #endif
  
  #ifdef MIPSECOFF
*************** coff_swap_aouthdr_out (abfd, in, out)
*** 764,768 ****
--- 742,750 ----
  
  #ifdef RS6000COFF_C
+ #ifdef XCOFF64
+   bfd_h_put_64 (abfd, aouthdr_in->o_toc, aouthdr_out->o_toc);
+ #else
    bfd_h_put_32 (abfd, aouthdr_in->o_toc, aouthdr_out->o_toc);
+ #endif
    bfd_h_put_16 (abfd, aouthdr_in->o_snentry, aouthdr_out->o_snentry);
    bfd_h_put_16 (abfd, aouthdr_in->o_sntext, aouthdr_out->o_sntext);
*************** coff_swap_aouthdr_out (abfd, in, out)
*** 775,781 ****
--- 757,772 ----
    bfd_h_put_16 (abfd, aouthdr_in->o_modtype, aouthdr_out->o_modtype);
    bfd_h_put_16 (abfd, aouthdr_in->o_cputype, aouthdr_out->o_cputype);
+ #ifdef XCOFF64
+   bfd_h_put_64 (abfd, aouthdr_in->o_maxstack, aouthdr_out->o_maxstack);
+   bfd_h_put_64 (abfd, aouthdr_in->o_maxdata, aouthdr_out->o_maxdata);
+ #else
    bfd_h_put_32 (abfd, aouthdr_in->o_maxstack, aouthdr_out->o_maxstack);
    bfd_h_put_32 (abfd, aouthdr_in->o_maxdata, aouthdr_out->o_maxdata);
+ #endif
    memset (aouthdr_out->o_resv2, 0, sizeof aouthdr_out->o_resv2);
+ #ifdef XCOFF64
+   memset (aouthdr_out->o_debugger, 0, sizeof aouthdr_out->o_debugger);
+   memset (aouthdr_out->o_resv3, 0, sizeof aouthdr_out->o_resv3);
+ #endif
  #endif
  
*************** coff_swap_scnhdr_out (abfd, in, out)
*** 880,885 ****
    PUTWORD(abfd, scnhdr_int->s_nreloc, (bfd_byte *) scnhdr_ext->s_nreloc);
  #else
!   if (scnhdr_int->s_nlnno <= 0xffff)
!     PUTHALF(abfd, scnhdr_int->s_nlnno, (bfd_byte *) scnhdr_ext->s_nlnno);
    else
      {
--- 871,877 ----
    PUTWORD(abfd, scnhdr_int->s_nreloc, (bfd_byte *) scnhdr_ext->s_nreloc);
  #else
!   if (scnhdr_int->s_nlnno <= MAX_SCNHDR_NLNNO)
!     PUT_SCNHDR_NLNNO(abfd, scnhdr_int->s_nlnno, 
! 	    (bfd_byte *) scnhdr_ext->s_nlnno);
    else
      {
*************** coff_swap_scnhdr_out (abfd, in, out)
*** 892,899 ****
  	 bfd_get_filename (abfd),
  	 buf, scnhdr_int->s_nlnno);
!       PUTHALF (abfd, 0xffff, (bfd_byte *) scnhdr_ext->s_nlnno);
      }
!   if (scnhdr_int->s_nreloc <= 0xffff)
!     PUTHALF(abfd, scnhdr_int->s_nreloc, (bfd_byte *) scnhdr_ext->s_nreloc);
    else
      {
--- 884,892 ----
  	 bfd_get_filename (abfd),
  	 buf, scnhdr_int->s_nlnno);
!       PUT_SCNHDR_NLNNO(abfd, 0xffff, (bfd_byte *) scnhdr_ext->s_nlnno);
      }
!   if (scnhdr_int->s_nreloc <= MAX_SCNHDR_NRELOC)
!     PUT_SCNHDR_NRELOC(abfd, scnhdr_int->s_nreloc, 
! 	    (bfd_byte *) scnhdr_ext->s_nreloc);
    else
      {
*************** coff_swap_scnhdr_out (abfd, in, out)
*** 906,910 ****
  			     buf, scnhdr_int->s_nreloc);
        bfd_set_error (bfd_error_file_truncated);
!       PUTHALF (abfd, 0xffff, (bfd_byte *) scnhdr_ext->s_nreloc);
        ret = 0;
      }
--- 899,903 ----
  			     buf, scnhdr_int->s_nreloc);
        bfd_set_error (bfd_error_file_truncated);
!       PUT_SCNHDR_NRELOC(abfd, 0xffff, (bfd_byte *) scnhdr_ext->s_nreloc);
        ret = 0;
      }
Index: bfd/config.bfd
===================================================================
RCS file: /cvs/src/src/bfd/config.bfd,v
retrieving revision 1.27
diff -c -2 -p -r1.27 config.bfd
*** bfd/config.bfd	2000/04/24 08:31:33	1.27
--- bfd/config.bfd	2000/04/24 20:35:11
*************** bfd/config.bfd	targ_archs=bfd_mips_arch ;;
*** 43,47 ****
  pj*)	targ_archs="bfd_pj_arch bfd_i386_arch";;
  powerpc*) targ_archs="bfd_rs6000_arch bfd_powerpc_arch" ;;
! rs6000)	targ_archs="bfd_rs6000_arch bfd_powerpc_arch" ;;
  sparc*) targ_archs=bfd_sparc_arch ;;
  v850*)	targ_archs=bfd_v850_arch ;;
--- 43,47 ----
  pj*)	targ_archs="bfd_pj_arch bfd_i386_arch";;
  powerpc*) targ_archs="bfd_rs6000_arch bfd_powerpc_arch" ;;
! rs6000)	targ_archs="bfd_rs6000_arch bfd_powerpc_64_arch bfd_powerpc_arch" ;;
  sparc*) targ_archs=bfd_sparc_arch ;;
  v850*)	targ_archs=bfd_v850_arch ;;
*************** case "${targ}" in
*** 629,632 ****
--- 629,633 ----
    powerpc-*-aix* | powerpc-*-beos*)
      targ_defvec=rs6000coff_vec
+     targ_selvecs="rs6000coff64_vec"
      ;;
    powerpc-*-*bsd* | powerpc-*-elf* | powerpc-*-sysv4* | powerpc-*-eabi* | \
Index: bfd/configure.in
===================================================================
RCS file: /cvs/src/src/bfd/configure.in,v
retrieving revision 1.21
diff -c -2 -p -r1.21 configure.in
*** bfd/configure.in	2000/04/24 08:31:33	1.21
--- bfd/configure.in	2000/04/24 20:35:15
*************** do
*** 575,578 ****
--- 575,580 ----
      newsos3_vec)		tb="$tb newsos3.lo aout32.lo" ;;
      nlm32_i386_vec)		tb="$tb nlm32-i386.lo nlm32.lo nlm.lo" ;;
+     rs6000coff64_vec)		tb="$tb coff64-rs6000.lo xcofflink.lo"
+ 				target64=true ;;
      nlm32_sparc_vec)		tb="$tb nlm32-sparc.lo nlm32.lo nlm.lo" ;;
      nlm32_alpha_vec)		tb="$tb nlm32-alpha.lo nlm32.lo nlm.lo"
Index: bfd/cpu-powerpc.c
===================================================================
RCS file: /cvs/src/src/bfd/cpu-powerpc.c,v
retrieving revision 1.1.1.1
diff -c -2 -p -r1.1.1.1 cpu-powerpc.c
*** bfd/cpu-powerpc.c	1999/05/03 07:28:55	1.1.1.1
--- bfd/cpu-powerpc.c	2000/04/24 20:35:15
*************** static const bfd_arch_info_type arch_inf
*** 104,107 ****
--- 104,121 ----
      powerpc_compatible, 
      bfd_default_scan,
+     &arch_info_struct[4]
+   },
+   { 
+     32,	/* 32 bits in a word */
+     64,	/* 64 bits in an address */
+     8,	/* 8 bits in a byte */
+     bfd_arch_powerpc,
+     620, /* for the mpc620 */
+     "powerpc",
+     "powerpc:620",
+     3,
+     false, /* not the default */
+     powerpc_compatible, 
+     bfd_default_scan,
      0
    }
Index: bfd/libcoff.h
===================================================================
RCS file: /cvs/src/src/bfd/libcoff.h,v
retrieving revision 1.8
diff -c -2 -p -r1.8 libcoff.h
*** bfd/libcoff.h	1999/09/07 04:28:27	1.8
--- bfd/libcoff.h	2000/04/24 20:35:16
*************** typedef struct
*** 714,717 ****
--- 714,719 ----
   boolean _bfd_coff_long_section_names;
   unsigned int _bfd_coff_default_section_alignment_power;
+  boolean _bfd_coff_force_symnames_in_strings;
+  unsigned int _bfd_coff_debug_string_prefix_length;
   void (*_bfd_coff_swap_filehdr_in) PARAMS ((
         bfd     *abfd,
*************** typedef struct
*** 910,913 ****
--- 912,921 ----
  #define bfd_coff_symname_in_debug(abfd, sym)\
          ((coff_backend_info (abfd)->_bfd_coff_symname_in_debug) (abfd, sym))
+ 
+ #define bfd_coff_force_symnames_in_strings(abfd)\
+     	(coff_backend_info (abfd)->_bfd_coff_force_symnames_in_strings)
+ 
+ #define bfd_coff_debug_string_prefix_length(abfd)\
+     	(coff_backend_info (abfd)->_bfd_coff_debug_string_prefix_length)
  
  #define bfd_coff_print_aux(abfd, file, base, symbol, aux, indaux)\
Index: bfd/reloc.c
===================================================================
RCS file: /cvs/src/src/bfd/reloc.c,v
retrieving revision 1.21
diff -c -2 -p -r1.21 reloc.c
*** bfd/reloc.c	2000/04/21 20:22:21	1.21
--- bfd/reloc.c	2000/04/24 20:35:18
*************** bfd_perform_relocation (abfd, reloc_entr
*** 730,733 ****
--- 730,734 ----
  	  if (abfd->xvec->flavour == bfd_target_coff_flavour
  	      && strcmp (abfd->xvec->name, "aixcoff-rs6000") != 0
+ 	      && strcmp (abfd->xvec->name, "aixcoff64-rs6000") != 0
  	      && strcmp (abfd->xvec->name, "xcoff-powermac") != 0
  	      && strcmp (abfd->xvec->name, "coff-Intel-little") != 0
*************** bfd_install_relocation (abfd, reloc_entr
*** 1126,1129 ****
--- 1127,1131 ----
        if (abfd->xvec->flavour == bfd_target_coff_flavour
  	  && strcmp (abfd->xvec->name, "aixcoff-rs6000") != 0
+ 	  && strcmp (abfd->xvec->name, "aixcoff64-rs6000") != 0
  	  && strcmp (abfd->xvec->name, "xcoff-powermac") != 0
  	  && strcmp (abfd->xvec->name, "coff-Intel-little") != 0
Index: bfd/targets.c
===================================================================
RCS file: /cvs/src/src/bfd/targets.c,v
retrieving revision 1.18
diff -c -2 -p -r1.18 targets.c
*** bfd/targets.c	2000/04/24 08:26:09	1.18
--- bfd/targets.c	2000/04/24 20:35:19
*************** extern const bfd_target riscix_vec;
*** 615,618 ****
--- 615,619 ----
  extern const bfd_target pmac_xcoff_vec;
  extern const bfd_target rs6000coff_vec;
+ extern const bfd_target rs6000coff64_vec;
  extern const bfd_target shcoff_vec;
  extern const bfd_target shlcoff_vec;
*************** const bfd_target * const bfd_target_vect
*** 868,871 ****
--- 869,873 ----
  #endif
  	&rs6000coff_vec,
+ 	&rs6000coff64_vec,
  	&ppcboot_vec,
  	&shcoff_vec,
Index: bfd/xcofflink.c
===================================================================
RCS file: /cvs/src/src/bfd/xcofflink.c,v
retrieving revision 1.4
diff -c -2 -p -r1.4 xcofflink.c
*** bfd/xcofflink.c	2000/03/01 19:40:54	1.4
--- bfd/xcofflink.c	2000/04/24 20:35:23
*************** Foundation, Inc., 59 Temple Place - Suit
*** 36,39 ****
--- 36,40 ----
  #define XCOFF_XVECP(xv) \
    (strcmp ((xv)->name, "aixcoff-rs6000") == 0 \
+    || strcmp ((xv)->name, "aixcoff64-rs6000") == 0 \
     || strcmp ((xv)->name, "xcoff-powermac") == 0)
  
Index: gas/as.c
===================================================================
RCS file: /cvs/src/src/gas/as.c,v
retrieving revision 1.9
diff -c -2 -p -r1.9 as.c
*** gas/as.c	2000/04/04 14:32:30	1.9
--- gas/as.c	2000/04/24 20:35:29
*************** the GNU General Public License.  This pr
*** 673,676 ****
--- 673,679 ----
  	  if (optarg)
  	    {
+ 	      if (md_parse_option (optc, optarg) != 0)
+ 		break;
+ 
  	      while (*optarg)
  		{
Index: gas/config/obj-coff.c
===================================================================
RCS file: /cvs/src/src/gas/config/obj-coff.c,v
retrieving revision 1.22
diff -c -2 -p -r1.22 obj-coff.c
*** gas/config/obj-coff.c	2000/02/22 07:50:13	1.22
--- gas/config/obj-coff.c	2000/04/24 20:35:32
*************** static void
*** 430,434 ****
  add_lineno (frag, offset, num)
       fragS *frag;
!      int offset;
       int num;
  {
--- 430,434 ----
  add_lineno (frag, offset, num)
       fragS *frag;
!      addressT offset;
       int num;
  {
Index: gas/config/tc-ppc.c
===================================================================
RCS file: /cvs/src/src/gas/config/tc-ppc.c,v
retrieving revision 1.9
diff -c -2 -p -r1.9 tc-ppc.c
*** gas/config/tc-ppc.c	2000/04/02 06:27:51	1.9
--- gas/config/tc-ppc.c	2000/04/24 20:35:34
*************** static void ppc_rename PARAMS ((int));
*** 87,90 ****
--- 87,91 ----
  static void ppc_toc PARAMS ((int));
  static void ppc_xcoff_cons PARAMS ((int));
+ static void ppc_machine PARAMS ((int));
  static void ppc_vbyte PARAMS ((int));
  #endif
*************** const pseudo_typeS md_pseudo_table[] =
*** 183,189 ****
--- 184,192 ----
    { "toc",	ppc_toc,	0 },
    { "long",	ppc_xcoff_cons,	2 },
+   { "llong",	ppc_xcoff_cons,	3 },
    { "word",	ppc_xcoff_cons,	1 },
    { "short",	ppc_xcoff_cons,	1 },
    { "vbyte",    ppc_vbyte,	0 },
+   { "machine",  ppc_machine,    0 },
  #endif
  
*************** static int ppc_cpu = 0;
*** 592,595 ****
--- 595,601 ----
  static unsigned long ppc_size = PPC_OPCODE_32;
  
+ /* Whether to target xcoff64 */
+ static int ppc_xcoff64 = 0;
+ 
  /* Opcode hash table.  */
  static struct hash_control *ppc_hash;
*************** md_parse_option (c, arg)
*** 741,744 ****
--- 747,760 ----
  #endif
  
+       /* a64 and a32 determine whether to use XCOFF64 or XCOFF32.  */
+     case 'a':
+       if (strcmp (arg, "64") == 0)
+ 	ppc_xcoff64 = 1;
+       else if (strcmp (arg, "32") == 0)
+ 	ppc_xcoff64 = 0;
+       else
+ 	return 0;
+       break;
+ 	
      case 'm':
        /* -mpwrx and -mpwr2 mean to assemble for the IBM POWER/2
*************** ppc_arch ()
*** 949,952 ****
--- 965,999 ----
  }
  
+ unsigned long
+ ppc_mach ()
+ {
+   return (ppc_size == PPC_OPCODE_64) ? 620 : 0;
+ }
+ 
+ int
+ ppc_subseg_align()
+ {
+   return (ppc_xcoff64) ? 3 : 2;
+ }
+ 
+ extern char* 
+ ppc_target_format()
+ {
+ #ifdef OBJ_COFF
+ #ifdef TE_PE
+   return (target_big_endian ? "pe-powerpc" : "pe-powerpcle");
+ #elif TE_POWERMAC
+ #else
+   return (ppc_xcoff64 ? "aixcoff64-rs6000" : "aixcoff-rs6000");
+ #endif
+ #ifdef TE_POWERMAC
+   return "xcoff-powermac";
+ #endif
+ #endif
+ #ifdef OBJ_ELF
+   return (target_big_endian ? "elf32-powerpc" : "elf32-powerpcle");
+ #endif
+ }
+ 
  /* This function is called when the assembler starts up.  It is called
     after the options have been parsed and the output file has been
*************** ppc_change_csect (sym)
*** 2479,2483 ****
        S_SET_VALUE (sym, (valueT) frag_now_fix ());
  
!       symbol_get_tc (sym)->align = 2;
        symbol_get_tc (sym)->output = 1;
        symbol_get_tc (sym)->within = sym;
--- 2526,2530 ----
        S_SET_VALUE (sym, (valueT) frag_now_fix ());
  
!       symbol_get_tc (sym)->align = (ppc_xcoff64) ? 3 : 2;
        symbol_get_tc (sym)->output = 1;
        symbol_get_tc (sym)->within = sym;
*************** ppc_xcoff_cons (log_size)
*** 3151,3154 ****
--- 3198,3209 ----
  
  static void
+ ppc_machine(dummy) 
+     int dummy;
+ {
+     discard_rest_of_line();
+    /* What does aix use this for?  */
+ }
+ 
+ static void
  ppc_vbyte (dummy)
       int dummy;
*************** ppc_tc (ignore)
*** 3270,3274 ****
      {
        ++input_line_pointer;
!       cons (4);
      }
  }
--- 3325,3329 ----
      {
        ++input_line_pointer;
!       cons ((ppc_size == PPC_OPCODE_64) ? 8 : 4);
      }
  }
*************** md_apply_fix3 (fixp, valuep, seg)
*** 4803,4807 ****
  	       && operand->bits == 16
  	       && operand->shift == 0
- 	       && operand->insert == NULL
  	       && fixp->fx_addsy != NULL
  	       && ppc_is_toc_sym (fixp->fx_addsy))
--- 4858,4861 ----
*************** md_apply_fix3 (fixp, valuep, seg)
*** 4850,4853 ****
--- 4904,4915 ----
  	  break;
  
+ 	case BFD_RELOC_64:
+ 	  if (fixp->fx_pcrel)
+ 	    fixp->fx_r_type = BFD_RELOC_64_PCREL;
+ 					/* fall through */
+ 	case BFD_RELOC_64_PCREL:
+ 	  md_number_to_chars (fixp->fx_frag->fr_literal + fixp->fx_where,
+ 			      value, 8);
+ 	  break;  
  	case BFD_RELOC_LO16:
  	case BFD_RELOC_16:
Index: gas/config/tc-ppc.h
===================================================================
RCS file: /cvs/src/src/gas/config/tc-ppc.h,v
retrieving revision 1.5
diff -c -2 -p -r1.5 tc-ppc.h
*** gas/config/tc-ppc.h	2000/01/31 19:13:47	1.5
--- gas/config/tc-ppc.h	2000/04/24 20:35:34
*************** struct fix;
*** 48,52 ****
--- 48,54 ----
  /* The target BFD architecture.  */
  #define TARGET_ARCH (ppc_arch ())
+ #define TARGET_MACH (ppc_mach ())
  extern enum bfd_architecture ppc_arch PARAMS ((void));
+ extern unsigned long ppc_mach PARAMS ((void));
  
  /* Whether or not the target is big endian */
*************** extern int target_big_endian;
*** 54,76 ****
  
  /* The target BFD format.  */
! #ifdef OBJ_COFF
! #ifdef TE_PE
! #define TARGET_FORMAT (target_big_endian ? "pe-powerpc" : "pe-powerpcle")
! #else
! #define TARGET_FORMAT "aixcoff-rs6000"
! #endif
! #endif
! 
! /* PowerMac has a BFD slightly different from AIX's.  */
! #ifdef TE_POWERMAC
! #ifdef TARGET_FORMAT
! #undef TARGET_FORMAT
! #endif
! #define TARGET_FORMAT "xcoff-powermac"
! #endif
! 
! #ifdef OBJ_ELF
! #define TARGET_FORMAT (target_big_endian ? "elf32-powerpc" : "elf32-powerpcle")
! #endif
  
  /* Permit temporary numeric labels.  */
--- 56,61 ----
  
  /* The target BFD format.  */
! #define TARGET_FORMAT (ppc_target_format ())
! extern char* ppc_target_format ();
  
  /* Permit temporary numeric labels.  */
*************** extern void ppc_adjust_symtab PARAMS ((v
*** 187,191 ****
  
  /* Niclas Andersson <nican@ida.liu.se> says this is needed.  */
! #define SUB_SEGMENT_ALIGN(SEG) 2
  
  /* We also need to copy, in particular, the class of the symbol,
--- 172,177 ----
  
  /* Niclas Andersson <nican@ida.liu.se> says this is needed.  */
! extern int ppc_subseg_align PARAMS ((void));
! #define SUB_SEGMENT_ALIGN(SEG) ppc_subseg_align()
  
  /* We also need to copy, in particular, the class of the symbol,
Index: opcodes/configure.in
===================================================================
RCS file: /cvs/src/src/opcodes/configure.in,v
retrieving revision 1.7
diff -c -2 -p -r1.7 configure.in
*** opcodes/configure.in	2000/04/21 20:22:23	1.7
--- opcodes/configure.in	2000/04/24 20:35:44
*************** if test x${all_targets} = xfalse ; then
*** 181,184 ****
--- 181,185 ----
  	bfd_romp_arch)		;;
  	bfd_rs6000_arch)	ta="$ta ppc-dis.lo ppc-opc.lo" ;;
+ 	bfd_powerpc_64_arch)	ta="$ta ppc-dis.lo ppc-opc.lo" ;;
  	bfd_sh_arch)		ta="$ta sh-dis.lo" ;;
  	bfd_sparc_arch)		ta="$ta sparc-dis.lo sparc-opc.lo" ;;
Index: opcodes/disassemble.c
===================================================================
RCS file: /cvs/src/src/opcodes/disassemble.c,v
retrieving revision 1.10
diff -c -2 -p -r1.10 disassemble.c
*** opcodes/disassemble.c	2000/04/21 20:22:23	1.10
--- opcodes/disassemble.c	2000/04/24 20:35:44
*************** disassembler (abfd)
*** 217,221 ****
  #ifdef ARCH_rs6000
      case bfd_arch_rs6000:
!       disassemble = print_insn_rs6000;
        break;
  #endif
--- 217,224 ----
  #ifdef ARCH_rs6000
      case bfd_arch_rs6000:
!       if (bfd_get_mach (abfd) == 620)
! 	disassemble = print_insn_big_powerpc;
!       else
! 	disassemble = print_insn_rs6000;
        break;
  #endif

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