STUB_MOVE in elfxx-mips.c

Atsushi Nemoto anemo@mba.ocn.ne.jp
Wed Oct 1 13:57:00 GMT 2003


I found following codes in bfd/elfxx-mips.c:

#define STUB_MOVE(abfd)                                         \
  (SGI_COMPAT (abfd) ? 0x03e07825 : 0x03e07821)         /* move t7,ra */

0x03e07825 is "OR $15,$31,$0" and 0x03e07821 is "ADDU $15,$31,$0".

Why SGI_COMPAT() is used here?

The ADDU can not be used to copy 64bit register because the result is
sign-extended value of the low 32bit of the source register.  So OR
must be used for 64bit ABI, right?  Or using OR unconditionally is
enough, isn't it?  Or am I missing something?

---
Atsushi Nemoto



More information about the Binutils mailing list