[PATCH] D95851: Support for ELF section groups

Petr Hosek via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Feb 1 23:56:50 PST 2021


phosek added a subscriber: leonardchan.
phosek added a comment.

The support for ELF section groups appeared several times in various contexts over the last few months, most notably this thread https://groups.google.com/g/generic-abi/c/hgx_m1aXqUo. Most recently, we've run into the lack of support for ELF section groups in @leonardchan's work on relative vtable C++ ABI where we believe it to be the most optimal way to enable garbage collection.

I wanted to see how difficult it'd be to implement the support for ELF section groups in LLVM and lld and as you can see, it wasn't all that hard. While the change touches many different places, it is mostly mechanical.

I wanted to get some early feedback from you before I spend more time on this. Do you think this is the right direction?

In particular, one aspect I'm not particular happy about is the IR representation. Ideally, I'd want a representation allows global object to be either in COMDAT or a section group, but not both, and ideally doesn't rely on verifier to ensure correctness. One idea I had would be to introduce a new `comdat` kind of: `group`. This would achieve my goal, but semantically seems backwards (in ELF, COMDAT is a special kind of group, not the other way round).

Thank you in advance for any suggestions and feedback on the implementation.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D95851/new/

https://reviews.llvm.org/D95851



More information about the llvm-commits mailing list