https://github.com/smithp35 approved this pull request. LGTM. Always good to have the flexibility to write to a file. Above printGCSections, there is printIcfSections. Although not for this patch, would it be useful to apply the same logic to that too? https://github.com/llvm/llvm-project/pull/159706