Literal sections can be deduplicated before running ICF. That makes it
easy to compare them during ICF: we can tell if two literals are
constant-equal by comparing their offsets in their OutputSection.
LLD-ELF takes a similar approach.
| Paths 
 |  Differential  D104671  
[lld-macho] Extend ICF to literal sections ClosedPublic Authored by int3 on Jun 21 2021, 2:22 PM. 
Details 
 Summary Literal sections can be deduplicated before running ICF. That makes it LLD-ELF takes a similar approach. 
Diff Detail 
 Event Timeline
 Comment Actions Groovy! 
 This revision is now accepted and ready to land.Jun 24 2021, 2:47 PM 
 
 
 
 
 
 Comment Actions Mm I see. I think it's easy enough to switch between the two forms for debugging purposes, so I'm landing it as-is... This revision was landed with ongoing or failed builds.Jun 28 2021, 11:50 AM Closed by commit rG557e1fa02f47: [lld-macho] Extend ICF to literal sections (authored by int3).  ·  Explain Why This revision was automatically updated to reflect the committed changes. thakis added inline comments. 
 
 
Revision Contents 
 
 
Diff 353489 lld/MachO/Driver.cpp
 lld/MachO/ICF.cpp
 lld/MachO/InputSection.cpp
 lld/MachO/Options.td
 lld/MachO/SyntheticSections.h
 lld/MachO/SyntheticSections.cpp
 lld/MachO/Writer.cpp
 lld/test/MachO/icf-literals.s
 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
we don't want to compare value early because two symbols with different values may point to the same literal