There were two problems with the previous setup:
- We weren't setting its size, which caused problems when __llvm_addrsig wasn't the last section. In particular, __debug_line (if created) is generated and placed after __llvm_addrsig, and would result in an invalid object file w/ overlapping sections being emitted.
- The symbol indices could be invalidated if e.g. llvm-strip ran on the object file. See discussion [here][1].
To fix both these issues, we use symbol relocations instead of encoding
symbol indices directly in the section contents. The section itself
doesn't contain any data. That sidesteps the layout problem in addition
to solving the second issue.
The corresponding LLD change to read in this new format: D128938: [lld-macho] Read in new addrsig format.
It will fix the icf-safe.ll test failure on this diff.
[1]: https://discourse.llvm.org/t/problems-with-mach-o-address-significance-table-generation/63392/
This is no longer needed.