This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Strange code in tc-mips.c
- To: binutils at sources dot redhat dot com
- Subject: Strange code in tc-mips.c
- From: Thiemo Seufer <ica2_ts at csv dot ica dot uni-stuttgart dot de>
- Date: Mon, 6 Aug 2001 14:41:49 +0200
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