This is an archive of the discontinued LLVM Phabricator instance.

[ELF] --gc-sections: retain dependent sections of non-SHF_ALLOC sections
ClosedPublic

Authored by MaskRay on Oct 20 2020, 6:12 PM.

Details

Summary

Fix http://lists.llvm.org/pipermail/llvm-dev/2020-October/145908.html

Currently non-SHF_ALLOC SHT_REL[A] (due to --emit-relocs) and SHF_LINK_ORDER are not
marked live.

Diff Detail

Event Timeline

MaskRay created this revision.Oct 20 2020, 6:12 PM
MaskRay requested review of this revision.Oct 20 2020, 6:12 PM
MaskRay updated this revision to Diff 299532.

Drop an unneeded change

Harbormaster completed remote builds in B75802: Diff 299532.
psmith accepted this revision.Oct 21 2020, 3:26 AM

LGTM. If we are marking a section live it makes sense to mark its dependent sections live.

This revision is now accepted and ready to land.Oct 21 2020, 3:26 AM
grimar accepted this revision.Oct 21 2020, 5:46 AM

LGTM too.

lld/ELF/MarkLive.cpp
368

nit: perhaps worth updating this comment.

MaskRay updated this revision to Diff 299733.Oct 21 2020, 10:08 AM
MaskRay marked an inline comment as done.

Update comment

This revision was landed with ongoing or failed builds.Oct 21 2020, 10:11 AM
This revision was automatically updated to reflect the committed changes.