[PATCH] D24230: [ELF] Linkerscript: Fix handling of empty sections

Eugene Leviant via llvm-commits llvm-commits at lists.llvm.org
Mon Sep 19 09:12:13 PDT 2016


evgeny777 added inline comments.

================
Comment at: ELF/LinkerScript.cpp:311
@@ +310,3 @@
+        OutputSectionBase<ELFT> *Empty = new OutputSectionBase<ELFT>(
+            Cmd->Name, SHT_NULL, SHF_ALLOC | SHF_EXCLUDE);
+        OutputSections->push_back(Empty);
----------------
rafael wrote:
> Sorry for being late in this review.
> 
> If you create these empty sections with
> 
> *  the same flags as the one before it.
> * alignment of 1
> 
>  you should be able to just leave these sections in the output and not worry about breaking any PT_LOAD, no?
> 
> That should make the patch simpler as you would not need to convert the symbols.
> 
> you should be able to just leave these sections in the output and not worry about breaking any PT_LOAD, no?

I don't think so. You have special types of sections, like .got, .got.plt, .eh_frame_hdr, which are created after call to createSections(). Also empty section may be the very first one in linker script. 


https://reviews.llvm.org/D24230





More information about the llvm-commits mailing list