summaryrefslogtreecommitdiffstats
path: root/llvm/test/Object
diff options
context:
space:
mode:
authorRafael Espindola <rafael.espindola@gmail.com>2017-03-14 19:57:13 +0000
committerRafael Espindola <rafael.espindola@gmail.com>2017-03-14 19:57:13 +0000
commit8f2dd7c042bd6776cffee9bc9c916ab1151a9cdc (patch)
tree4cbe1458f21f8ff22b2f0aa6743f7ffa76a743a2 /llvm/test/Object
parentc32a1bdd5f0cf76200a980540ef5688a4ab3e332 (diff)
downloadbcm5719-llvm-8f2dd7c042bd6776cffee9bc9c916ab1151a9cdc.tar.gz
bcm5719-llvm-8f2dd7c042bd6776cffee9bc9c916ab1151a9cdc.zip
Archives require a symbol table on Solaris, even if empty.
On Solaris ld (and some other tools that use the underlying utility libraries, such as elfdump) chokes on an archive library that has no symbol table. The Solaris tools always create one, even if it's empty. That bug has been fixed in the latest development line, and can probably be backported to a supported release, but it would be nice if LLVM's archiver could emit the empty symbol table, too. Patch by Danek Duvall! llvm-svn: 297773
Diffstat (limited to 'llvm/test/Object')
-rw-r--r--llvm/test/Object/Inputs/solaris-nosymbols.yaml7
-rw-r--r--llvm/test/Object/archive-format.test12
2 files changed, 19 insertions, 0 deletions
diff --git a/llvm/test/Object/Inputs/solaris-nosymbols.yaml b/llvm/test/Object/Inputs/solaris-nosymbols.yaml
new file mode 100644
index 00000000000..85dabedcf9a
--- /dev/null
+++ b/llvm/test/Object/Inputs/solaris-nosymbols.yaml
@@ -0,0 +1,7 @@
+--- !ELF
+FileHeader:
+ Class: ELFCLASS64
+ Data: ELFDATA2LSB
+ Type: ET_REL
+ Machine: EM_X86_64
+...
diff --git a/llvm/test/Object/archive-format.test b/llvm/test/Object/archive-format.test
index f895a36bce3..219fc7f894a 100644
--- a/llvm/test/Object/archive-format.test
+++ b/llvm/test/Object/archive-format.test
@@ -78,3 +78,15 @@ THIN-PATH-NEXT: /65 0 0 0 644 4 `
RUN: not llvm-ar --format=bsd rcT bad.a 0123456789abcde 0123456789abcdef 2>&1 | FileCheck --check-prefix=BSD-THIN %s
BSD-THIN: Only the gnu format has a thin mode.
+
+If an archive has an object with no symbols, the linker and some other
+tools on some versions of Solaris will abort operations if there is no
+symbol table. Create such an object, put it into an archive, and check to
+see that there is an empty symbol table.
+RUN: mkdir -p %t
+RUN: yaml2obj %S/Inputs/solaris-nosymbols.yaml > %t/foo.o
+RUN: llvm-ar rs %t/foo.a %t/foo.o
+RUN: cat -v %t/foo.a | FileCheck -strict-whitespace --check-prefix=SOLARIS %s
+SOLARIS: !<arch>
+SOLARIS-NEXT: / 0 0 0 0 8 `
+SOLARIS-NEXT: ^@^@^@^@^@^@^@^@foo.o/
OpenPOWER on IntegriCloud