[PATCH] D40070: [ELF] - Don't emit broken relocations for SHF_MERGE sections when --emit-relocs is used.

George Rimar via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Nov 16 04:06:21 PST 2017


grimar added a comment.

In https://reviews.llvm.org/D40070#927255, @ruiu wrote:

> Aah, I'd think the comment is actually ambiguous. I was thinking of a section that a relocation is applied to, but it can also be read as it is talking about a section that a relocation's symbol belongs to, and the latter interpretation is correct. Let's update that comment too. I think something like "Create a section symbol for each output section so that we can represent relocations that point to the section. If we know that no relocation is referring to a section (that happens if the section is a synthetic one), we don't create a section symbol for that section" should work.


Sounds good for me, thanks !

So second comment will remain the same right ? (or do you prefer something different)

  // We do not create symbol for synthetic sections because do not have
  // relocations that might use it, but SHF_MERGE sections is an exception
  // used for --emit-relocs. After applying merging optimisation we want to
  // rewrite relocations and need section symbol for synthetic mergeable
  // sections to refer to.


https://reviews.llvm.org/D40070





More information about the llvm-commits mailing list