This is an archive of the discontinued LLVM Phabricator instance.

[ELF2] Don't crash on symbolless relocations when writing shared libraries
AbandonedPublic

Authored by hfinkel on Oct 12 2015, 11:00 AM.

Details

Reviewers
ruiu
rafael
Summary

This is, in a sense, a related fix to D13564. For certain special relocations, such as R_PPC64_TOC, there is no actual corresponding symbol in the object file. In these cases Obj.getRelocationSymbol will return nullptr.

This allows us to produce shared libraries from PPC64 object files. I've yet to verify that the resulting behavior is completely correct, but in the name of incremental progress, at least we won't segfault.

Diff Detail

Event Timeline

hfinkel updated this revision to Diff 37135.Oct 12 2015, 11:00 AM
hfinkel retitled this revision from to [ELF2] Don't crash on symbolless relocations when writing shared libraries.
hfinkel updated this object.
hfinkel added reviewers: ruiu, rafael.
hfinkel added a project: lld.
hfinkel added a subscriber: llvm-commits.
ruiu accepted this revision.Oct 12 2015, 11:07 AM
ruiu edited edge metadata.

LGTM

This revision is now accepted and ready to land.Oct 12 2015, 11:07 AM
hfinkel abandoned this revision.Oct 12 2015, 1:50 PM

This patch is no longer necessary after r250095. The test case change will be merged into D13565 prior to commit.