summaryrefslogtreecommitdiffstats
path: root/llvm/test/tools/dsymutil/Inputs
diff options
context:
space:
mode:
authorFrederic Riss <friss@apple.com>2015-07-24 06:41:11 +0000
committerFrederic Riss <friss@apple.com>2015-07-24 06:41:11 +0000
commiteb85c8fb099ec65b47467d15b9ea1018ca201f6b (patch)
treecb3f6944d5153d5eedfc710456ea8d7dc30b0fc2 /llvm/test/tools/dsymutil/Inputs
parent65f0abf275ccc1eb249bb12ce4ac826c9df37986 (diff)
downloadbcm5719-llvm-eb85c8fb099ec65b47467d15b9ea1018ca201f6b.tar.gz
bcm5719-llvm-eb85c8fb099ec65b47467d15b9ea1018ca201f6b.zip
[dsymutil] Implement support for universal mach-o object files.
This patch allows llvm-dsymutil to read universal (aka fat) macho object files and archives. The patch touches nearly everything in the BinaryHolder, but it is fairly mechinical: the methods that returned MemoryBufferRefs or ObjectFiles now return a vector of those, and the high-level access function takes a triple argument to select the architecture. There is no support yet for handling fat executables and thus no support for writing fat object files. llvm-svn: 243096
Diffstat (limited to 'llvm/test/tools/dsymutil/Inputs')
-rw-r--r--llvm/test/tools/dsymutil/Inputs/fat-test.c17
-rw-r--r--llvm/test/tools/dsymutil/Inputs/fat-test.obin0 -> 5000 bytes
-rw-r--r--llvm/test/tools/dsymutil/Inputs/libfat-test.abin0 -> 5136 bytes
3 files changed, 17 insertions, 0 deletions
diff --git a/llvm/test/tools/dsymutil/Inputs/fat-test.c b/llvm/test/tools/dsymutil/Inputs/fat-test.c
new file mode 100644
index 00000000000..42c1fce1ec3
--- /dev/null
+++ b/llvm/test/tools/dsymutil/Inputs/fat-test.c
@@ -0,0 +1,17 @@
+/* Compile with:
+ clang -c -g -arch x86_64h -arch x86_64 -arch i386 fat-test.c
+ libtool -static -o libfat-test.a fat-test.o
+
+ To reduce the size of the fat .o:
+ lipo -thin i386 -o fat-test.i386.o fat-test.o
+ lipo -thin x86_64 -o fat-test.x86_64.o fat-test.o
+ lipo -thin x86_64h -o fat-test.x86_64h.o fat-test.o
+ lipo -create -arch x86_64h fat-test.x86_64h.o -arch x86_64 fat-test.x86_64.o -arch i386 fat-test.i386.o -o fat-test.o -segalign i386 8 -segalign x86_64 8 -segalign x86_64h 8
+ */
+#ifdef __x86_64h__
+int x86_64h_var;
+#elif defined(__x86_64__)
+int x86_64_var;
+#else
+int i386_var;
+#endif
diff --git a/llvm/test/tools/dsymutil/Inputs/fat-test.o b/llvm/test/tools/dsymutil/Inputs/fat-test.o
new file mode 100644
index 00000000000..8159cc74977
--- /dev/null
+++ b/llvm/test/tools/dsymutil/Inputs/fat-test.o
Binary files differ
diff --git a/llvm/test/tools/dsymutil/Inputs/libfat-test.a b/llvm/test/tools/dsymutil/Inputs/libfat-test.a
new file mode 100644
index 00000000000..6b34b0fd6f9
--- /dev/null
+++ b/llvm/test/tools/dsymutil/Inputs/libfat-test.a
Binary files differ
OpenPOWER on IntegriCloud