This is an archive of the discontinued LLVM Phabricator instance.

[ELF] - Do not crash when LLD synthesizes output sections with BYTE commands and -r
ClosedPublic

Authored by grimar on Jun 27 2017, 3:26 AM.

Details

Summary

This is PR33596. Previously LLD would crash
because BYTE command synthesized output section,
but it was not assigned to Sec member of OutputSectionCommand.

Behaviour of -script and -r combination is not well defined,
but it seems after this change LLD naturally inherits behavior of
GNU linkers - creates output section requested in script and does not
crash anymore.

Diff Detail

Repository
rL LLVM

Event Timeline

grimar created this revision.Jun 27 2017, 3:26 AM
ruiu accepted this revision.Jun 27 2017, 11:21 AM

LGTM

This revision is now accepted and ready to land.Jun 27 2017, 11:21 AM
This revision was automatically updated to reflect the committed changes.