[PATCH] D38136: [ELF] Simplify handling of removed sections

ben via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Sep 21 11:02:33 PDT 2017


bd1976llvm added a comment.

In https://reviews.llvm.org/D38136#877788, @ruiu wrote:

> I'm not sure if this is an improvement. Essentially, we shouldn't call getSymVA on dead symbols (or, more strictly speaking, symbols pointing to dead sections), and I don't think we want to allow it.


I am inclined to agree. In the end we probably want to restrict access to this function so that it can only be called via functions that know how to take dead symbols into account - at that point we can just have an assert in here in order to check that it hasn't been called on a dead symbol. However, at the moment this function is called for dead symbols.

Would you be willing to approve this change as an improvement for now?

- The code is much clearer and we remove the duplication of the .eh_frame comment (the exact same comment is in MarkLive.cpp:198 where we skip setting the Live bit for discarded sections.)


https://reviews.llvm.org/D38136





More information about the llvm-commits mailing list