From 23dd15e26d81c3230e7dc7b184a5dc8e37e8f3bb Mon Sep 17 00:00:00 2001 From: Jean-Daniel Dupas Date: Thu, 18 Dec 2014 21:33:38 +0000 Subject: [macho] -rpath support Summary: Work on adding -rpath support to the mach-o linker. This patch is based on the ld64 behavior for the command line option validation. It includes a basic test to check that the LC_RPATH load commands are properly generated when that option is used. It also add LC_RPATH support to the binary reader, but I don't know how to test it though. Reviewers: kledzik Subscribers: llvm-commits Projects: #lld Differential Revision: http://reviews.llvm.org/D6724 llvm-svn: 224544 --- lld/lib/ReaderWriter/MachO/MachONormalizedFileBinaryReader.cpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'lld/lib/ReaderWriter/MachO/MachONormalizedFileBinaryReader.cpp') diff --git a/lld/lib/ReaderWriter/MachO/MachONormalizedFileBinaryReader.cpp b/lld/lib/ReaderWriter/MachO/MachONormalizedFileBinaryReader.cpp index 89c6213c845..ef8ad1d3325 100644 --- a/lld/lib/ReaderWriter/MachO/MachONormalizedFileBinaryReader.cpp +++ b/lld/lib/ReaderWriter/MachO/MachONormalizedFileBinaryReader.cpp @@ -460,6 +460,11 @@ readBinary(std::unique_ptr &mb, f->dependentDylibs.push_back(entry); } break; + case LC_RPATH: { + const rpath_command *rpc = reinterpret_cast(lc); + f->rpaths.push_back(lc + read32(&rpc->path, isBig)); + } + break; case LC_DYLD_INFO: case LC_DYLD_INFO_ONLY: dyldInfo = reinterpret_cast(lc); -- cgit v1.2.3