This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
xcoff64 bfd-coffcode.h.patch
- To: "binutils" <binutils at sources dot redhat dot com>
- Subject: xcoff64 bfd-coffcode.h.patch
- From: "Tom Rix" <trix at redhat dot com>
- Date: Mon, 29 Jan 2001 13:39:57 -0600
coffcode.h : (coff_set_arch_mach_hook) xcoff 64 bit support
(coff_print_aux) same
(coff_write_object_contents) same
(coff_slurp_line_table) same
--------------------------------------------------------------------------
diff -rcp sources-original/src/bfd/coffcode.h sources/src/bfd/coffcode.h
*** sources-original/src/bfd/coffcode.h Sat Jan 20 00:28:24 2001
--- sources/src/bfd/coffcode.h Mon Jan 29 11:48:14 2001
*************** coff_set_arch_mach_hook (abfd, filehdr)
*** 1996,2016 ****
{
default:
case 0:
! #ifdef POWERMAC
! /* PowerPC Macs use the same magic numbers as RS/6000
! (because that's how they were bootstrapped originally),
! but they are always PowerPC architecture. */
! arch = bfd_arch_powerpc;
! machine = bfd_mach_ppc;
! #else
! #ifdef XCOFF64
! arch = bfd_arch_powerpc;
! machine = bfd_mach_ppc_620;
! #else
! arch = bfd_arch_rs6000;
! machine = bfd_mach_rs6k;
! #endif
! #endif /* POWERMAC */
break;
case 1:
--- 1996,2003 ----
{
default:
case 0:
! arch = bfd_xcoff_architecture (abfd);
! machine = bfd_xcoff_machine (abfd);
break;
case 1:
*************** coff_print_aux (abfd, file, table_base,
*** 2281,2293 ****
if (SMTYP_SMTYP (aux->u.auxent.x_csect.x_smtyp) != XTY_LD)
{
BFD_ASSERT (! aux->fix_scnlen);
! fprintf (file, "val %5ld", aux->u.auxent.x_csect.x_scnlen.l);
}
else
{
fprintf (file, "indx ");
if (! aux->fix_scnlen)
! fprintf (file, "%4ld", aux->u.auxent.x_csect.x_scnlen.l);
else
fprintf (file, "%4ld",
(long) (aux->u.auxent.x_csect.x_scnlen.p - table_base));
--- 2268,2288 ----
if (SMTYP_SMTYP (aux->u.auxent.x_csect.x_smtyp) != XTY_LD)
{
BFD_ASSERT (! aux->fix_scnlen);
! #ifdef XCOFF64
! fprintf (file, "val %5lld", aux->u.auxent.x_csect.x_scnlen.l);
! #else
! fprintf (file, "val %5ld", (long) aux->u.auxent.x_csect.x_scnlen.l);
! #endif
}
else
{
fprintf (file, "indx ");
if (! aux->fix_scnlen)
! #ifdef XCOFF64
! fprintf (file, "%4lld", aux->u.auxent.x_csect.x_scnlen.l);
! #else
! fprintf (file, "%4ld", (long) aux->u.auxent.x_csect.x_scnlen.l);
! #endif
else
fprintf (file, "%4ld",
(long) (aux->u.auxent.x_csect.x_scnlen.p - table_base));
*************** coff_write_object_contents (abfd)
*** 3313,3322 ****
--- 3308,3319 ----
{
scn_base = bfd_coff_filhsz (abfd);
#ifdef RS6000COFF_C
+ #ifndef XCOFF64
if (xcoff_data (abfd)->full_aouthdr)
scn_base += bfd_coff_aoutsz (abfd);
else
scn_base += SMALL_AOUTSZ;
+ #endif
#endif
}
*************** coff_write_object_contents (abfd)
*** 3568,3573 ****
--- 3565,3571 ----
}
#ifdef RS6000COFF_C
+ #ifndef XCOFF64
/* XCOFF handles overflows in the reloc and line number count fields
by creating a new section header to hold the correct values. */
for (current = abfd->sections; current != NULL; current = current->next)
*************** coff_write_object_contents (abfd)
*** 3595,3600 ****
--- 3593,3599 ----
}
}
#endif
+ #endif
/* OK, now set up the filehdr... */
*************** coff_write_object_contents (abfd)
*** 3616,3625 ****
--- 3615,3626 ----
{
internal_f.f_opthdr = 0;
#ifdef RS6000COFF_C
+ #ifndef XCOFF64
if (xcoff_data (abfd)->full_aouthdr)
internal_f.f_opthdr = bfd_coff_aoutsz (abfd);
else
internal_f.f_opthdr = SMALL_AOUTSZ;
+ #endif
#endif
}
*************** coff_slurp_line_table (abfd, asect)
*** 4182,4194 ****
if (cache_ptr->line_number == 0)
{
boolean warned;
! long symndx;
coff_symbol_type *sym;
warned = false;
symndx = dst.l_addr.l_symndx;
if (symndx < 0
! || (unsigned long) symndx >= obj_raw_syment_count (abfd))
{
(*_bfd_error_handler)
(_("%s: warning: illegal symbol index %ld in line numbers"),
--- 4183,4195 ----
if (cache_ptr->line_number == 0)
{
boolean warned;
! bfd_signed_vma symndx;
coff_symbol_type *sym;
warned = false;
symndx = dst.l_addr.l_symndx;
if (symndx < 0
! || (bfd_vma) symndx >= obj_raw_syment_count (abfd))
{
(*_bfd_error_handler)
(_("%s: warning: illegal symbol index %ld in line numbers"),