This is an archive of the discontinued LLVM Phabricator instance.

ELF: Make link() to take an output stream to which error messages are written.
ClosedPublic

Authored by ruiu on Jan 27 2016, 7:07 PM.

Details

Reviewers
rafael
Summary

Now that we can do this.

Diff Detail

Event Timeline

ruiu updated this revision to Diff 46211.Jan 27 2016, 7:07 PM
ruiu retitled this revision from to ELF: Remove fatal() and add the second parameter to the linker's entry point..
ruiu updated this object.
ruiu added a reviewer: rafael.
ruiu added a subscriber: llvm-commits.
rafael edited edge metadata.Feb 1 2016, 5:36 AM

I don't think so.

The problem is that we were not at 100% coverage with fatal. There are many cases where we would just follow a broken offset and crash. If we can produce a segmentation fault, we can call fatal.

If we cannot produce a segmentation fault, we will need another way of fixing this.

silvas added a subscriber: silvas.Feb 1 2016, 11:18 AM

I don't think so.

The problem is that we were not at 100% coverage with fatal. There are many cases where we would just follow a broken offset and crash. If we can produce a segmentation fault, we can call fatal.

If we cannot produce a segmentation fault, we will need another way of fixing this.

I think this does cover the case of programmatic invocation of LLD (i.e., with known-good object files, which seems like the primary use case for programmatic invocation), so it does still seem worth it.

Bulletproofing against all possible defective object files (i.e. guaranteeing no segfaults) is a huge amount of work I suspect (and probably not worth it?), but this change does seem to cover a real (and requested by many people in the community) use case.

ruiu updated this revision to Diff 46590.Feb 1 2016, 4:15 PM
ruiu edited edge metadata.
  • Adjust the scope of this patch.
ruiu retitled this revision from ELF: Remove fatal() and add the second parameter to the linker's entry point. to ELF: Make link() to take an output stream to which error messages are written..Feb 1 2016, 4:15 PM
rafael accepted this revision.Feb 2 2016, 1:41 PM
rafael edited edge metadata.

LGTM

This revision is now accepted and ready to land.Feb 2 2016, 1:41 PM
Eugene.Zelenko added a subscriber: Eugene.Zelenko.

Committed in r259597.