summaryrefslogtreecommitdiffstats
path: root/llvm/test/Object
diff options
context:
space:
mode:
authorRui Ueyama <ruiu@google.com>2015-08-28 05:47:46 +0000
committerRui Ueyama <ruiu@google.com>2015-08-28 05:47:46 +0000
commit22b1b7aad235d614a0de578cba62498b288dd830 (patch)
treec892bee7135f38f0872d9d937129791c06fd57dd /llvm/test/Object
parent1e051aab0cc12bb4a4c1be8d1b1b70537fd0f012 (diff)
downloadbcm5719-llvm-22b1b7aad235d614a0de578cba62498b288dd830.tar.gz
bcm5719-llvm-22b1b7aad235d614a0de578cba62498b288dd830.zip
Object: Teach llvm-ar to create symbol table for COFF short import files.
COFF short import files are special kind of files that contains only DLL-exported symbol names. That's different from object files because it has no data except symbol names. This change implements a SymbolicFile interface for the short import files so that symbol names can be accessed through that interface. llvm-ar is now able to read the file and create symbol table entries for short import files. llvm-svn: 246276
Diffstat (limited to 'llvm/test/Object')
-rw-r--r--llvm/test/Object/Inputs/coff-short-import-codebin0 -> 31 bytes
-rw-r--r--llvm/test/Object/Inputs/coff-short-import-databin0 -> 31 bytes
-rw-r--r--llvm/test/Object/archive-symtab.test10
3 files changed, 10 insertions, 0 deletions
diff --git a/llvm/test/Object/Inputs/coff-short-import-code b/llvm/test/Object/Inputs/coff-short-import-code
new file mode 100644
index 00000000000..446279037b5
--- /dev/null
+++ b/llvm/test/Object/Inputs/coff-short-import-code
Binary files differ
diff --git a/llvm/test/Object/Inputs/coff-short-import-data b/llvm/test/Object/Inputs/coff-short-import-data
new file mode 100644
index 00000000000..71b635ba192
--- /dev/null
+++ b/llvm/test/Object/Inputs/coff-short-import-data
Binary files differ
diff --git a/llvm/test/Object/archive-symtab.test b/llvm/test/Object/archive-symtab.test
index c50833d6a77..120401bad36 100644
--- a/llvm/test/Object/archive-symtab.test
+++ b/llvm/test/Object/archive-symtab.test
@@ -99,6 +99,16 @@ MACHO-NEXT: 0000000000000000 t _bar
MACHO-NEXT: 0000000000000001 T _foo
MACHO-NEXT: 0000000000000002 T _main
+RUN: rm -f %t.a
+RUN: llvm-ar --format=gnu rcsU %t.a %p/Inputs/coff-short-import-code %p/Inputs/coff-short-import-data
+RUN: llvm-nm -M %t.a | FileCheck --check-prefix=COFF-SHORT-IMPORT %s
+
+COFF-SHORT-IMPORT: Archive map
+COFF-SHORT-IMPORT-NEXT: _foo in coff-short-import-code
+COFF-SHORT-IMPORT-NEXT: __imp__foo in coff-short-import-code
+COFF-SHORT-IMPORT-NEXT: _bar in coff-short-import-data
+COFF-SHORT-IMPORT-NOT: __imp__bar in coff-short-import-data
+
Test that we pad the symbol table so that it ends in a multiple of 4 bytes:
8 + 60 + 36 == 104
RUN: rm -f %t.a
OpenPOWER on IntegriCloud