[PATCH] D28481: Respect section groups in GC

Evgeniy Stepanov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jan 9 14:14:06 PST 2017

eugenis created this revision.
eugenis added reviewers: pcc, rnk, ruiu.
eugenis added a subscriber: llvm-commits.
eugenis set the repository for this revision to rL LLVM.

Treat sections that are part of a group as a unit in GC. This effectively makes ELF section groups behave as associative comdats in COFF.

The current implementation uses section groups for selection (i.e. discard duplicate definitions), but then ignores them in GC, potentially discarding parts of a section group.

- The new implementation matches the BFD linker behavior, while the current implementation matches Gold.

This is also necessary for proper GC of globals in AddressSanitizer. To give some context, ASan emits a "metadata global" for each application global, and needs to iterate over them at runtime. Metadata globals should not affect the liveness of original globals, and they need to be preserved if and only if the corresponding global is preserved.




-------------- next part --------------
A non-text attachment was scrubbed...
Name: D28481.83695.patch
Type: text/x-patch
Size: 4486 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170109/c6509304/attachment.bin>

More information about the llvm-commits mailing list