[PATCH] D54154: [ELF][MIPS] Use MIPS R6 `sigrie` as a trap instruction

Rui Ueyama via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Nov 14 20:19:39 PST 2018


ruiu accepted this revision.
ruiu added inline comments.


================
Comment at: ELF/Arch/Mips.cpp:61
+  // Set `sigrie 1` as a trap instruction.
+  write32(TrapInstr.data(), 0x04170001);
 
----------------
jrtc27 wrote:
> ruiu wrote:
> > Let's not handle four byte sequence as one integer because it is very confusing. I'd write
> > 
> >   if (Config->IsLE)
> >     TrapInstr = {....};
> >   else
> >     TrapInstr = {....};
> To me this actually seems the most sensible way of writing it; you don't have to care about endianness, and just write the instruction as a literal integer. This is exactly like how you write the PLT entry on various architectures, and both are writing instructions to byte arrays.
OK, then LGTM.


Repository:
  rLLD LLVM Linker

https://reviews.llvm.org/D54154





More information about the llvm-commits mailing list