This is an archive of the discontinued LLVM Phabricator instance.

[ELF] - Remove unused synthetic sections correctly.
ClosedPublic

Authored by grimar on Jan 30 2018, 2:51 AM.

Details

Summary

This is PR35740 which now crashes
because we remove unused synthetic sections incorrectly.

We can keep input section description and corresponding output
section live even if it must be empty and dead.
This results in a crash because SHF_LINK_ORDER handling code
tries to access first section which is nullptr in this case.

It is based on D37520 which tried to fix the same issue.

Diff Detail

Repository
rLLD LLVM Linker

Event Timeline

grimar created this revision.Jan 30 2018, 2:51 AM
grimar retitled this revision from [ELF] - Remove unsued synthetic sections correctly. to [ELF] - Remove unused synthetic sections correctly..Jan 30 2018, 2:52 AM
grimar updated this revision to Diff 132114.Jan 31 2018, 1:27 AM
  • Addressed review comment.
grimar accepted this revision.Jan 31 2018, 1:28 AM

LGTMed by Rafael.

This revision is now accepted and ready to land.Jan 31 2018, 1:28 AM

Ping. Rui ?

ruiu accepted this revision.Feb 6 2018, 3:34 PM

LGTM

This revision was automatically updated to reflect the committed changes.