probinson added a comment. Aha; attribute `used` *by itself* is not sufficient to preserve sections in the output. But the `__start_/__stop_` symbols implicitly create a reference to each of the named sections, and that implicit reference can preserve them in the output (assuming gc roots etc). So, the idea is that attribute `retain` can be used *instead* of the `__start_/__stop_` symbols, to preserve sections in the output (with the advantage that it will work even for sections that do not have a C-identifier name).
Thanks for helping me understand this from a user perspective. That will be important when you go to write the release note for this new attribute. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D96838/new/ https://reviews.llvm.org/D96838 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits