[PATCH] D29150: Add --warn-unresolved-symbols and --error-unresolved-symbols options

Davide Italiano via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jan 25 17:49:33 PST 2017


davide requested changes to this revision.
davide added a comment.
This revision now requires changes to proceed.

Some comments inline.



================
Comment at: test/ELF/warn-unresolved-symbols.s:2-3
+# REQUIRES: x86
+# RUN: llvm-mc -filetype=obj -triple=x86_64-pc-linux %s -o %t1.o
+# RUN: llvm-mc -filetype=obj -triple=x86_64-pc-linux %p/Inputs/unresolved-symbols.s -o %t2.o
+
----------------
Do you really need two object files? If not, you can probably simplify this test a bit.


================
Comment at: test/ELF/warn-unresolved-symbols.s:23-32
+## Do not report undefines if linking relocatable or shared.
+# RUN: ld.lld -r %t1.o %t2.o -o %t7 --error-unresolved-symbols 2>&1 | \
+# RUN:  FileCheck -allow-empty -check-prefix=NOERR %s
+# RUN: ld.lld -shared %t1.o %t2.o -o %t8.so --error-unresolved-symbols 2>&1 | \
+# RUN:  FileCheck -allow-empty -check-prefix=NOERR %s
+# RUN: ld.lld -r %t1.o %t2.o -o %t9 --warn-unresolved-symbols 2>&1 | \
+# RUN:  FileCheck -allow-empty -check-prefix=NOWARN %s
----------------
gold and bfd accept both the single dash and the double dash variant of this option.
You can change some of the invocations here to `-` in order to make sure we support it correctly.


https://reviews.llvm.org/D29150





More information about the llvm-commits mailing list