This is an archive of the discontinued LLVM Phabricator instance.

ELF: Discard .ARM.exidx sections for empty functions instead of misordering them.
ClosedPublic

Authored by pcc on Nov 1 2019, 6:59 PM.

Details

Summary

The logic added in r372781 caused ARMExidxSyntheticSection::addSection()
to return false for exidx sections without a link order dep that passed
isValidExidxSectionDep(). This included exidx sections for empty functions. As
a result, such exidx sections would end up treated like ordinary sections and
would end up being laid out before the ARMExidxSyntheticSection, most likely in
the wrong order relative to the exidx entries in the ARMExidxSyntheticSection,
breaking the orderedness invariant relied upon by unwinders. Fix this by
simply discarding such sections.

Diff Detail

Event Timeline

pcc created this revision.Nov 1 2019, 6:59 PM

LG.

lld/test/ELF/empty-fn-exidx.s
9 ↗(On Diff #227558)

This line can be deleted.

MaskRay added inline comments.Nov 1 2019, 11:59 PM
lld/test/ELF/empty-fn-exidx.s
1 ↗(On Diff #227558)

This test should be renamed to arm-exidx-*.s

LGTM to, apologies for missing this case in 372781.

This revision was not accepted when it landed; it landed in state Needs Review.Nov 4 2019, 9:12 AM
This revision was automatically updated to reflect the committed changes.