Mirror of the gdb mailing list
 help / color / mirror / Atom feed
From: "H . J . Lu" <hjl@lucon.org>
To: David B Anderson <davea@quasar.engr.sgi.com>
Cc: rth@redhat.com, gdb@sourceware.cygnus.com,
	binutils@sourceware.cygnus.com
Subject: Re: Why does mips define elf_backend_sign_extend_vma to true?
Date: Tue, 07 Aug 2001 22:04:00 -0000	[thread overview]
Message-ID: <20010807220451.A18294@lucon.org> (raw)
In-Reply-To: <200108080326.UAA19167@quasar.engr.sgi.com>

On Tue, Aug 07, 2001 at 08:26:20PM -0700, David B Anderson wrote:
> 
> 
> Andrew Cagney wrote
> |> > Several ABI's have implied sign extension of addresses.  MIPS is one.
> 
>  H . J . Lu wrote
> |> Show me where it is documemnted in the 32bit SVR4 MIPS ABI.
> 
> You have to know where to look :-)
> It's not in the ABI, it's in the hardware.
> When running MIPSIII or MIPSIV.
> The hardware, on loading a 32bit integer value into a 
> 64 bit integer register, sign-extends to 64 bits.
> (for example, with a lw instruction: any 32bit integer
> load does this extension)
> 
> gdb is simply reflecting the hardware action.
> 

What does that have anything to do with ELF files for MIPS I/II? We get
different values on the same 32bit mips ELF file for MIPS I/II:

ELF Header:
  Magic:   7f 45 4c 46 01 01 01 00 00 00 00 00 00 00 00 00 
  Class:                             ELF32
  Data:                              2's complement, little endian
  Version:                           1 (current)
  OS/ABI:                            UNIX - System V
  ABI Version:                       0
  Type:                              EXEC (Executable file)
  Machine:                           MIPS R3000
  Version:                           0x1
  Entry point address:               0x8010074c
  Start of program headers:          52 (bytes into file)
  Start of section headers:          2178004 (bytes into file)
  Flags:                             0x10000001, noreorder, mips2 UNKNOWN
  Size of this header:               52 (bytes)
  Size of program headers:           32 (bytes)
  Number of program headers:         3
  Size of section headers:           40 (bytes)
  Number of section headers:         18
  Section header string table index: 15

from 32bit bfd and 64bit bfd. I propose this patch to at least fix the
SRV4 ABI. I think the better fix is to check the EF_MIPS field to only
do sign extension for MIPS III/IV. But we don't support such encoding.
I think it is the time to reconsider

http://gcc.gnu.org/ml/gcc-patches/2000-08/msg00418.html

I am willing to provide a patch for that.


H.J.
----
2001-08-07  H.J. Lu  <hjl@gnu.org>

	* elf32-mips.c (elf_backend_sign_extend_vma): Undefine for the
	SVR4 ABI.

Index: elf32-mips.c
===================================================================
RCS file: /work/cvs/gnu/binutils/bfd/elf32-mips.c,v
retrieving revision 1.33
diff -u -p -r1.33 elf32-mips.c
--- elf32-mips.c	2001/07/04 07:34:35	1.33
+++ elf32-mips.c	2001/08/08 04:44:51
@@ -9511,6 +9511,8 @@ static const struct ecoff_debug_swap mip
 
 #define INCLUDED_TARGET_FILE            /* More a type of flag */
 
+#undef elf_backend_sign_extend_vma
+
 #undef TARGET_LITTLE_SYM
 #undef TARGET_LITTLE_NAME
 #undef TARGET_BIG_SYM


  reply	other threads:[~2001-08-07 22:04 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-08-07 20:27 David B Anderson
2001-08-07 22:04 ` H . J . Lu [this message]
2001-08-07 22:46   ` Richard Henderson
2001-08-07 23:21     ` H . J . Lu
2001-08-08  0:50       ` Richard Henderson
2001-08-08  1:09       ` Maciej W. Rozycki
2001-08-08  7:29         ` H . J . Lu
2001-08-08  7:50           ` Andrew Cagney
2001-08-08  8:03             ` H . J . Lu
2001-08-08  8:18               ` Andrew Cagney
2001-08-08  9:02                 ` H . J . Lu
2001-08-08  9:53                   ` Daniel Jacobowitz
2001-08-08 10:02                     ` H . J . Lu
2001-08-08 11:02                       ` Daniel Jacobowitz
2001-08-08 11:08                         ` H . J . Lu
2001-08-09 12:23                   ` Andrew Cagney
2001-08-08  9:48               ` Daniel Jacobowitz
2001-08-08  9:52                 ` H . J . Lu
2001-08-10  0:47               ` Maciej W. Rozycki
     [not found] <20010807182459.A15252@lucon.org>
     [not found] ` <20010807183933.A15425@lucon.org>
     [not found]   ` <3B709900.3000502@cygnus.com>
     [not found]     ` <20010807184504.A15571@lucon.org>
2001-08-07 18:52       ` H . J . Lu
2001-08-07 18:58         ` Daniel Jacobowitz

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20010807220451.A18294@lucon.org \
    --to=hjl@lucon.org \
    --cc=binutils@sourceware.cygnus.com \
    --cc=davea@quasar.engr.sgi.com \
    --cc=gdb@sourceware.cygnus.com \
    --cc=rth@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox