[PATCH] D50450: Add R_HEX_6_X relocation support

Rui Ueyama via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Aug 8 11:25:16 PDT 2018


ruiu added inline comments.


================
Comment at: ELF/Arch/Hexagon.cpp:34
+
+struct InstructionMask {
+  uint32_t CmpMask;
----------------
Move this into findMaskR6.


================
Comment at: ELF/Arch/Hexagon.cpp:78
+  // for the given instruction.
+  static const SmallVector<InstructionMask, 26> R6{
+      {0x38000000, 0x0000201f}, {0x39000000, 0x0000201f},
----------------
I'd use the plain C array: `static const InstructionMask R6 = { ... };`.


================
Comment at: ELF/Arch/Hexagon.cpp:103
+
+  llvm_unreachable("Unable to find R_HEX_6_X relocation mask");
+}
----------------
You should use error() to report an error that can be triggered by a bad input. llvm_unreachable is our version of assert() and that shouldn't be used other than reporting a bug of lld itself.


Repository:
  rLLD LLVM Linker

https://reviews.llvm.org/D50450





More information about the llvm-commits mailing list