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

Rui Ueyama via llvm-commits llvm-commits at lists.llvm.org
Tue Dec 1 13:09:14 PST 2015


ruiu added inline comments.

================
Comment at: ELF/InputSection.cpp:96
@@ -95,2 +95,3 @@
 template <class ELFT>
 template <bool isRela>
+uint8_t *
----------------
atanasyan wrote:
> 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>`.
Got it.

================
Comment at: ELF/InputSection.cpp:98
@@ +97,3 @@
+uint8_t *
+InputSectionBase<ELFT>::findPairedRelocLocation(uint8_t *Buf, uint32_t Type,
+                                                RelIteratorRange<isRela> Rels) {
----------------
Can you rename findMipsPairedReloc? I'd like to include "Mips" in this function name.

================
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;
----------------
atanasyan wrote:
> 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?
I don't know which is better, but I want to make it consistent. Could you remove nullptr from "relocateOne(..., nullptr)" in this patch?


Repository:
  rL LLVM

http://reviews.llvm.org/D15112





More information about the llvm-commits mailing list