This is an archive of the discontinued LLVM Phabricator instance.

Sort MachO sections in -r mode
ClosedPublic

Authored by pete on Jan 4 2016, 1:35 PM.

Details

Reviewers
lhames
Summary

Currently, final linked images are sorted according to things like text before data.

-r files however, are only sorted according to the atom sorter, which is correct within a section, but not really across sections.

After discussing this with Nick, he said there was no reason for the difference, and so this patch removes all the special logic which avoided sorting -r files, and just uses the same sort for everything.

Diff Detail

Event Timeline

pete updated this revision to Diff 43917.Jan 4 2016, 1:35 PM
pete retitled this revision from to Sort MachO sections in -r mode.
pete updated this object.
pete added a reviewer: lhames.
pete added a project: lld.
pete added subscribers: kledzik, llvm-commits.
lhames accepted this revision.Jan 4 2016, 2:26 PM
lhames edited edge metadata.

Assuming those comments are just clarifying existing requirements, this looks good to me. Thanks!

lib/ReaderWriter/MachO/MachONormalizedFileFromAtoms.cpp
409

Is this a new requirement with this patch, or are you just documenting an existing requirement?

482

And here?

This revision is now accepted and ready to land.Jan 4 2016, 2:26 PM
pete closed this revision.Jan 4 2016, 2:41 PM

Thanks for the review. Committed as r256786.

lib/ReaderWriter/MachO/MachONormalizedFileFromAtoms.cpp
409

Turns out it was an existing requirement. This is mostly here so that if we change something again in future we know where to look.

482

Likewise here.