This is an archive of the discontinued LLVM Phabricator instance.

Get ObjectFileMachO to handle @executable_path in main executable's LC_LOAD_DYLIB commands
ClosedPublic

Authored by jingham on Mar 15 2017, 4:58 PM.

Details

Reviewers
clayborg
Summary

ObjectFileMachO does some work to decode RPATHS & @executable_path and the like. But it wasn't handling the case where an LC_LOAD_DYLIB in the main executable referred to the library by @executable_path. This patch gets that to work.

I also added a test that ensures that we read in a local loaded library from the main executable to exercise this case. The test is currently only enabled on macOS, just because I don't know what other platforms support finding this. If you own such a platform, please adjust the test to include that platform.

Diff Detail

Repository
rL LLVM

Event Timeline

jingham created this revision.Mar 15 2017, 4:58 PM
clayborg accepted this revision.Mar 16 2017, 7:43 PM

Looks fine.

This revision is now accepted and ready to land.Mar 16 2017, 7:43 PM
jingham closed this revision.Mar 20 2017, 12:34 PM

Closed by r298290.