Add support for the 's' operation to llvm-ar.
authorRafael Espindola <rafael.espindola@gmail.com>
Mon, 29 Jul 2013 12:40:31 +0000 (12:40 +0000)
committerRafael Espindola <rafael.espindola@gmail.com>
Mon, 29 Jul 2013 12:40:31 +0000 (12:40 +0000)
commitcf48cf23de9207e4000df91aadc0beaa0989e33d
tree422e2b36c02d0c68da9bded48e086b254cc8f060
parentc63dce3c59ac24b2656e06f7017cd4dce4bf733c
Add support for the 's' operation to llvm-ar.

If no other operation is specified, 's' becomes an operation instead of an
modifier. The s operation just creates a symbol table. It is the same as
running ranlib.

We assume the archive was created by a sane ar (like llvm-ar or gnu ar) and
if the symbol table is present, then it is current. We use that to optimize
the most common case: a broken build system that thinks it has to run ranlib.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187353 91177308-0d34-0410-b5e6-96231b3b80d8
include/llvm/Object/Archive.h
lib/Object/Archive.cpp
test/Object/Inputs/archive-test.a-corrupt-symbol-table [new file with mode: 0644]
test/Object/archive-symtab.test
tools/llvm-ar/llvm-ar.cpp