This is an archive of the discontinued LLVM Phabricator instance.

[ELF] - Do not crash when do --gc-sections for non-allocatable metadata sections.
ClosedPublic

Authored by grimar on May 15 2018, 7:23 AM.

Details

Summary

Currently, LLD marks all non-allocatable sections except SHF_REL[A] as Live
when doing GC.

This can be a reason of the crash when SHF_LINK_ORDER sections
are involved, because their parents can be dead.

We should do GC for them correctly. The patch implements it.

Diff Detail

Repository
rLLD LLVM Linker

Event Timeline

grimar created this revision.May 15 2018, 7:23 AM
grimar edited the summary of this revision. (Show Details)May 15 2018, 7:26 AM
grimar edited reviewers, added: ruiu; removed: espindola.
grimar added subscribers: llvm-commits, grimar, evgeny777, ikudrin.

This is for use with D46874. (currently LLD just crashes)

ruiu accepted this revision.May 16 2018, 11:01 AM

LGTM

This revision is now accepted and ready to land.May 16 2018, 11:01 AM
This revision was automatically updated to reflect the committed changes.