This is the mail archive of the
binutils@sourceware.cygnus.com
mailing list for the binutils project.
XCOFF64 bfd changes
- To: binutils at sourceware dot cygnus dot com
- Subject: XCOFF64 bfd changes
- From: Clinton Popetz <cpopetz at cygnus dot com>
- Date: Fri, 7 Apr 2000 16:54:25 -0500
This first set of changes is to add XCOFF64 support to bfd. The second set,
in a separate message, will add the tweaks necessary to make gas happy with
ppc64 for aix, and a small change to the disassembler.
The symbol table has gotten complex enough with XCOFF64 to warrant pulling the
xcoff hacks out of coffswap, and having xcoff specific coff_SWAP_* routines in
coff-rs6000.c for the symbol tables.
There are two new hooks in bfd_coff_backend_data: one because the xcoff64
doesn't write small symbol names directly in the syment, and another because
the length prefix for the debug strings is 4 bytes instead of two.
bfd/ChangeLog:
2000-04-07 Clinton Popetz <cpopetz@cygnus.com>
* 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.
* coff-rs6000-64.c: New file for XCOFF64 target.
* coff-rs6000.c (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.
(NO_COFF_LINENOS, coff_SWAP_lineno_in, coff_SWAP_lineno_in): For
XCOFF64, handle line number 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.
* 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.
* Makefile.am (coff-rs6000-64.lo): New rule.
* Makefile.in: Regenerate.
* targets.c (rs6000coff64_vec): Extern declaration.
(bfd_target_vect): Add rs6000coff64_vec.
* config.bfd: Add bfd_rs6000_64_arch to targ_arch and define
targ_selvecs to include rs6000coff64_vec for rs6000.
* configre.in: Add rs6000coff64_vec case.
* cpu-powerpc.c: New bfd_arch_info_type.
* cpu-rs6000.c: Ditto.
* coff-tic54x.c (ticof): Keep up to date with new fields
in bfd_coff_backend_data.
include/ChangeLog:
2000-04-07 Clinton Popetz <cpopetz@cygnus.com>
* coff/rs6000.h (OFFSETSZ, HALFSZ): New macros to conditionalize
structures for XCOFF64.
(external_filehdr, AOUTHDR, AOUTSZ, SMALL_AOUTSZ, external_scnhdr,
SCNHSZ, external_lineno, LINESZ, external_syment, external_auxent,
external_reloc, RELSZ): Support XCOFF64.
(_AUX_EXCEPT, _AUX_FCN, _AUX_SYM, _AUX_FILE, _AUX_CSECT): New.
(U802TOC64MAGIC): New.
(BADMAG): Accept XCOFF64 magic.
*** bfd/coff-rs6000-64.c Wed Dec 31 18:00:00 1969
--- bfd/coff-rs6000-64.c Wed Mar 29 13:50:20 2000
***************
*** 0 ****
--- 1,51 ----
+ #include "bfd.h"
+
+ #define XCOFF64
+
+ #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)
+
+ #include "coff-rs6000.c"
Index: bfd/Makefile.am
===================================================================
RCS file: /cvs/src/src/bfd/Makefile.am,v
retrieving revision 1.15
diff -c -2 -p -r1.15 Makefile.am
*** bfd/Makefile.am 2000/03/27 08:39:12 1.15
--- bfd/Makefile.am 2000/04/07 21:32:09
*************** coff-rs6000.lo: coff-rs6000.c $(INCDIR)/
*** 801,804 ****
--- 801,807 ----
$(INCDIR)/coff/rs6000.h libcoff.h $(INCDIR)/bfdlink.h \
coffcode.h coffswap.h
+ coff-rs6000-64.lo: coff-rs6000-64.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.17
diff -c -2 -p -r1.17 Makefile.in
*** bfd/Makefile.in 2000/03/27 08:39:12 1.17
--- bfd/Makefile.in 2000/04/07 21:32:10
*************** coff-rs6000.lo: coff-rs6000.c $(INCDIR)/
*** 1329,1332 ****
--- 1329,1335 ----
$(INCDIR)/coff/rs6000.h libcoff.h $(INCDIR)/bfdlink.h \
coffcode.h coffswap.h
+ coff-rs6000-64.lo: coff-rs6000-64.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/07 21:32:11
*************** xcoff_is_local_label_name (abfd, name)
*** 147,150 ****
--- 147,555 ----
}
+
+ #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 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;
+
+
+ #ifndef XCOFF64
+ 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);
+ }
+ #else
+ in->_n._n_n._n_zeroes = 0;
+ in->_n._n_n._n_offset = bfd_h_get_32(abfd, (bfd_byte *) ext->e_offset);
+ #endif
+
+ #ifdef XCOFF64
+ in->n_value = bfd_h_get_64(abfd, (bfd_byte *) ext->e.e_value);
+ #else
+ in->n_value = bfd_h_get_32(abfd, (bfd_byte *) ext->e_value);
+ #endif
+ 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;
+
+ #ifndef XCOFF64
+ 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);
+ }
+ #else
+ bfd_h_put_32(abfd, in->_n._n_n._n_offset, (bfd_byte *) ext->e_offset);
+ #endif
+ #ifdef XCOFF64
+ bfd_h_put_64(abfd, in->n_value , (bfd_byte *) ext->e.e_value);
+ #else
+ bfd_h_put_32(abfd, in->n_value , (bfd_byte *) ext->e_value);
+ #endif
+ 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)
+ {
+ #ifdef XCOFF64
+ 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. */
+ #else
+ in->x_csect.x_scnlen.l =
+ bfd_h_get_32 (abfd, ext->x_csect.x_scnlen);
+ #endif
+ 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);
+ #ifndef XCOFF64
+ 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);
+ #endif
+ goto end;
+ }
+ break;
+
+ case C_STAT:
+ case C_LEAFSTAT:
+ case C_HIDDEN:
+ if (type == T_NULL) {
+ #ifndef XCOFF64
+ 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);
+ #endif
+ /* 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;
+ }
+
+ #ifndef XCOFF64
+ 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);
+ #endif
+
+ if (class == C_BLOCK || class == C_FCN || ISFCN (type) || ISTAG (class))
+ {
+ #ifdef XCOFF64
+ 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);
+ #else
+ 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);
+ #endif
+ 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);
+ }
+ #ifndef XCOFF64
+ 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]);
+ }
+ #endif
+ 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 {
+ #ifdef XCOFF64
+ 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);
+ #else
+ in->x_sym.x_misc.x_lnsz.x_lnno = bfd_h_get_16(abfd, (bfd_byte *)
+ ext->x_sym.x_fcnary.x_lnsz.x_lnno);
+ #endif
+ 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
+ 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);
+ }
+ #ifdef XCOFF64
+ PUTBYTE (abfd, _AUX_FILE, (bfd_byte *) ext->x_auxtype.x_auxtype);
+ #endif
+ goto end;
+
+ /* RS/6000 "csect" auxents */
+ case C_EXT:
+ case C_HIDEXT:
+ if (indx + 1 == numaux)
+ {
+ #ifdef XCOFF64
+ PUTWORD (abfd, in->x_csect.x_scnlen.l, ext->x_csect.x_scnlen_lo);
+ #else
+ PUTWORD (abfd, in->x_csect.x_scnlen.l,ext->x_csect.x_scnlen);
+ #endif
+ 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);
+ #ifdef XCOFF64
+ PUTBYTE (abfd, _AUX_CSECT, (bfd_byte *) ext->x_auxtype.x_auxtype);
+ #else
+ PUTWORD (abfd, in->x_csect.x_stab, ext->x_csect.x_stab);
+ PUTHALF (abfd, in->x_csect.x_snstab, ext->x_csect.x_snstab);
+ #endif
+ goto end;
+ }
+ break;
+
+ case C_STAT:
+ case C_LEAFSTAT:
+ case C_HIDDEN:
+ if (type == T_NULL) {
+ #ifndef XCOFF64
+ 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);
+ #endif
+ goto end;
+ }
+ break;
+ }
+
+ #ifndef XCOFF64
+ 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);
+ #endif
+
+ if (class == C_BLOCK || class == C_FCN || ISFCN (type) || ISTAG (class))
+ {
+ #ifdef XCOFF64
+ 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);
+ #else
+ 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);
+ #endif
+ PUTWORD(abfd, in->x_sym.x_fcnary.x_fcn.x_endndx.l,
+ (bfd_byte *) ext->x_sym.x_fcnary.x_fcn.x_endndx);
+ }
+ #ifndef XCOFF64
+ 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]);
+ }
+ #endif
+
+ if (ISFCN (type))
+ PUTWORD (abfd, in->x_sym.x_misc.x_fsize,
+ (bfd_byte *) ext->x_sym.x_fcnary.x_fcn.x_fsize);
+ else
+ {
+ #ifdef XCOFF64
+ 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);
+ #else
+ bfd_h_put_16(abfd, in->x_sym.x_misc.x_lnsz.x_lnno,
+ (bfd_byte *)ext->x_sym.x_fcnary.x_lnsz.x_lnno);
+ #endif
+ 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);
+ }
+
+ #ifdef XCOFF64
+ #define NO_COFF_LINENOS
+
+ #define coff_SWAP_lineno_in xcoff64_swap_lineno_in
+ #define coff_SWAP_lineno_out xcoff64_swap_lineno_out
+
+ /* 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);
+ }
+
+ #endif
+
+
/* 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,156 ****
--- 558,565 ----
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)
+
static reloc_howto_type xcoff_howto_table[] =
{
*************** static reloc_howto_type xcoff_howto_tabl
*** 494,498 ****
--- 903,921 ----
0xffff, /* src_mask */
0xffff, /* 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 */
+
};
*************** xcoff_reloc_type_lookup (abfd, code)
*** 588,591 ****
--- 1011,1016 ----
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 ****
--- 1034,1041 ----
#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
Index: bfd/coff-tic54x.c
===================================================================
RCS file: /cvs/src/src/bfd/coff-tic54x.c,v
retrieving revision 1.1
diff -c -2 -p -r1.1 coff-tic54x.c
*** bfd/coff-tic54x.c 2000/04/07 17:06:57 1.1
--- bfd/coff-tic54x.c 2000/04/07 21:32:12
*************** static CONST bfd_coff_backend_data ticof
*** 367,370 ****
--- 367,380 ----
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
*** 399,402 ****
--- 409,422 ----
#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.33
diff -c -2 -p -r1.33 coffcode.h
*** bfd/coffcode.h 2000/03/01 20:39:07 1.33
--- bfd/coffcode.h 2000/04/07 21:32:14
*************** coff_set_arch_mach_hook (abfd, filehdr)
*** 1868,1871 ****
--- 1868,1872 ----
case U802WRMAGIC:
case U802TOCMAGIC:
+ case U802TOC64MAGIC:
{
int cputype;
*************** coff_set_arch_mach_hook (abfd, filehdr)
*** 1894,1898 ****
return false;
}
! coff_swap_sym_in (abfd, (PTR) buf, (PTR) &sym);
if (sym.n_sclass == C_FILE)
cputype = sym.n_type & 0xff;
--- 1895,1899 ----
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)
*** 1916,1920 ****
--- 1917,1925 ----
#else
arch = bfd_arch_rs6000;
+ #ifdef XCOFF64
+ machine = 620;
+ #else
machine = 6000;
+ #endif
#endif /* POWERMAC */
break;
*************** symname_in_debug_hook (abfd, sym)
*** 2058,2061 ****
--- 2063,2070 ----
#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)
*** 2572,2576 ****
case bfd_arch_powerpc:
#endif
! *magicp = U802TOCMAGIC;
return true;
break;
--- 2581,2588 ----
case bfd_arch_powerpc:
#endif
! if (bfd_get_mach (abfd) == 620 && !strncmp (abfd->xvec->name,"aix", 3))
! *magicp = U802TOC64MAGIC;
! else
! *magicp = U802TOCMAGIC;
return true;
break;
*************** coff_compute_section_file_positions (abf
*** 2680,2685 ****
len = strlen (bfd_asymbol_name (*symp));
! if (len > SYMNMLEN)
! sz += len + 3;
}
}
--- 2692,2697 ----
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)
*** 3206,3210 ****
hasdebug = true;
! #ifdef RS6000COFF_C
/* Indicate the use of an XCOFF overflow section header. */
if (current->reloc_count >= 0xffff || current->lineno_count >= 0xffff)
--- 3218,3223 ----
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)
*** 3214,3217 ****
--- 3227,3231 ----
}
#endif
+ #endif
section.s_flags = sec_to_styp_flags (current->name, current->flags);
*************** coff_slurp_line_table (abfd, asect)
*** 3948,3952 ****
{
struct internal_lineno dst;
! coff_swap_lineno_in (abfd, src, &dst);
cache_ptr->line_number = dst.l_lnno;
--- 3962,3966 ----
{
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
*** 4883,4888 ****
#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,
--- 4897,4912 ----
#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.11
diff -c -2 -p -r1.11 coffgen.c
*** bfd/coffgen.c 2000/02/09 13:41:44 1.11
--- bfd/coffgen.c 2000/04/07 21:32:16
*************** coff_fix_symbol_name (abfd, symbol, nati
*** 817,821 ****
unsigned int filnmlen;
! strncpy (native->u.syment._n._n_name, ".file", SYMNMLEN);
auxent = &(native + 1)->u.auxent;
--- 817,830 ----
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
*** 844,848 ****
else
{
! if (name_length <= SYMNMLEN)
{
/* This name will fit into the symbol neatly */
--- 853,857 ----
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
*** 859,863 ****
{
long filepos;
! bfd_byte buf[2];
/* This name should be written into the .debug section. For
--- 868,873 ----
{
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
*** 869,890 ****
*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;
}
}
--- 879,905 ----
*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)
*** 1242,1246 ****
/* 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,
--- 1257,1261 ----
/* 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)
*** 1253,1259 ****
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)
--- 1268,1278 ----
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/07 21:32:16
*************** 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.22
diff -c -2 -p -r1.22 config.bfd
*** bfd/config.bfd 2000/03/27 08:39:12 1.22
--- bfd/config.bfd 2000/04/07 21:32:17
*************** bfd/config.bfd targ_archs=bfd_mips_arch ;;
*** 42,46 ****
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 ;;
--- 42,46 ----
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_rs6000_64_arch bfd_powerpc_arch" ;;
sparc*) targ_archs=bfd_sparc_arch ;;
v850*) targ_archs=bfd_v850_arch ;;
*************** case "${targ}" in
*** 604,607 ****
--- 604,608 ----
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.16
diff -c -2 -p -r1.16 configure.in
*** bfd/configure.in 2000/04/03 21:48:31 1.16
--- bfd/configure.in 2000/04/07 21:32:19
*************** do
*** 542,545 ****
--- 542,547 ----
newsos3_vec) tb="$tb newsos3.lo aout32.lo" ;;
nlm32_i386_vec) tb="$tb nlm32-i386.lo nlm32.lo nlm.lo" ;;
+ rs6000coff64_vec) tb="$tb coff-rs6000-64.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/07 21:32:19
*************** 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/cpu-rs6000.c
===================================================================
RCS file: /cvs/src/src/bfd/cpu-rs6000.c,v
retrieving revision 1.1.1.1
diff -c -2 -p -r1.1.1.1 cpu-rs6000.c
*** bfd/cpu-rs6000.c 1999/05/03 07:28:55 1.1.1.1
--- bfd/cpu-rs6000.c 2000/04/07 21:32:19
*************** rs6000_compatible (a,b)
*** 54,57 ****
--- 54,73 ----
}
+ const bfd_arch_info_type bfd_rs6000_64_arch =
+ {
+ 32, /* 32 bits in a word */
+ 32, /* 32 bits in an address */
+ 8, /* 8 bits in a byte */
+ bfd_arch_rs6000,
+ 620 ,
+ "rs6000",
+ "rs6000:620",
+ 3,
+ false,
+ rs6000_compatible,
+ bfd_default_scan,
+ 0,
+ };
+
const bfd_arch_info_type bfd_rs6000_arch =
{
*************** const bfd_arch_info_type bfd_rs6000_arch
*** 67,70 ****
rs6000_compatible,
bfd_default_scan,
! 0,
};
--- 83,88 ----
rs6000_compatible,
bfd_default_scan,
! &bfd_rs6000_64_arch,
};
+
+
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/07 21:32:19
*************** 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.16
diff -c -2 -p -r1.16 reloc.c
*** bfd/reloc.c 2000/03/27 08:39:12 1.16
--- bfd/reloc.c 2000/04/07 21:32:19
*************** 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.14
diff -c -2 -p -r1.14 targets.c
*** bfd/targets.c 2000/03/27 08:39:12 1.14
--- bfd/targets.c 2000/04/07 21:32:20
*************** extern const bfd_target riscix_vec;
*** 610,613 ****
--- 610,614 ----
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
*** 849,852 ****
--- 850,854 ----
#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/07 21:32:24
*************** 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: include/coff/rs6000.h
===================================================================
RCS file: /cvs/src/src/include/coff/rs6000.h,v
retrieving revision 1.1.1.1
diff -c -2 -p -r1.1.1.1 rs6000.h
*** include/coff/rs6000.h 1999/05/03 07:29:03 1.1.1.1
--- include/coff/rs6000.h 2000/04/07 21:32:24
***************
*** 8,11 ****
--- 8,19 ----
and John Gilmore of Cygnus Support. */
+ #ifdef XCOFF64
+ #define OFFSETSZ 8
+ #define HALFSZ 4
+ #else
+ #define OFFSETSZ 4
+ #define HALFSZ 2
+ #endif
+
/********************** FILE HEADER **********************/
*************** struct external_filehdr {
*** 14,21 ****
char f_nscns[2]; /* number of sections */
char f_timdat[4]; /* time & date stamp */
! char f_symptr[4]; /* file pointer to symtab */
char f_nsyms[4]; /* number of symtab entries */
char f_opthdr[2]; /* sizeof(optional hdr) */
char f_flags[2]; /* flags */
};
--- 22,34 ----
char f_nscns[2]; /* number of sections */
char f_timdat[4]; /* time & date stamp */
! char f_symptr[OFFSETSZ];/* file pointer to symtab */
! #ifndef XCOFF64
char f_nsyms[4]; /* number of symtab entries */
+ #endif
char f_opthdr[2]; /* sizeof(optional hdr) */
char f_flags[2]; /* flags */
+ #ifdef XCOFF64
+ char f_nsyms[4]; /* number of symtab entries */
+ #endif
};
*************** struct external_filehdr {
*** 24,36 ****
#define U802ROMAGIC 0735 /* readonly sharable text segments */
#define U802TOCMAGIC 0737 /* readonly text segments and TOC */
#define BADMAG(x) \
((x).f_magic != U802ROMAGIC && (x).f_magic != U802WRMAGIC && \
(x).f_magic != U802TOCMAGIC)
#define FILHDR struct external_filehdr
#define FILHSZ 20
-
/********************** AOUT "OPTIONAL HEADER" **********************/
--- 37,57 ----
#define U802ROMAGIC 0735 /* readonly sharable text segments */
#define U802TOCMAGIC 0737 /* readonly text segments and TOC */
+ #define U802TOC64MAGIC 0757 /* readonly text segments and TOC, XCOFF64 */
+ #ifdef XCOFF64
+ #define BADMAG(x) ((x).f_magic != U802TOC64MAGIC)
+ #else
#define BADMAG(x) \
((x).f_magic != U802ROMAGIC && (x).f_magic != U802WRMAGIC && \
(x).f_magic != U802TOCMAGIC)
+ #endif
#define FILHDR struct external_filehdr
+ #ifdef XCOFF64
+ #define FILHSZ 24
+ #else
#define FILHSZ 20
+ #endif
/********************** AOUT "OPTIONAL HEADER" **********************/
*************** struct external_filehdr {
*** 38,68 ****
typedef struct
{
! unsigned char magic[2]; /* type of file */
! unsigned char vstamp[2]; /* version stamp */
! unsigned char tsize[4]; /* text size in bytes, padded to FW bdry */
! unsigned char dsize[4]; /* initialized data " " */
! unsigned char bsize[4]; /* uninitialized data " " */
! unsigned char entry[4]; /* entry pt. */
! unsigned char text_start[4]; /* base of text used for this file */
! unsigned char data_start[4]; /* base of data used for this file */
! unsigned char o_toc[4]; /* 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_maxstack[4]; /* max stack size (??) */
! unsigned char o_maxdata[4]; /* max data size (??) */
! unsigned char o_resv2[12]; /* reserved */
}
AOUTHDR;
#define AOUTSZ 72
#define SMALL_AOUTSZ (28)
#define AOUTHDRSZ 72
--- 59,112 ----
typedef struct
{
! unsigned char magic[2]; /* type of file */
! unsigned char vstamp[2]; /* version stamp */
! #ifdef XCOFF64
! unsigned char o_debugger[4]; /* reserved */
! #else
! unsigned char tsize[4]; /* text size bytes, padded to FW bdry */
! unsigned char dsize[4]; /* initialized data " " */
! unsigned char bsize[4]; /* uninitialized data " " */
! unsigned char entry[4]; /* entry pt. */
! #endif
! unsigned char text_start[OFFSETSZ]; /* base of text used for this file */
! unsigned char data_start[OFFSETSZ]; /* base of data used for this file */
! unsigned char o_toc[OFFSETSZ]; /* 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 */
! #ifdef XCOFF64
! 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. */
! #endif
! unsigned char o_maxstack[OFFSETSZ]; /* max stack size (??) */
! unsigned char o_maxdata[OFFSETSZ]; /* max data size (??) */
! #ifdef XCOFF64
! unsigned char o_resv3[116]; /* reserved */
! #else
! unsigned char o_resv2[12]; /* reserved */
! #endif
}
AOUTHDR;
+ #ifdef XCOFF64
+ #define AOUTSZ 220
+ #else
#define AOUTSZ 72
+ #endif
+ #ifdef XCOFF64
+ #define SMALL_AOUTSZ (0)
+ #else
#define SMALL_AOUTSZ (28)
+ #endif
#define AOUTHDRSZ 72
*************** AOUTHDR;
*** 76,89 ****
struct external_scnhdr {
! char s_name[8]; /* section name */
! char s_paddr[4]; /* physical address, aliased s_nlib */
! char s_vaddr[4]; /* virtual address */
! char s_size[4]; /* section size */
! char s_scnptr[4]; /* file ptr to raw data for section */
! char s_relptr[4]; /* file ptr to relocation */
! char s_lnnoptr[4]; /* file ptr to line numbers */
! char s_nreloc[2]; /* number of relocation entries */
! char s_nlnno[2]; /* number of line number entries*/
! char s_flags[4]; /* flags */
};
--- 120,136 ----
struct external_scnhdr {
! char s_name[8]; /* section name */
! char s_paddr[OFFSETSZ]; /* physical address, aliased s_nlib */
! char s_vaddr[OFFSETSZ]; /* virtual address */
! char s_size[OFFSETSZ]; /* section size */
! char s_scnptr[OFFSETSZ]; /* file ptr to raw data for section */
! char s_relptr[OFFSETSZ]; /* file ptr to relocation */
! char s_lnnoptr[OFFSETSZ]; /* file ptr to line numbers */
! char s_nreloc[HALFSZ]; /* number of relocation entries */
! char s_nlnno[HALFSZ]; /* number of line number entries*/
! char s_flags[4]; /* flags */
! #ifdef XCOFF64
! char s_pad[4]; /* padding */
! #endif
};
*************** struct external_scnhdr {
*** 98,102 ****
--- 145,154 ----
#define SCNHDR struct external_scnhdr
+
+ #ifdef XCOFF64
+ #define SCNHSZ 72
+ #else
#define SCNHSZ 40
+ #endif
/* XCOFF uses a special .loader section with type STYP_LOADER. */
*************** struct external_scnhdr {
*** 119,131 ****
struct external_lineno {
union {
! char l_symndx[4]; /* function name symbol index, iff l_lnno == 0*/
! char l_paddr[4]; /* (physical) address of line number */
} l_addr;
! char l_lnno[2]; /* line number */
};
#define LINENO struct external_lineno
#define LINESZ 6
--- 171,188 ----
struct external_lineno {
union {
! char l_symndx[OFFSETSZ];/* function name symbol index, iff l_lnno == 0*/
! char l_paddr[OFFSETSZ]; /* (physical) address of line number */
} l_addr;
! char l_lnno[HALFSZ]; /* line number */
};
#define LINENO struct external_lineno
+
+ #ifdef XCOFF64
+ #define LINESZ 12
+ #else
#define LINESZ 6
+ #endif
*************** struct external_syment
*** 139,142 ****
--- 196,202 ----
{
union {
+ #ifdef XCOFF64
+ char e_value[8];
+ #else
char e_name[E_SYMNMLEN];
struct {
*************** struct external_syment
*** 144,149 ****
--- 204,214 ----
char e_offset[4];
} e;
+ #endif
} e;
+ #ifdef XCOFF64
+ char e_offset[4];
+ #else
char e_value[4];
+ #endif
char e_scnum[2];
char e_type[2];
*************** struct external_syment
*** 161,215 ****
union external_auxent {
struct {
! char x_tagndx[4]; /* str, un, or enum tag indx */
! union {
! struct {
! char x_lnno[2]; /* declaration line number */
! char x_size[2]; /* str/union/array size */
! } x_lnsz;
! char x_fsize[4]; /* size of function */
! } x_misc;
! union {
! struct { /* if ISFCN, tag, or .bb */
! char x_lnnoptr[4]; /* ptr to fcn line # */
! char x_endndx[4]; /* entry ndx past block end */
! } x_fcn;
! struct { /* if ISARY, up to 4 dimen. */
! char x_dimen[E_DIMNUM][2];
! } x_ary;
! } x_fcnary;
! char x_tvndx[2]; /* tv index */
! } x_sym;
! union {
! char x_fname[E_FILNMLEN];
! struct {
! char x_zeroes[4];
! char x_offset[4];
! } x_n;
! } x_file;
! struct {
! char x_scnlen[4]; /* section length */
! char x_nreloc[2]; /* # relocation entries */
! char x_nlinno[2]; /* # line numbers */
! } x_scn;
!
! struct {
! char x_tvfill[4]; /* tv fill value */
! char x_tvlen[2]; /* length of .tv */
! char x_tvran[2][2]; /* tv range */
! } x_tv; /* info about .tv section (in auxent of symbol .tv)) */
! struct {
! unsigned char x_scnlen[4];
! unsigned char x_parmhash[4];
! unsigned char x_snhash[2];
! unsigned char x_smtyp[1];
! unsigned char x_smclas[1];
! unsigned char x_stab[4];
! unsigned char x_snstab[2];
! } x_csect;
};
--- 226,321 ----
union external_auxent {
+
+ struct {
+ #ifndef XCOFF64
+ char x_tagndx[4]; /* str, un, or enum tag indx */
+ #endif
+ union {
+ struct {
+ char x_lnno[HALFSZ]; /* declaration line number */
+ char x_size[2]; /* str/union/array size */
+ } x_lnsz;
+ struct {
+ #ifndef XCOFF64
+ char x_fsize[4]; /* size of function */
+ #endif
+ char x_lnnoptr[OFFSETSZ];/* ptr to fcn line */
+ #ifdef XCOFF64
+ char x_fsize[4]; /* size of function */
+ #endif
+ char x_endndx[4]; /* entry ndx past block end */
+ } x_fcn;
+ #ifndef XCOFF64
+ struct {
+ char x_pad[2];
+ char x_size[2];
+ char x_dimen[E_DIMNUM][2]; /* if ISARY, up to 4 dimen. */
+ } x_ary;
+ #endif
+ } x_fcnary;
+ #ifndef XCOFF64
+ char x_tvndx[2]; /* tv index */
+ #endif
+ } x_sym;
+
+ union {
+ char x_fname[E_FILNMLEN];
struct {
! char x_zeroes[4];
! char x_offset[4];
! #ifdef XCOFF64
! char x_pad[6];
! unsigned char x_ftype[1];
! unsigned char x_resv[2];
! #endif
! } x_n;
! } x_file;
! #ifdef XCOFF64
! struct {
! char x_exptr[8];
! char x_fsize[4];
! char x_endndx[4];
! char x_pad[1];
! } x_except;
! #else
! struct {
! char x_scnlen[4]; /* section length */
! char x_nreloc[2]; /* # relocation entries */
! char x_nlinno[2]; /* # line numbers */
! } x_scn;
! struct {
! char x_tvfill[4]; /* tv fill value */
! char x_tvlen[2]; /* length of .tv */
! char x_tvran[2][2]; /* tv range */
! } x_tv; /* info about .tv section (in auxent of symbol .tv)) */
! #endif
! struct {
! #ifdef XCOFF64
! unsigned char x_scnlen_lo[4];
! #else
! unsigned char x_scnlen[4];
! #endif
! unsigned char x_parmhash[4];
! unsigned char x_snhash[2];
! unsigned char x_smtyp[1];
! unsigned char x_smclas[1];
! #ifdef XCOFF64
! unsigned char x_scnlen_hi[4];
! unsigned char x_pad[1];
! #else
! unsigned char x_stab[4];
! unsigned char x_snstab[2];
! #endif
! } x_csect;
+ #ifdef XCOFF64
+ struct {
+ char x_pad[17];
+ char x_auxtype[1];
+ } x_auxtype;
+ #endif
};
*************** union external_auxent {
*** 221,224 ****
--- 327,337 ----
#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
+
*************** union external_auxent {
*** 227,231 ****
struct external_reloc {
! char r_vaddr[4];
char r_symndx[4];
char r_size[1];
--- 340,344 ----
struct external_reloc {
! char r_vaddr[OFFSETSZ];
char r_symndx[4];
char r_size[1];
*************** struct external_reloc {
*** 235,239 ****
--- 348,356 ----
#define RELOC struct external_reloc
+ #ifdef XCOFF64
+ #define RELSZ 14
+ #else
#define RELSZ 10
+ #endif
#define DEFAULT_DATA_SECTION_ALIGNMENT 4