[PATCH] D40147: [MIPS] Handle cross-mode (regular <-> microMIPS) jumps

Rui Ueyama via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Nov 21 00:31:28 PST 2017


ruiu added inline comments.


================
Comment at: ELF/Arch/Mips.cpp:459
+  switch (Type) {
+  default:
+    return false;
----------------
Can you write `default` at end?


================
Comment at: ELF/Arch/Mips.cpp:482
+template <class ELFT>
+static void fixupCrossModeJump(uint8_t *Loc, RelType Type, uint64_t *Val) {
+  const endianness E = ELFT::TargetEndianness;
----------------
This needs a comment so that not only a person who understand the details of MIPS ABI can edit this function.


================
Comment at: ELF/Symbols.cpp:107
+    // set the less-significant bit here.
+    if (Config->EMachine == EM_MIPS && (Sym.StOther & STO_MIPS_MICROMIPS))
+      VA |= 1;
----------------
I do understand why you need this by reading comment, but doing this in this function doesn't feel right. This function returns an address of a symbol, and the tag whether the target is microMIPS or not is not logically part of its address. Can't you do this when you apply relocations?


Repository:
  rL LLVM

https://reviews.llvm.org/D40147





More information about the llvm-commits mailing list