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

George Rimar via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jan 27 06:57:10 PST 2017


grimar added a comment.

To be more clear https://reviews.llvm.org/D29217 show 2 different issues.

1. The main issue I am trying to solve - wrong symbols values generated in scripts like:

  .rodata : {
   *(.rodata)
   *(.rodata.*)
   . = ALIGN(16);
   video_cards = .;
   *(.videocards)
   video_cards_end = .;

}

For fixing just only that case, probably latest diff of that patch should work. 
Because section getOutputSectionName() returns ".rodata" name for all ".rodata*" sections. That way we will correctly apply merging
optimization because all ".rodata.aaa .rodata.bbb .rodata.ccc" will be just mapped to ".rodata". And we create single synthetic merge section.

2. Another issue is that if sections names are not those from "getOutputSectionName()". That way for example if we have 2 SHF_MERGE sections

.rodata : { *(foo.1 foo.2) } we are not able to know we should create single mergeable output section if we create them early. And that way we lose possible optimization.

I'll rebase this and probably submit alternative patch based on diff2 soon that solves second problem too.


https://reviews.llvm.org/D27415





More information about the llvm-commits mailing list