[PATCH] D37561: [ELF] - Don't crash when --emit-relocs is used with --gc-sections

Rui Ueyama via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Sep 12 17:32:53 PDT 2017


ruiu added a comment.

I think instead of "fixing" a concrete bug, you want to think more abstractly and focus on an invariant at each stage of linking. Invariants are abstract concepts but important to make program easier to understand. One invariant in lld is that, if some section is not marked as "live" after GC, it should be actually live, and it should be emitted to the output file.

A situation like "this section is not marked as live, but this is actually dead because a section that the section depends on is marked as dead by gc" is not ok. That is a violation of the invariant and needs fixing.


https://reviews.llvm.org/D37561





More information about the llvm-commits mailing list