This is an archive of the discontinued LLVM Phabricator instance.

[ELF] Skip non-InputSection's in getErrPlace
AbandonedPublic

Authored by MaskRay on Aug 7 2018, 4:39 PM.

Details

Summary

Otherwise MergeInputSection's can also be iterated and will cause cast error.

Event Timeline

MaskRay created this revision.Aug 7 2018, 4:39 PM

Is it possible to add a test case?

grimar added a subscriber: grimar.EditedAug 14 2018, 4:13 AM

It seems caused by rL336106. But I really do not understand how it can happen.

As my comment for the commit says:
"We should only have InputSection type of the sections in the vector.
(because we already converted MergeInputSection in mergeSections()
and combined EhInputSections in combineEhFrameSections())."

What am I missing?

MaskRay abandoned this revision.EditedAug 14 2018, 4:04 PM

It seems caused by rL336106. But I really do not understand how it can happen.

As my comment for the commit says:
"We should only have InputSection type of the sections in the vector.
(because we already converted MergeInputSection in mergeSections()
and combined EhInputSections in combineEhFrameSections())."

What am I missing?

Thanks for the information! I find that mergeSections() does not remove non-alive sections as its comment says. I have created D50742

In an internal target, both revisions will fix the invalid cast but D50742 is obviously the way to go.