public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
* [rfc] For mips, sign-extended ecoff offsets
@ 2000-06-19  5:14 Andrew Cagney
  2000-06-19  8:48 ` Alan Modra
  0 siblings, 1 reply; 16+ messages in thread
From: Andrew Cagney @ 2000-06-19  5:14 UTC (permalink / raw)
  To: BINUTILS Patches; +Cc: GDB Patches

Hello,

The attatched patch changes the MIPS ELF32 backend so that it is more
likely to return a sign-extended offset.  At present the ELF backend
returns sign-extended symbol table values but not sign extended debug
information.

For instance, an asymbol might contain 0xfffffffa0100124 yet the value
returned by ecoff_swap_sym_in() is 0xa0100124.

Preliminary tests with GDB suggest this improves things significantly. 
Next question is, what damage is this likely to do to BFD and the
linker.

	Andrew

PS: This will hurt GDB more than it can hurt BFD :-)
Mon Jun 19 20:53:14 2000  Andrew Cagney  <cagney@b1.cygnus.com>

	* ecoffswap.h (ecoff_get_off, ecoff_put_off): Add ECOFF_SIGNED_32
 	and ECOF_SIGNED_64 to list ways to extract an offset.
	* elf64-mips.c (ECOFF_SIGNED_64): Define instead of ECOFF_64.
	* elf32-mips.c (ECOFF_SIGNED_32): Define instead of ECOFF_32.

Index: ecoffswap.h
===================================================================
RCS file: /cvs/cvsfiles/devo/bfd/ecoffswap.h,v
retrieving revision 1.19
diff -p -r1.19 ecoffswap.h
*** ecoffswap.h	1996/03/12 22:41:13	1.19
--- ecoffswap.h	2000/06/19 11:56:25
*************** Foundation, Inc., 59 Temple Place - Suit
*** 27,36 ****
     on them in gdb by naming the including source file; e.g.,
     'coff-mips.c':ecoff_swap_hdr_in.
  
!    Before including this header file, one of ECOFF_32 or ECOFF_64 must
!    be defined.  These are checked when swapping information that
!    depends upon the target size.  This code works for 32 bit and 64
!    bit ECOFF, but may need to be generalized in the future.
  
     Some header file which defines the external forms of these
     structures must also be included before including this header file.
--- 27,37 ----
     on them in gdb by naming the including source file; e.g.,
     'coff-mips.c':ecoff_swap_hdr_in.
  
!    Before including this header file, one of ECOFF_32, ECOFF_64,
!    ECOF_SIGNED_32 or ECOFF_SIGNED_64 must be defined.  These are
!    checked when swapping information that depends upon the target
!    size.  This code works for 32 bit and 64 bit ECOFF, but may need to
!    be generalized in the future.
  
     Some header file which defines the external forms of these
     structures must also be included before including this header file.
*************** Foundation, Inc., 59 Temple Place - Suit
*** 49,54 ****
--- 50,63 ----
  #ifdef ECOFF_64
  #define ecoff_get_off bfd_h_get_64
  #define ecoff_put_off bfd_h_put_64
+ #endif
+ #ifdef ECOFF_SIGNED_32
+ #define ecoff_get_off bfd_h_get_signed_32
+ #define ecoff_put_off bfd_h_put_signed_32
+ #endif
+ #ifdef ECOFF_SIGNED_64
+ #define ecoff_get_off bfd_h_get_signed_32
+ #define ecoff_put_off bfd_h_put_signed_32
  #endif
  
  /* ECOFF auxiliary information swapping routines.  These are the same
Index: elf32-mips.c
===================================================================
RCS file: /cvs/cvsfiles/devo/bfd/elf32-mips.c,v
retrieving revision 1.176
diff -p -r1.176 elf32-mips.c
*** elf32-mips.c	2000/05/29 16:45:57	1.176
--- elf32-mips.c	2000/06/19 11:56:44
*************** Foundation, Inc., 59 Temple Place - Suit
*** 40,46 ****
  #include "coff/internal.h"
  #include "coff/ecoff.h"
  #include "coff/mips.h"
! #define ECOFF_32
  #include "ecoffswap.h"
  
  /* This structure is used to hold .got information when linking.  It
--- 40,46 ----
  #include "coff/internal.h"
  #include "coff/ecoff.h"
  #include "coff/mips.h"
! #define ECOFF_SIGNED_32
  #include "ecoffswap.h"
  
  /* This structure is used to hold .got information when linking.  It
Index: elf64-mips.c
===================================================================
RCS file: /cvs/cvsfiles/devo/bfd/elf64-mips.c,v
retrieving revision 1.18
diff -p -r1.18 elf64-mips.c
*** elf64-mips.c	1999/12/10 10:49:53	1.18
--- elf64-mips.c	2000/06/19 11:56:46
*************** Foundation, Inc., 59 Temple Place - Suit
*** 45,51 ****
  #include "coff/ecoff.h"
  /* The 64 bit versions of the mdebug data structures are in alpha.h.  */
  #include "coff/alpha.h"
! #define ECOFF_64
  #include "ecoffswap.h"
  
  static void mips_elf64_swap_reloc_in
--- 45,51 ----
  #include "coff/ecoff.h"
  /* The 64 bit versions of the mdebug data structures are in alpha.h.  */
  #include "coff/alpha.h"
! #define ECOFF_SIGNED_64
  #include "ecoffswap.h"
  
  static void mips_elf64_swap_reloc_in

^ permalink raw reply	[flat|nested] 16+ messages in thread

end of thread, other threads:[~2000-07-03 23:47 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2000-06-19  5:14 [rfc] For mips, sign-extended ecoff offsets Andrew Cagney
2000-06-19  8:48 ` Alan Modra
2000-06-19 18:18   ` Andrew Cagney
2000-06-19 18:47     ` Ulf Carlsson
2000-06-19 18:57       ` Alan Modra
2000-06-19 19:16       ` Andrew Cagney
2000-06-19 20:08       ` Geoff Keating
2000-06-19 20:41         ` Ian Lance Taylor
2000-06-25 14:13           ` Ralf Baechle
     [not found]         ` <14670.59816.517716.492387@calypso.engr.sgi.com>
2000-06-19 21:30           ` Geoff Keating
2000-06-19 18:50     ` Alan Modra
2000-06-19 19:23       ` Andrew Cagney
2000-06-19 20:39       ` Ian Lance Taylor
2000-06-23  0:28         ` Andrew Cagney
2000-06-23  9:48           ` Ian Lance Taylor
2000-07-03 23:47             ` Andrew Cagney

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).