[PATCH] D40652: [ELF] - Produce relocation section name consistent with output section name when --emit-reloc used with linker script.

George Rimar via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Dec 1 00:59:42 PST 2017


grimar added inline comments.


================
Comment at: ELF/Writer.cpp:104-105
+  // technically required, but not doing it is odd). This code guarantees that.
+  if ((S->Type == SHT_REL || S->Type == SHT_RELA) &&
+      !isa<SyntheticSection>(S)) {
+    OutputSection *Out =
----------------
ruiu wrote:
> Is it possible that a section is a synthetic section and has type of SHT_REL[A]?
Yes, .rela.dyn/.rela.plt for example.

btw, I was thinking about wrapping this whole block in `if (Config->EmitRelocs)`.
It should not affect logic, but probably can make code more readable because reader not need
to read code for --emit-relocs usually. With explicit if statement it can be skipped.
But we usually do not do excessive checks for readability I think, so did not do that.


https://reviews.llvm.org/D40652





More information about the llvm-commits mailing list