[PATCH] D27415: [ELF] - Replace MergeOutputSection with synthetic input section MergeSection.

George Rimar via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Dec 8 07:50:17 PST 2016


grimar added inline comments.


================
Comment at: ELF/LinkerScript.cpp:351
 
+      combineMergableSections(V);
+
----------------
ruiu wrote:
> Why do you have to do this in LinkerScript.cpp? It feels something is not right. Section aggregation should happen before the control is passed to the linker script.
How it can be possible ?

Imagine script has:

.mergeable : { *(.aaa) *(.bbb) EXCLUDE_FILE (*file1.o) *(.ccc) }

I am able to merge them only after I have some result from createInputSectionList(), no ? Until that I don't know which sections should I combine.


================
Comment at: ELF/LinkerScript.cpp:366
+      std::vector<InputSectionBase<ELFT> *> V = { S };
+      combineMergableSections(V);
+      addSection(Factory, V[0], getOutputSectionName(S->Name));
----------------
ruiu wrote:
> This is odd too.
The same. We do not know what sections are orphans until we proccess the script.


https://reviews.llvm.org/D27415





More information about the llvm-commits mailing list