This is an archive of the discontinued LLVM Phabricator instance.

Only emit files with subsections_via_symbols if all inputs had that set
ClosedPublic

Authored by pete on Jan 8 2016, 5:19 PM.

Details

Summary

Hi Nick, Lang

The test case parse-data-relocs-x86_64.yaml wasn't generating the same output when round tripped through lld -r.

The reason was that we were always emitting the file with the MH_SUBSECTIONS_VIA_SYMBOLS attribute, even though the input file didn't have that set.

This patch checks the files for the emitted atoms and only if they all have that attribute set, we emit the output file with that set.

Thanks,
Pete

Diff Detail

Repository
rL LLVM

Event Timeline

pete updated this revision to Diff 44390.Jan 8 2016, 5:19 PM
pete retitled this revision from to Only emit files with subsections_via_symbols if all inputs had that set.
pete updated this object.
pete added reviewers: kledzik, lhames.
pete added a project: lld.
pete added a subscriber: llvm-commits.
pete updated this revision to Diff 45052.Jan 15 2016, 4:25 PM

Rebased to ToT.

I also moved where we cached the file flags. The flags still live in File.h, but now we set them in normalizedObjectToAtoms which is consistent with some of the other file properties.

lhames accepted this revision.Jan 15 2016, 5:07 PM
lhames edited edge metadata.

LGTM. Thanks Pete!

This revision is now accepted and ready to land.Jan 15 2016, 5:07 PM
This revision was automatically updated to reflect the committed changes.