[llvm-objcopy] Add support for removing sections

This change adds support for removing sections using the -R field (as
GNU objcopy does as well). This change should let us add many helpful
tests and is a proper stepping stone for adding more general kinds of
stripping.

Differential Revision: https://reviews.llvm.org/D38260

llvm-svn: 315346
diff --git a/llvm/test/tools/llvm-objcopy/dynsym-error-remove-strtab.test b/llvm/test/tools/llvm-objcopy/dynsym-error-remove-strtab.test
new file mode 100644
index 0000000..ef6ef24
--- /dev/null
+++ b/llvm/test/tools/llvm-objcopy/dynsym-error-remove-strtab.test
@@ -0,0 +1,3 @@
+# RUN: not llvm-objcopy -R .dynstr %p/Inputs/dynsym.so %t 2>&1 >/dev/null | FileCheck %s
+
+# CHECK: String table .dynstr cannot be removed because it is referenced by the section .dynsym