public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
From: Thiemo Seufer <ica2_ts@csv.ica.uni-stuttgart.de>
To: binutils@sources.redhat.com
Subject: Strange code in tc-mips.c
Date: Mon, 06 Aug 2001 05:42:00 -0000	[thread overview]
Message-ID: <20010806144149.D400@rembrandt.csv.ica.uni-stuttgart.de> (raw)

Hi All,

while figuring out what's the use of mips_64 in tc-mips.c I found
this gem:

void
cons_fix_new_mips (frag, where, nbytes, exp)
     fragS *frag ATTRIBUTE_UNUSED;
     int where;
     unsigned int nbytes;
     expressionS *exp;
{
#ifndef OBJ_ELF
  /* If we are assembling in 32 bit mode, turn an 8 byte reloc into a
     4 byte reloc.  */
  if (nbytes == 8 && ! mips_64)
    {
      if (target_big_endian)
        where += 4;
      nbytes = 4;
    }
#endif

According to internals.texi, TC_CONS_FIX_NEW is used for fixups
of data allocation pseudo-ops (like .dword).

I can't see even the intention behind this:
  - A gas with ELF _support_ never uses this code.
  - Without ELF support, the check goes effectively for -mabi=64,
    not for 64bit assembly.
  - The code then silently discards the upper word. If larger
    data definitions are illegal in 32bit ECOFF(?), this should
    be checked earlier and with a warning.

This is (except of the option setting) the only place where
mips_64 is wrongly assumed to work as flag for 64bit assembly
instead of ABI64.

Has somebody a explanation what this code is good for?


Thiemo

             reply	other threads:[~2001-08-06  5:42 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-08-06  5:42 Thiemo Seufer [this message]
2001-08-06  7:36 ` Ian Lance Taylor
2001-08-06  9:55   ` Thiemo Seufer
2001-08-15 14:40     ` Thiemo Seufer
2001-08-15 14:40       ` Eric Christopher
     [not found]   ` <mailpost.997108925.11812@postal.sibyte.com>
2001-08-06 10:50     ` cgd

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=20010806144149.D400@rembrandt.csv.ica.uni-stuttgart.de \
    --to=ica2_ts@csv.ica.uni-stuttgart.de \
    --cc=binutils@sources.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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).