[PATCH] D15112: [ELF] MIPS paired R_MIPS_HI16/LO16 relocations support

Simon Atanasyan via llvm-commits llvm-commits at lists.llvm.org
Tue Dec 1 13:05:19 PST 2015

atanasyan marked an inline comment as done.

Comment at: ELF/InputSection.cpp:96
@@ -95,2 +95,3 @@
 template <class ELFT>
 template <bool isRela>
+uint8_t *
ruiu wrote:
> Do you have to template isRela? IIRC, it is always Elf_Rel on MIPS.
Yes, `isRela` is always false for MIPS O32 ABI but I have to template `isRela` to be able to put the `findPairedRelocLocation` call into the `relocate` function. Otherwise compiler complains about conversion `NextRelocs ` from `RelIteratorRange<true>` to `RelIteratorRange<false>`.

Comment at: ELF/Target.h:62
@@ -62,1 +61,3 @@
+                           uint64_t P, uint64_t SA,
+                           uint8_t *PairedLoc = nullptr) const = 0;
   virtual bool isTlsOptimized(unsigned Type, const SymbolBody *S) const;
ruiu wrote:
> Remove "= nullptr" since the argument is always passed.
The `relocateTlsOptimize` is also called from routines like `relocateTlsIeToLe`, `writePltZeroEntry` etc. Do you think it is better to pass the last argument as `nullptr` explicitly in these cases too?



More information about the llvm-commits mailing list