For now, only non-strings are supported. I have also made no effort to optimize this.
I am doing a fresh clang build and will put the numbers in here.
| Paths 
 |  Differential  D13814  
Add support for SHF_MERGE sections ClosedPublic Authored by • rafael on Oct 16 2015, 9:17 AM. 
Details 
 Summary For now, only non-strings are supported. I have also made no effort to optimize this. I am doing a fresh clang build and will put the numbers in here. 
Diff Detail Event Timeline• rafael updated this object. Comment Actions Gold takes 1.132828663s and produces a 77868808 bytes binary. It is a pretty small saving. I think a lot more in is SHF_STRINGS, which this is a stepping stone for. shankare added inline comments. 
 
 Comment Actions This is still in the prototype stage. Uploading a new version since I am closing for the day. I will go over the suggestions as soon as I get back to work. Comment Actions I think this implements every review request except: 
 There is substantial overlap on what the bodies would be. And I have also not implemented the requested optimization. I will start coding it now. It can be committed with this patch or as an immediate followup. I would have a small preference of committing in as a followup. Comment Actions I don't think splitting the loop would produce substantially duplicated code. Even if code in total gets larger, it's a good thing to do as long as each loop becomes more clear. I didn't try that myself though. You can leave it as is for now if you want. I'll take a look at that later. 
 • rafael updated this object. • rafael edited edge metadata.Comment Actions Correctly handle addends when creating dynamic relocations. This revision is now accepted and ready to land.Oct 19 2015, 1:45 PM 
Revision Contents 
 
Diff 37762 ELF/InputFiles.h
 ELF/InputFiles.cpp
 ELF/InputSection.h
 ELF/InputSection.cpp
 ELF/OutputSections.h
 ELF/OutputSections.cpp
 ELF/Symbols.h
 ELF/Writer.cpp
 test/elf2/Inputs/merge.s
 
 test/elf2/merge-invalid-size.s
 
 test/elf2/merge.s
 
 test/elf2/relocation-in-merge.s
 
 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
An appropriate error message might be needed here.