xcoff64 bfd-coffgen.c.patch

Tom Rix trix@redhat.com
Mon Jan 29 11:40:00 GMT 2001


coffgen.c : (coff_fix_symbol_name) formatting
		(coff_mangle_symbols) xcoff 64 bit support
		(coff_write_symbol) same
		(coff_write_alien_symbol) same
		(coff_write_native_symbol) same
		(coff_write_symbols) same
		(coff_get_symbol_info) same
		(bfd_coff_get_syment) same
		(coff_print_symbol) same


--------------------------------------------------------------------------

diff -rcp sources-original/src/bfd/coffgen.c sources/src/bfd/coffgen.c
*** sources-original/src/bfd/coffgen.c	Sat Jan 20 00:28:24 2001
--- sources/src/bfd/coffgen.c	Mon Jan 29 11:48:14 2001
*************** static void coff_fix_symbol_name
*** 46,58 ****
    PARAMS ((bfd *, asymbol *, combined_entry_type *, bfd_size_type *,
  	   asection **, bfd_size_type *));
  static boolean coff_write_symbol
!   PARAMS ((bfd *, asymbol *, combined_entry_type *, unsigned int *,
  	   bfd_size_type *, asection **, bfd_size_type *));
  static boolean coff_write_alien_symbol
!   PARAMS ((bfd *, asymbol *, unsigned int *, bfd_size_type *,
  	   asection **, bfd_size_type *));
  static boolean coff_write_native_symbol
!   PARAMS ((bfd *, coff_symbol_type *, unsigned int *, bfd_size_type *,
  	   asection **, bfd_size_type *));
  static void coff_pointerize_aux
    PARAMS ((bfd *, combined_entry_type *, combined_entry_type *,
--- 46,58 ----
    PARAMS ((bfd *, asymbol *, combined_entry_type *, bfd_size_type *,
  	   asection **, bfd_size_type *));
  static boolean coff_write_symbol
!   PARAMS ((bfd *, asymbol *, combined_entry_type *, bfd_vma *,
  	   bfd_size_type *, asection **, bfd_size_type *));
  static boolean coff_write_alien_symbol
!   PARAMS ((bfd *, asymbol *, bfd_vma *, bfd_size_type *,
  	   asection **, bfd_size_type *));
  static boolean coff_write_native_symbol
!   PARAMS ((bfd *, coff_symbol_type *, bfd_vma *, bfd_size_type *,
  	   asection **, bfd_size_type *));
  static void coff_pointerize_aux
    PARAMS ((bfd *, combined_entry_type *, combined_entry_type *,
*************** coff_mangle_symbols (bfd_ptr)
*** 748,755 ****
  	  if (s->fix_value)
  	    {
  	      /* FIXME: We should use a union here.  */
! 	      s->u.syment.n_value =
! 		((combined_entry_type *) s->u.syment.n_value)->offset;
  	      s->fix_value = 0;
  	    }
  	  if (s->fix_line)
--- 748,756 ----
  	  if (s->fix_value)
  	    {
  	      /* FIXME: We should use a union here.  */
! 	      s->u.syment.n_value = 
! 		(bfd_vma)((combined_entry_type *) 
! 			  ((unsigned long) s->u.syment.n_value))->offset;
  	      s->fix_value = 0;
  	    }
  	  if (s->fix_line)
*************** coff_write_symbol (abfd, symbol, native,
*** 920,926 ****
       bfd *abfd;
       asymbol *symbol;
       combined_entry_type *native;
!      unsigned int *written;
       bfd_size_type *string_size_p;
       asection **debug_string_section_p;
       bfd_size_type *debug_string_size_p;
--- 921,927 ----
       bfd *abfd;
       asymbol *symbol;
       combined_entry_type *native;
!      bfd_vma *written;
       bfd_size_type *string_size_p;
       asection **debug_string_section_p;
       bfd_size_type *debug_string_size_p;
*************** coff_write_alien_symbol (abfd, symbol, w
*** 1005,1011 ****
  			 debug_string_section_p, debug_string_size_p)
       bfd *abfd;
       asymbol *symbol;
!      unsigned int *written;
       bfd_size_type *string_size_p;
       asection **debug_string_section_p;
       bfd_size_type *debug_string_size_p;
--- 1006,1012 ----
  			 debug_string_section_p, debug_string_size_p)
       bfd *abfd;
       asymbol *symbol;
!      bfd_vma *written;
       bfd_size_type *string_size_p;
       asection **debug_string_section_p;
       bfd_size_type *debug_string_size_p;
*************** coff_write_native_symbol (abfd, symbol, 
*** 1073,1079 ****
  			  debug_string_section_p, debug_string_size_p)
       bfd *abfd;
       coff_symbol_type *symbol;
!      unsigned int *written;
       bfd_size_type *string_size_p;
       asection **debug_string_section_p;
       bfd_size_type *debug_string_size_p;
--- 1074,1080 ----
  			  debug_string_section_p, debug_string_size_p)
       bfd *abfd;
       coff_symbol_type *symbol;
!      bfd_vma *written;
       bfd_size_type *string_size_p;
       asection **debug_string_section_p;
       bfd_size_type *debug_string_size_p;
*************** coff_write_symbols (abfd)
*** 1146,1152 ****
    bfd_size_type debug_string_size;
    unsigned int i;
    unsigned int limit = bfd_get_symcount (abfd);
!   unsigned int written = 0;
    asymbol **p;
  
    string_size = 0;
--- 1147,1153 ----
    bfd_size_type debug_string_size;
    unsigned int i;
    unsigned int limit = bfd_get_symcount (abfd);
!   bfd_signed_vma written = 0;
    asymbol **p;
  
    string_size = 0;
*************** coff_get_symbol_info (abfd, symbol, ret)
*** 1916,1926 ****
    if (coffsymbol (symbol)->native != NULL
        && coffsymbol (symbol)->native->fix_value)
      {
!       combined_entry_type *psym;
! 
!       psym = ((combined_entry_type *)
! 	      coffsymbol (symbol)->native->u.syment.n_value);
!       ret->value = (bfd_vma) (psym - obj_raw_syments (abfd));
      }
  }
  
--- 1917,1924 ----
    if (coffsymbol (symbol)->native != NULL
        && coffsymbol (symbol)->native->fix_value)
      {
!       ret->value = coffsymbol (symbol)->native->u.syment.n_value -
! 	(unsigned long) obj_raw_syments (abfd);
      }
  }
  
*************** bfd_coff_get_syment (abfd, symbol, psyme
*** 1944,1951 ****
    *psyment = csym->native->u.syment;
  
    if (csym->native->fix_value)
!     psyment->n_value = ((combined_entry_type *) psyment->n_value
! 			- obj_raw_syments (abfd));
  
    /* FIXME: We should handle fix_line here.  */
  
--- 1942,1949 ----
    *psyment = csym->native->u.syment;
  
    if (csym->native->fix_value)
!     psyment->n_value = psyment->n_value - 
!       (unsigned long) obj_raw_syments (abfd);
  
    /* FIXME: We should handle fix_line here.  */
  
*************** coff_print_symbol (abfd, filep, symbol, 
*** 2022,2028 ****
      case bfd_print_symbol_all:
        if (coffsymbol (symbol)->native)
  	{
! 	  unsigned long val;
  	  unsigned int aux;
  	  combined_entry_type *combined = coffsymbol (symbol)->native;
  	  combined_entry_type *root = obj_raw_syments (abfd);
--- 2020,2026 ----
      case bfd_print_symbol_all:
        if (coffsymbol (symbol)->native)
  	{
! 	  bfd_vma val;
  	  unsigned int aux;
  	  combined_entry_type *combined = coffsymbol (symbol)->native;
  	  combined_entry_type *root = obj_raw_syments (abfd);
*************** coff_print_symbol (abfd, filep, symbol, 
*** 2031,2042 ****
  	  fprintf (file, "[%3ld]", (long) (combined - root));
  
  	  if (! combined->fix_value)
! 	    val = (unsigned long) combined->u.syment.n_value;
  	  else
! 	    val = ((unsigned long)
! 		   ((combined_entry_type *) combined->u.syment.n_value
! 		    - root));
  
  	  fprintf (file,
  		   "(sec %2d)(fl 0x%02x)(ty %3x)(scl %3d) (nx %d) 0x%08lx %s",
  		   combined->u.syment.n_scnum,
--- 2029,2039 ----
  	  fprintf (file, "[%3ld]", (long) (combined - root));
  
  	  if (! combined->fix_value)
! 	    val = (bfd_vma) combined->u.syment.n_value;
  	  else
! 	    val = combined->u.syment.n_value - (unsigned long) root;
  
+ #ifndef XCOFF64
  	  fprintf (file,
  		   "(sec %2d)(fl 0x%02x)(ty %3x)(scl %3d) (nx %d) 0x%08lx %s",
  		   combined->u.syment.n_scnum,
*************** coff_print_symbol (abfd, filep, symbol, 
*** 2044,2051 ****
--- 2041,2060 ----
  		   combined->u.syment.n_type,
  		   combined->u.syment.n_sclass,
  		   combined->u.syment.n_numaux,
+ 		   (unsigned long) val,
+ 		   symbol->name);
+ #else
+ 	  /* Print out the wide, 64 bit, symbol value */
+ 	  fprintf (file,
+ 		   "(sec %2d)(fl 0x%02x)(ty %3x)(scl %3d) (nx %d) 0x%016llx %s",
+ 		   combined->u.syment.n_scnum,
+ 		   combined->u.syment.n_flags,
+ 		   combined->u.syment.n_type,
+ 		   combined->u.syment.n_sclass,
+ 		   combined->u.syment.n_numaux,
  		   val,
  		   symbol->name);
+ #endif
  
  	  for (aux = 0; aux < combined->u.syment.n_numaux; aux++)
  	    {


More information about the Binutils mailing list