Strange code in tc-mips.c
Thiemo Seufer
ica2_ts@csv.ica.uni-stuttgart.de
Mon Aug 6 05:42:00 GMT 2001
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
More information about the Binutils
mailing list