[PATCH] D61674: [llvm-objcopy] Improve error message for unrecognised archive member

George Rimar via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed May 8 05:35:56 PDT 2019


grimar added inline comments.


================
Comment at: test/tools/llvm-objcopy/ELF/archive-unknown-members.test:2
+## Show that llvm-objcopy and llvm-strip emit errors when attempting to modify
+## archives containing unrecognised files, and do not modify anything. We use
+## --strip-debug so that the section should be removed, and a difference
----------------
unrecognised -> unrecognized I think?


================
Comment at: test/tools/llvm-objcopy/ELF/archive-unknown-members.test:26
+
+# RUN: not llvm-objcopy --strip-debug %t.thin1.a %t2.a 2>&1 \
+# RUN:   | FileCheck %s --check-prefix=THIN -DARCHIVE=%t.thin1.a -DMEMBER=%s
----------------
You have `%t.thin1.a %t2.a` for llvm-objcopy call and just ` %t.thin2.a` for llvm-strip.
I think you placed `%t2.a` by mistake?



================
Comment at: tools/llvm-objcopy/llvm-objcopy.cpp:165
+                             ChildOrErr.takeError());
+    Binary *Bin = ChildOrErr->get();
+
----------------
nit: while you are here: I would perhaps remove this variable since it is used only once.


Repository:
  rL LLVM

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D61674/new/

https://reviews.llvm.org/D61674





More information about the llvm-commits mailing list