summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xllvm/test/tools/dsymutil/Inputs/basic-with-libfat-test.macho.x86_64bin0 -> 9472 bytes
-rw-r--r--llvm/test/tools/dsymutil/X86/basic-with-libfat-test.test10
-rw-r--r--llvm/tools/dsymutil/BinaryHolder.cpp6
-rw-r--r--llvm/tools/dsymutil/BinaryHolder.h1
4 files changed, 15 insertions, 2 deletions
diff --git a/llvm/test/tools/dsymutil/Inputs/basic-with-libfat-test.macho.x86_64 b/llvm/test/tools/dsymutil/Inputs/basic-with-libfat-test.macho.x86_64
new file mode 100755
index 00000000000..7160e282772
--- /dev/null
+++ b/llvm/test/tools/dsymutil/Inputs/basic-with-libfat-test.macho.x86_64
Binary files differ
diff --git a/llvm/test/tools/dsymutil/X86/basic-with-libfat-test.test b/llvm/test/tools/dsymutil/X86/basic-with-libfat-test.test
new file mode 100644
index 00000000000..0ec2d537f42
--- /dev/null
+++ b/llvm/test/tools/dsymutil/X86/basic-with-libfat-test.test
@@ -0,0 +1,10 @@
+RUN: llvm-dsymutil -f -o - -oso-prepend-path=%p/.. %p/../Inputs/basic-with-libfat-test.macho.x86_64 | llvm-dwarfdump - | FileCheck %s
+
+The test binary was created by force-linking the libfat-test.a fat archive
+with the basic linking test archive, like so:
+$ clang -all_load libfat-test.a libbasic.a basic1.macho.x86_64.o -Wl,-dead_strip -u _x86_64_var
+
+CHECK: DW_AT_name{{.*}}"x86_64_var"
+CHECK: DW_AT_name{{.*}}"basic2.c"
+CHECK: DW_AT_name{{.*}}"basic3.c"
+CHECK: DW_AT_name{{.*}}"basic1.c"
diff --git a/llvm/tools/dsymutil/BinaryHolder.cpp b/llvm/tools/dsymutil/BinaryHolder.cpp
index 7644f01952f..32d176645bf 100644
--- a/llvm/tools/dsymutil/BinaryHolder.cpp
+++ b/llvm/tools/dsymutil/BinaryHolder.cpp
@@ -79,7 +79,8 @@ BinaryHolder::GetMemoryBuffersForFile(StringRef Filename,
}
CurrentFatBinary = std::move(*ErrOrFat);
- return getMachOFatMemoryBuffers(Filename, *CurrentMemoryBuffer,
+ CurrentFatBinaryName = Filename;
+ return getMachOFatMemoryBuffers(CurrentFatBinaryName, *CurrentMemoryBuffer,
*CurrentFatBinary);
}
@@ -149,8 +150,9 @@ BinaryHolder::MapArchiveAndGetMemberBuffers(StringRef Filename,
ArchiveBuffers.push_back(CurrentMemoryBuffer->getMemBufferRef());
} else {
CurrentFatBinary = std::move(*ErrOrFat);
+ CurrentFatBinaryName = ArchiveFilename;
ArchiveBuffers = getMachOFatMemoryBuffers(
- ArchiveFilename, *CurrentMemoryBuffer, *CurrentFatBinary);
+ CurrentFatBinaryName, *CurrentMemoryBuffer, *CurrentFatBinary);
}
for (auto MemRef : ArchiveBuffers) {
diff --git a/llvm/tools/dsymutil/BinaryHolder.h b/llvm/tools/dsymutil/BinaryHolder.h
index d56a39597c2..97508b9fb09 100644
--- a/llvm/tools/dsymutil/BinaryHolder.h
+++ b/llvm/tools/dsymutil/BinaryHolder.h
@@ -42,6 +42,7 @@ class BinaryHolder {
std::unique_ptr<MemoryBuffer> CurrentMemoryBuffer;
std::vector<std::unique_ptr<object::ObjectFile>> CurrentObjectFiles;
std::unique_ptr<object::MachOUniversalBinary> CurrentFatBinary;
+ std::string CurrentFatBinaryName;
bool Verbose;
/// Get the MemoryBufferRefs for the file specification in \p
OpenPOWER on IntegriCloud