[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 03:10:02 PST 2017


grimar added inline comments.


================
Comment at: ELF/Writer.cpp:495
+
+    // We do not create symbol for synthetic sections because do not have
+    // relocations that might use it, but SHF_MERGE sections is an exception
----------------
ruiu wrote:
> Synthetic sections don't have any relocations except mergeable sections. Mergeable output sections may have relocations because mergeable input sections may have relocations.
Sorry, I think I do not understand your suggested comment meaning.

You're saying that "Synthetic sections don't have any relocations except mergeable sections". 

My testcase have '.foo' section that have '.foo.rela' section. Latter has relocations that refer to section symbol for '.strings',
used for relocation calulation. '.strings' in my case is a synthetic section. And it does not have '.strings.rela' or something,
so it never have relocations in my understanding.

So synthetic mergeable section '.strings' does not have relocations. But your suggested comment saying different.
I am going to commit this comment as is with fix for "-r" -> "-emit-relocs". Lets discuss the better wording if you think it
is not good now and I'll be happy to change it in followup.


https://reviews.llvm.org/D40070





More information about the llvm-commits mailing list