[PATCH] D30279: [ELF] Ignore R_*_NONE relocs when relocating non-alloc sections

Petr Hosek via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Feb 22 16:39:40 PST 2017


phosek added inline comments.


================
Comment at: ELF/Relocations.cpp:323
   if (isRelExprOneOf<R_SIZE, R_GOT_FROM_END, R_GOT_OFF, R_MIPS_GOT_LOCAL_PAGE,
-                     R_MIPS_GOT_OFF, R_MIPS_GOT_OFF32, R_MIPS_TLSGD,
+                     R_MIPS_GOT_OFF, R_MIPS_GOT_OFF32, R_MIPS_TLSGD, R_NONE,
                      R_GOT_PAGE_PC, R_GOT_PC, R_PLT_PC, R_TLSGD_PC, R_TLSGD,
----------------
ruiu wrote:
> Is this needed? If a relocation is R_NONE, the control shouldn't reach here in the first place, I think.
I tried that but it's being invoked from `adjustExpr` in `scanRelocs` before we ignore the `R_NONE` reloc (the change below). I could move that check before the `adjustExpr` call if you prefer?


Repository:
  rL LLVM

https://reviews.llvm.org/D30279





More information about the llvm-commits mailing list