This is an archive of the discontinued LLVM Phabricator instance.

[lld-macho] Support parsing of bitcode within archives
ClosedPublic

Authored by int3 on Dec 2 2020, 8:58 PM.

Details

Reviewers
thakis
Group Reviewers
Restricted Project
Commits
rG78976bf3dae2: [lld-macho] Support parsing of bitcode within archives
Summary

Also error out if we find anything other than an object or bitcode file
in the archive.

Note that we were previously inserting the symbols and sections of the
unpacked ObjFile into the containing ArchiveFile. This was actually
unnecessary -- we can just insert the ObjectFile (or BitcodeFile) into
the inputFiles vector. This is the approach taken by LLD-ELF.

Diff Detail

Event Timeline

int3 created this revision.Dec 2 2020, 8:58 PM
Herald added a project: Restricted Project. · View Herald TranscriptDec 2 2020, 8:58 PM
int3 requested review of this revision.Dec 2 2020, 8:58 PM
int3 updated this revision to Diff 309154.Dec 2 2020, 9:40 PM

update

int3 edited the summary of this revision. (Show Details)Dec 2 2020, 9:42 PM
thakis accepted this revision.Dec 3 2020, 6:22 AM
thakis added a subscriber: thakis.

Conceptually lg, but I think it'd be good if we try to keep the various ports looking alike (in this case, probably like COFF/InputFiles.cpp).

lld/MachO/InputFiles.cpp
654

nit: other ports have a isBitcode() in InputFiles.h instead and call that here and assume obj if that returns false

This revision is now accepted and ready to land.Dec 3 2020, 6:22 AM
int3 added inline comments.Dec 3 2020, 3:18 PM
lld/MachO/InputFiles.cpp
654

Isn't it better to have more precise error handling though?

This revision was automatically updated to reflect the committed changes.