This is an archive of the discontinued LLVM Phabricator instance.

Track whether all relocations in a section are implicit, and don't emit them in that case
ClosedPublic

Authored by pete on Dec 16 2015, 3:50 PM.

Details

Reviewers
kledzik
lhames
Summary

Hi Nick

The __eh_frame section contains relocations which can always be implicitly generated.

This patch tracks whether sections have only implicitly relocations and skips emitting them to the object file if that is the case.

The test case here ensures that this is the case for __eh_frame sections.

Diff Detail

Event Timeline

pete updated this revision to Diff 43077.Dec 16 2015, 3:50 PM
pete retitled this revision from to Track whether all relocations in a section are implicit, and don't emit them in that case.
pete updated this object.
pete added a reviewer: kledzik.
pete added a project: lld.
pete added subscribers: lhames, llvm-commits.
pete updated this revision to Diff 44029.Jan 5 2016, 11:16 AM

Rebased to trunk

lhames accepted this revision.Jan 7 2016, 1:07 PM
lhames added a reviewer: lhames.

Apart from that, LGTM. Thanks Pete!

lib/ReaderWriter/MachO/MachONormalizedFileBinaryUtils.h
172

Maybe "relocsToDefinedCanBeImplicit"? Either way I think there should be a clear comment on the field in the struct definition below.

lib/ReaderWriter/MachO/MachONormalizedFileFromAtoms.cpp
63

We should have a comment explaining what this field implies when parsing and writing out a section.

This revision is now accepted and ready to land.Jan 7 2016, 1:07 PM
pete closed this revision.Jan 7 2016, 1:11 PM

Thanks Lang. Committed with those fixes in r257099.