This is the mail archive of the binutils@sources.redhat.com mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

STUB_MOVE in elfxx-mips.c


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]