This is an archive of the discontinued LLVM Phabricator instance.

Reset input section pointers to null on each linker invocation.
ClosedPublic

Authored by ruiu on Sep 25 2018, 9:49 AM.

Details

Summary

Previously, if you invoke lld's main more than once in the same process,
the second invocation could fail or produce a wrong result due to a stale
pointer values of the previous run.

Diff Detail

Repository
rL LLVM

Event Timeline

ruiu created this revision.Sep 25 2018, 9:49 AM
grimar accepted this revision.Sep 25 2018, 11:54 AM

LGTM

This revision is now accepted and ready to land.Sep 25 2018, 11:54 AM
grimar added inline comments.
lld/ELF/Writer.cpp
1696 ↗(On Diff #166938)

Formatting is crazy sometimes...

ruiu added inline comments.Sep 25 2018, 12:25 PM
lld/ELF/Writer.cpp
1696 ↗(On Diff #166938)

Yup, but this is what clang-format did.

This revision was automatically updated to reflect the committed changes.