This is an archive of the discontinued LLVM Phabricator instance.

[ELF] - Stop removing sections in removeUnusedSyntheticSections().
ClosedPublic

Authored by grimar on Sep 29 2017, 2:33 AM.

Details

Summary

That makes code a bit more consistent. Instead of removing sections there
we can just mark them as dead. So that removeEmptyCommands() will
handle the rest.

Diff Detail

Event Timeline

grimar created this revision.Sep 29 2017, 2:33 AM
ruiu accepted this revision.Oct 1 2017, 6:59 PM

LGTM

This revision is now accepted and ready to land.Oct 1 2017, 6:59 PM
This revision was automatically updated to reflect the committed changes.
ruiu added a comment.Oct 2 2017, 11:01 AM

On second thought, I think removeUnusedSyntehticSections is a source of confusion. This mechanism seems too hacky, and that's why you need to write many pieces of tricky code. I feels we could design a better mechanism. Can you visit this again to design something new?

grimar added a comment.Oct 3 2017, 5:33 AM
In D38393#886125, @ruiu wrote:

On second thought, I think removeUnusedSyntehticSections is a source of confusion. This mechanism seems too hacky, and that's why you need to write many pieces of tricky code. I feels we could design a better mechanism. Can you visit this again to design something new?

I'll take a look what can I suggest here.

grimar added a comment.Oct 6 2017, 2:21 AM
In D38393#886125, @ruiu wrote:

On second thought, I think removeUnusedSyntehticSections is a source of confusion. This mechanism seems too hacky, and that's why you need to write many pieces of tricky code. I feels we could design a better mechanism. Can you visit this again to design something new?

I suggest to do following change: https://reviews.llvm.org/D38613