summaryrefslogtreecommitdiffstats
path: root/lld
diff options
context:
space:
mode:
authorSam Clegg <sbc@chromium.org>2018-05-05 01:23:07 +0000
committerSam Clegg <sbc@chromium.org>2018-05-05 01:23:07 +0000
commit752494bfe3f04c8d329dfa8ac671b26e0115069c (patch)
tree4ed4efab9c2288a00e27924574d1efb9eb0b62f8 /lld
parente04ecc88de83af096d9d293ea11bb70ee564de1c (diff)
downloadbcm5719-llvm-752494bfe3f04c8d329dfa8ac671b26e0115069c.tar.gz
bcm5719-llvm-752494bfe3f04c8d329dfa8ac671b26e0115069c.zip
[WebAssembly] Check function signatures by default
But only produce a warning (for now) unless --fatal-warnings is passed. Differential Revision: https://reviews.llvm.org/D46484 llvm-svn: 331574
Diffstat (limited to 'lld')
-rw-r--r--lld/test/wasm/alias.ll2
-rw-r--r--lld/test/wasm/archive.ll6
-rw-r--r--lld/test/wasm/call-indirect.ll2
-rw-r--r--lld/test/wasm/comdats.ll2
-rw-r--r--lld/test/wasm/conflict.test2
-rw-r--r--lld/test/wasm/custom-sections.ll2
-rw-r--r--lld/test/wasm/cxx-mangling.ll4
-rw-r--r--lld/test/wasm/data-layout.ll6
-rw-r--r--lld/test/wasm/demangle.ll4
-rw-r--r--lld/test/wasm/entry.ll6
-rw-r--r--lld/test/wasm/export-table.test2
-rw-r--r--lld/test/wasm/export.ll4
-rw-r--r--lld/test/wasm/fatal-warnings.ll14
-rw-r--r--lld/test/wasm/function-imports-first.ll2
-rw-r--r--lld/test/wasm/function-imports.ll2
-rw-r--r--lld/test/wasm/function-index.test2
-rw-r--r--lld/test/wasm/import-memory.test4
-rw-r--r--lld/test/wasm/import-table.test2
-rw-r--r--lld/test/wasm/init-fini.ll4
-rw-r--r--lld/test/wasm/invalid-stack-size.test2
-rw-r--r--lld/test/wasm/load-undefined.test6
-rw-r--r--lld/test/wasm/local-symbols.ll2
-rw-r--r--lld/test/wasm/locals-duplicate.test4
-rw-r--r--lld/test/wasm/many-functions.ll2
-rw-r--r--lld/test/wasm/reloc-addend.ll2
-rw-r--r--lld/test/wasm/relocatable.ll2
-rw-r--r--lld/test/wasm/signature-mismatch-weak.ll5
-rw-r--r--lld/test/wasm/signature-mismatch.ll4
-rw-r--r--lld/test/wasm/stack-first.test2
-rw-r--r--lld/test/wasm/stack-pointer.ll2
-rw-r--r--lld/test/wasm/strip-debug.test2
-rw-r--r--lld/test/wasm/symbol-type-mismatch.ll2
-rw-r--r--lld/test/wasm/undefined-entry.test6
-rw-r--r--lld/test/wasm/undefined-weak-call.ll2
-rw-r--r--lld/test/wasm/undefined.ll8
-rw-r--r--lld/test/wasm/version.ll2
-rw-r--r--lld/test/wasm/visibility-hidden.ll2
-rw-r--r--lld/test/wasm/weak-alias-overide.ll2
-rw-r--r--lld/test/wasm/weak-alias.ll4
-rw-r--r--lld/test/wasm/weak-symbols.ll2
-rw-r--r--lld/test/wasm/weak-undefined.ll2
-rw-r--r--lld/wasm/Config.h1
-rw-r--r--lld/wasm/Driver.cpp4
-rw-r--r--lld/wasm/Options.td4
-rw-r--r--lld/wasm/SymbolTable.cpp11
45 files changed, 82 insertions, 77 deletions
diff --git a/lld/test/wasm/alias.ll b/lld/test/wasm/alias.ll
index c12ef2dd129..af2f87b7d3a 100644
--- a/lld/test/wasm/alias.ll
+++ b/lld/test/wasm/alias.ll
@@ -1,5 +1,5 @@
; RUN: llc -filetype=obj -o %t.o %s
-; RUN: wasm-ld --check-signatures %t.o -o %t.wasm
+; RUN: wasm-ld %t.o -o %t.wasm
; RUN: obj2yaml %t.wasm | FileCheck %s
target triple = "wasm32-unknown-unknown-wasm"
diff --git a/lld/test/wasm/archive.ll b/lld/test/wasm/archive.ll
index 78daff0e93c..8a7ddf42491 100644
--- a/lld/test/wasm/archive.ll
+++ b/lld/test/wasm/archive.ll
@@ -4,12 +4,12 @@
; RUN: llc -filetype=obj %S/Inputs/hello.ll -o %t.a3.o
; RUN: llvm-ar rcs %t.a %t.a1.o %t.a2.o %t.a3.o
; RUN: rm -f %t.imports
-; RUN: not wasm-ld --check-signatures %t.a %t.o -o %t.wasm 2>&1 | FileCheck -check-prefix=CHECK-UNDEFINED %s
+; RUN: not wasm-ld %t.a %t.o -o %t.wasm 2>&1 | FileCheck -check-prefix=CHECK-UNDEFINED %s
; CHECK-UNDEFINED: undefined symbol: missing_func
; RUN: echo 'missing_func' > %t.imports
-; RUN: wasm-ld --check-signatures -r %t.a %t.o -o %t.wasm
+; RUN: wasm-ld -r %t.a %t.o -o %t.wasm
; RUN: llvm-nm -a %t.wasm | FileCheck %s
@@ -40,4 +40,4 @@ entry:
; CHECK-NOT: hello
; Specifying the same archive twice is allowed.
-; RUN: wasm-ld --check-signatures %t.a %t.a %t.o -o %t.wasm
+; RUN: wasm-ld %t.a %t.a %t.o -o %t.wasm
diff --git a/lld/test/wasm/call-indirect.ll b/lld/test/wasm/call-indirect.ll
index 9a6d64f98d1..39f056089ea 100644
--- a/lld/test/wasm/call-indirect.ll
+++ b/lld/test/wasm/call-indirect.ll
@@ -1,6 +1,6 @@
; RUN: llc -filetype=obj %p/Inputs/call-indirect.ll -o %t2.o
; RUN: llc -filetype=obj %s -o %t.o
-; RUN: wasm-ld --check-signatures -o %t.wasm %t2.o %t.o
+; RUN: wasm-ld -o %t.wasm %t2.o %t.o
; RUN: obj2yaml %t.wasm | FileCheck %s
; bitcode generated from the following C code:
diff --git a/lld/test/wasm/comdats.ll b/lld/test/wasm/comdats.ll
index d737132d705..64ad0f2a9ea 100644
--- a/lld/test/wasm/comdats.ll
+++ b/lld/test/wasm/comdats.ll
@@ -1,7 +1,7 @@
; RUN: llc -filetype=obj -mtriple=wasm32-unknown-uknown-wasm %p/Inputs/comdat1.ll -o %t1.o
; RUN: llc -filetype=obj -mtriple=wasm32-unknown-uknown-wasm %p/Inputs/comdat2.ll -o %t2.o
; RUN: llc -filetype=obj -mtriple=wasm32-unknown-uknown-wasm %s -o %t.o
-; RUN: wasm-ld --check-signatures -o %t.wasm %t.o %t1.o %t2.o
+; RUN: wasm-ld -o %t.wasm %t.o %t1.o %t2.o
; RUN: obj2yaml %t.wasm | FileCheck %s
target triple = "wasm32-unknown-unknown-wasm"
diff --git a/lld/test/wasm/conflict.test b/lld/test/wasm/conflict.test
index c8698027f1d..9adc92ed1ed 100644
--- a/lld/test/wasm/conflict.test
+++ b/lld/test/wasm/conflict.test
@@ -1,5 +1,5 @@
# RUN: llc -filetype=obj %p/Inputs/ret32.ll -o %t.ret32.o
-# RUN: not wasm-ld --check-signatures -o %t.wasm %t.ret32.o %t.ret32.o 2>&1 | FileCheck %s
+# RUN: not wasm-ld -o %t.wasm %t.ret32.o %t.ret32.o 2>&1 | FileCheck %s
# CHECK: duplicate symbol: ret32
# CHECK-NEXT: >>> defined in {{.*}}conflict.test.tmp.ret32.o
diff --git a/lld/test/wasm/custom-sections.ll b/lld/test/wasm/custom-sections.ll
index 201653c272b..b9a9f355d99 100644
--- a/lld/test/wasm/custom-sections.ll
+++ b/lld/test/wasm/custom-sections.ll
@@ -1,6 +1,6 @@
; RUN: llc -filetype=obj %s -o %t1.o
; RUN: llc -filetype=obj %S/Inputs/custom.ll -o %t2.o
-; RUN: wasm-ld --check-signatures --relocatable -o %t.wasm %t1.o %t2.o
+; RUN: wasm-ld --relocatable -o %t.wasm %t1.o %t2.o
; RUN: obj2yaml %t.wasm | FileCheck %s
target triple = "wasm32-unknown-unknown-wasm"
diff --git a/lld/test/wasm/cxx-mangling.ll b/lld/test/wasm/cxx-mangling.ll
index 8b73ca9bfe2..9fa51fc40cf 100644
--- a/lld/test/wasm/cxx-mangling.ll
+++ b/lld/test/wasm/cxx-mangling.ll
@@ -1,7 +1,7 @@
; RUN: llc -filetype=obj %s -o %t.o
-; RUN: wasm-ld --demangle --check-signatures -o %t_demangle.wasm %t.o
+; RUN: wasm-ld --demangle -o %t_demangle.wasm %t.o
; RUN: obj2yaml %t_demangle.wasm | FileCheck %s
-; RUN: wasm-ld --no-demangle --check-signatures -o %t_nodemangle.wasm %t.o
+; RUN: wasm-ld --no-demangle -o %t_nodemangle.wasm %t.o
; RUN: obj2yaml %t_nodemangle.wasm | FileCheck %s
target triple = "wasm32-unknown-unknown-wasm"
diff --git a/lld/test/wasm/data-layout.ll b/lld/test/wasm/data-layout.ll
index df7177cf019..a42b72aad39 100644
--- a/lld/test/wasm/data-layout.ll
+++ b/lld/test/wasm/data-layout.ll
@@ -13,7 +13,7 @@ target triple = "wasm32-unknown-unknown-wasm"
@local_struct = hidden global %struct.s zeroinitializer, align 4
@local_struct_internal_ptr = hidden local_unnamed_addr global i32* getelementptr inbounds (%struct.s, %struct.s* @local_struct, i32 0, i32 1), align 4
-; RUN: wasm-ld -no-gc-sections --check-signatures --allow-undefined -o %t.wasm %t.o %t.hello.o
+; RUN: wasm-ld -no-gc-sections --allow-undefined -o %t.wasm %t.o %t.hello.o
; RUN: obj2yaml %t.wasm | FileCheck %s
; CHECK: - Type: MEMORY
@@ -57,7 +57,7 @@ target triple = "wasm32-unknown-unknown-wasm"
; CHECK-NEXT: - Type: CUSTOM
-; RUN: wasm-ld -no-gc-sections --check-signatures --allow-undefined \
+; RUN: wasm-ld -no-gc-sections --allow-undefined \
; RUN: --initial-memory=131072 --max-memory=131072 -o %t_max.wasm %t.o \
; RUN: %t.hello.o
; RUN: obj2yaml %t_max.wasm | FileCheck %s -check-prefix=CHECK-MAX
@@ -69,7 +69,7 @@ target triple = "wasm32-unknown-unknown-wasm"
; CHECK-MAX-NEXT: Maximum: 0x00000002
-; RUN: wasm-ld --check-signatures --relocatable -o %t_reloc.wasm %t.o %t.hello.o
+; RUN: wasm-ld --relocatable -o %t_reloc.wasm %t.o %t.hello.o
; RUN: obj2yaml %t_reloc.wasm | FileCheck %s -check-prefix=RELOC
; RELOC: - Type: DATA
diff --git a/lld/test/wasm/demangle.ll b/lld/test/wasm/demangle.ll
index 07f99274556..9a9741bcaef 100644
--- a/lld/test/wasm/demangle.ll
+++ b/lld/test/wasm/demangle.ll
@@ -1,10 +1,10 @@
; RUN: llc -filetype=obj %s -o %t.o
-; RUN: not wasm-ld --check-signatures --undefined _Z3fooi \
+; RUN: not wasm-ld --undefined _Z3fooi \
; RUN: -o %t.wasm %t.o 2>&1 | FileCheck %s
; CHECK: error: undefined symbol: foo(int)
-; RUN: not wasm-ld --check-signatures --no-demangle --undefined _Z3fooi \
+; RUN: not wasm-ld --no-demangle --undefined _Z3fooi \
; RUN: -o %t.wasm %t.o 2>&1 | FileCheck -check-prefix=CHECK-NODEMANGLE %s
; CHECK-NODEMANGLE: error: undefined symbol: _Z3fooi
diff --git a/lld/test/wasm/entry.ll b/lld/test/wasm/entry.ll
index 083bf97a3b5..ea45e138358 100644
--- a/lld/test/wasm/entry.ll
+++ b/lld/test/wasm/entry.ll
@@ -7,9 +7,9 @@ entry:
ret void
}
-; RUN: wasm-ld --check-signatures -e entry -o %t1.wasm %t.o
+; RUN: wasm-ld -e entry -o %t1.wasm %t.o
; RUN: obj2yaml %t1.wasm | FileCheck %s
-; RUN: wasm-ld --check-signatures --entry=entry -o %t2.wasm %t.o
+; RUN: wasm-ld --entry=entry -o %t2.wasm %t.o
; RUN: obj2yaml %t2.wasm | FileCheck %s
; CHECK: - Type: EXPORT
@@ -30,7 +30,7 @@ entry:
; The __wasm_call_ctors is somewhat special. Make sure we can use it
; as the entry point if we choose
-; RUN: wasm-ld --check-signatures --entry=__wasm_call_ctors -o %t3.wasm %t.o
+; RUN: wasm-ld --entry=__wasm_call_ctors -o %t3.wasm %t.o
; RUN: obj2yaml %t3.wasm | FileCheck %s -check-prefix=CHECK-CTOR
; CHECK-CTOR: - Type: EXPORT
diff --git a/lld/test/wasm/export-table.test b/lld/test/wasm/export-table.test
index 0923af69273..58775b928f7 100644
--- a/lld/test/wasm/export-table.test
+++ b/lld/test/wasm/export-table.test
@@ -1,5 +1,5 @@
# RUN: llc -filetype=obj %p/Inputs/start.ll -o %t.start.o
-# RUN: wasm-ld --check-signatures --export-table -o %t.wasm %t.start.o
+# RUN: wasm-ld --export-table -o %t.wasm %t.start.o
# RUN: obj2yaml %t.wasm | FileCheck %s
# Verify the --export-table flag creates a table export
diff --git a/lld/test/wasm/export.ll b/lld/test/wasm/export.ll
index f2a4fff13cd..9e3606d4d7d 100644
--- a/lld/test/wasm/export.ll
+++ b/lld/test/wasm/export.ll
@@ -1,6 +1,6 @@
; RUN: llc -filetype=obj %s -o %t.o
-; RUN: not wasm-ld --check-signatures --export=missing -o %t.wasm %t.o 2>&1 | FileCheck -check-prefix=CHECK-ERROR %s
-; RUN: wasm-ld --check-signatures --export=hidden_function -o %t.wasm %t.o
+; RUN: not wasm-ld --export=missing -o %t.wasm %t.o 2>&1 | FileCheck -check-prefix=CHECK-ERROR %s
+; RUN: wasm-ld --export=hidden_function -o %t.wasm %t.o
; RUN: obj2yaml %t.wasm | FileCheck %s
target triple = "wasm32-unknown-unknown-wasm"
diff --git a/lld/test/wasm/fatal-warnings.ll b/lld/test/wasm/fatal-warnings.ll
new file mode 100644
index 00000000000..f3f1d3b64e4
--- /dev/null
+++ b/lld/test/wasm/fatal-warnings.ll
@@ -0,0 +1,14 @@
+; RUN: llc -filetype=obj %s -o %t.main.o
+; RUN: lld -flavor wasm -o %t.wasm %t.main.o 2>&1 | FileCheck %s -check-prefix=CHECK-WARN
+; RUN: not lld -flavor wasm --fatal-warnings -o %t.wasm %t.main.o 2>&1 | FileCheck %s -check-prefix=CHECK-FATAL
+
+; CHECK-WARN: warning: Function type mismatch: _start
+; CHECK-FATAL: error: Function type mismatch: _start
+
+target triple = "wasm32-unknown-unknown-wasm"
+
+define hidden i32 @_start(i32 %arg) local_unnamed_addr {
+entry:
+ ret i32 %arg
+}
+
diff --git a/lld/test/wasm/function-imports-first.ll b/lld/test/wasm/function-imports-first.ll
index be71d7c3ca1..ec8bd4ef0cf 100644
--- a/lld/test/wasm/function-imports-first.ll
+++ b/lld/test/wasm/function-imports-first.ll
@@ -1,6 +1,6 @@
; RUN: llc -filetype=obj %p/Inputs/ret32.ll -o %t.ret32.o
; RUN: llc -filetype=obj %s -o %t.o
-; RUN: wasm-ld --check-signatures -o %t.wasm %t.o %t.ret32.o
+; RUN: wasm-ld -o %t.wasm %t.o %t.ret32.o
; RUN: obj2yaml %t.wasm | FileCheck %s
target triple = "wasm32-unknown-unknown-wasm"
diff --git a/lld/test/wasm/function-imports.ll b/lld/test/wasm/function-imports.ll
index 742cec290fc..ec509e6d4d9 100644
--- a/lld/test/wasm/function-imports.ll
+++ b/lld/test/wasm/function-imports.ll
@@ -1,6 +1,6 @@
; RUN: llc -filetype=obj %p/Inputs/ret32.ll -o %t.ret32.o
; RUN: llc -filetype=obj %s -o %t.o
-; RUN: wasm-ld --check-signatures -o %t.wasm %t.ret32.o %t.o
+; RUN: wasm-ld -o %t.wasm %t.ret32.o %t.o
; RUN: obj2yaml %t.wasm | FileCheck %s
target triple = "wasm32-unknown-unknown-wasm"
diff --git a/lld/test/wasm/function-index.test b/lld/test/wasm/function-index.test
index 87842714f92..82f5d0cfb24 100644
--- a/lld/test/wasm/function-index.test
+++ b/lld/test/wasm/function-index.test
@@ -1,6 +1,6 @@
# RUN: llc -filetype=obj %p/Inputs/ret32.ll -o %t.ret32.o
# RUN: llc -filetype=obj %p/Inputs/ret64.ll -o %t.ret64.o
-# RUN: wasm-ld --check-signatures -r -o %t.wasm %t.ret32.o %t.ret64.o
+# RUN: wasm-ld -r -o %t.wasm %t.ret32.o %t.ret64.o
# RUN: obj2yaml %t.wasm | FileCheck %s
CHECK: Sections:
diff --git a/lld/test/wasm/import-memory.test b/lld/test/wasm/import-memory.test
index 955d2df0ea8..49bf06b7483 100644
--- a/lld/test/wasm/import-memory.test
+++ b/lld/test/wasm/import-memory.test
@@ -1,5 +1,5 @@
# RUN: llc -filetype=obj %p/Inputs/start.ll -o %t.start.o
-# RUN: wasm-ld --check-signatures --import-memory -o %t.wasm %t.start.o
+# RUN: wasm-ld --import-memory -o %t.wasm %t.start.o
# RUN: obj2yaml %t.wasm | FileCheck %s
# Verify the --import-memory flag creates a memory import
@@ -15,7 +15,7 @@
-# RUN: wasm-ld --check-signatures --import-memory --initial-memory=262144 \
+# RUN: wasm-ld --import-memory --initial-memory=262144 \
# RUN: --max-memory=327680 -o %t.max.wasm %t.start.o
# RUN: obj2yaml %t.max.wasm | FileCheck -check-prefix=CHECK-MAX %s
diff --git a/lld/test/wasm/import-table.test b/lld/test/wasm/import-table.test
index 98e07491ec4..eb767090292 100644
--- a/lld/test/wasm/import-table.test
+++ b/lld/test/wasm/import-table.test
@@ -1,5 +1,5 @@
# RUN: llc -filetype=obj %p/Inputs/start.ll -o %t.start.o
-# RUN: wasm-ld --check-signatures --import-table -o %t.wasm %t.start.o
+# RUN: wasm-ld --import-table -o %t.wasm %t.start.o
# RUN: obj2yaml %t.wasm | FileCheck %s
# Verify the --import-table flag creates a table import
diff --git a/lld/test/wasm/init-fini.ll b/lld/test/wasm/init-fini.ll
index c93314cc368..966e679792e 100644
--- a/lld/test/wasm/init-fini.ll
+++ b/lld/test/wasm/init-fini.ll
@@ -49,7 +49,7 @@ entry:
{ i32, void ()*, i8* } { i32 4000, void ()* @externDtor, i8* null }
]
-; RUN: wasm-ld --check-signatures --allow-undefined %t.o %t.global-ctor-dtor.o -o %t.wasm
+; RUN: wasm-ld --allow-undefined %t.o %t.global-ctor-dtor.o -o %t.wasm
; RUN: obj2yaml %t.wasm | FileCheck %s
; CHECK: - Type: IMPORT
@@ -128,7 +128,7 @@ entry:
; CHECK-NEXT: ...
-; RUN: wasm-ld --check-signatures -r %t.o %t.global-ctor-dtor.o -o %t.reloc.wasm
+; RUN: wasm-ld -r %t.o %t.global-ctor-dtor.o -o %t.reloc.wasm
; RUN: obj2yaml %t.reloc.wasm | FileCheck -check-prefix=RELOC %s
; RELOC: SymbolTable:
diff --git a/lld/test/wasm/invalid-stack-size.test b/lld/test/wasm/invalid-stack-size.test
index da47c689c9c..90c9fda113e 100644
--- a/lld/test/wasm/invalid-stack-size.test
+++ b/lld/test/wasm/invalid-stack-size.test
@@ -1,4 +1,4 @@
; RUN: llc -filetype=obj %p/Inputs/start.ll -o %t.o
-; RUN: not wasm-ld --check-signatures -o %t.wasm -z stack-size=1 %t.o 2>&1 | FileCheck %s
+; RUN: not wasm-ld -o %t.wasm -z stack-size=1 %t.o 2>&1 | FileCheck %s
; CHECK: error: stack size must be 16-byte aligned
diff --git a/lld/test/wasm/load-undefined.test b/lld/test/wasm/load-undefined.test
index 7e78bf0c2e5..afa5b008fbc 100644
--- a/lld/test/wasm/load-undefined.test
+++ b/lld/test/wasm/load-undefined.test
@@ -5,7 +5,7 @@
; RUN: llc -filetype=obj %S/Inputs/ret32.ll -o %t2.o
; RUN: llc -filetype=obj %S/Inputs/start.ll -o %t.start.o
; RUN: llvm-ar rcs %t2.a %t2.o
-; RUN: wasm-ld --check-signatures %t.start.o %t2.a %t.o -o %t.wasm -u ret32 --undefined ret64
+; RUN: wasm-ld %t.start.o %t2.a %t.o -o %t.wasm -u ret32 --undefined ret64
; RUN: obj2yaml %t.wasm | FileCheck %s
; CHECK: - Type: EXPORT
@@ -32,8 +32,8 @@
; Verify that referencing a symbol that doesn't exist won't work
-; RUN: not wasm-ld --check-signatures %t.start.o -o %t.wasm -u symboldoesnotexist 2>&1 | FileCheck -check-prefix=CHECK-UNDEFINED1 %s
+; RUN: not wasm-ld %t.start.o -o %t.wasm -u symboldoesnotexist 2>&1 | FileCheck -check-prefix=CHECK-UNDEFINED1 %s
; CHECK-UNDEFINED1: error: undefined symbol: symboldoesnotexist
-; RUN: not wasm-ld --check-signatures %t.start.o -o %t.wasm --undefined symboldoesnotexist --allow-undefined 2>&1 | FileCheck -check-prefix=CHECK-UNDEFINED2 %s
+; RUN: not wasm-ld %t.start.o -o %t.wasm --undefined symboldoesnotexist --allow-undefined 2>&1 | FileCheck -check-prefix=CHECK-UNDEFINED2 %s
; CHECK-UNDEFINED2: function forced with --undefined not found: symboldoesnotexist
diff --git a/lld/test/wasm/local-symbols.ll b/lld/test/wasm/local-symbols.ll
index fcb3c42783c..d7778cf83a0 100644
--- a/lld/test/wasm/local-symbols.ll
+++ b/lld/test/wasm/local-symbols.ll
@@ -1,5 +1,5 @@
; RUN: llc -filetype=obj %s -o %t.o
-; RUN: wasm-ld --check-signatures -o %t.wasm %t.o
+; RUN: wasm-ld -o %t.wasm %t.o
; RUN: obj2yaml %t.wasm | FileCheck %s
target triple = "wasm32-unknown-unknown-wasm"
diff --git a/lld/test/wasm/locals-duplicate.test b/lld/test/wasm/locals-duplicate.test
index 00a8dc1ed03..3c67cdd8cfa 100644
--- a/lld/test/wasm/locals-duplicate.test
+++ b/lld/test/wasm/locals-duplicate.test
@@ -1,6 +1,6 @@
; RUN: llc -filetype=obj %p/Inputs/locals-duplicate1.ll -o %t1.o
; RUN: llc -filetype=obj %p/Inputs/locals-duplicate2.ll -o %t2.o
-; RUN: wasm-ld --check-signatures --no-entry -o %t.wasm %t1.o %t2.o
+; RUN: wasm-ld --no-entry -o %t.wasm %t1.o %t2.o
; RUN: obj2yaml %t.wasm | FileCheck %s
; CHECK: --- !WASM
@@ -236,7 +236,7 @@
; CHECK-NEXT: ...
-; RUN: wasm-ld --check-signatures -r --no-entry -o %t.reloc.wasm %t1.o %t2.o
+; RUN: wasm-ld -r --no-entry -o %t.reloc.wasm %t1.o %t2.o
; RUN: obj2yaml %t.reloc.wasm | FileCheck -check-prefix=RELOC %s
; RELOC: --- !WASM
diff --git a/lld/test/wasm/many-functions.ll b/lld/test/wasm/many-functions.ll
index 4116c47bfbb..43e7cfab8ae 100644
--- a/lld/test/wasm/many-functions.ll
+++ b/lld/test/wasm/many-functions.ll
@@ -1,6 +1,6 @@
; RUN: llc -filetype=obj %p/Inputs/many-funcs.ll -o %t.many.o
; RUN: llc -filetype=obj %s -o %t.o
-; RUN: wasm-ld --check-signatures -r -o %t.wasm %t.many.o %t.o
+; RUN: wasm-ld -r -o %t.wasm %t.many.o %t.o
; RUN: obj2yaml %t.wasm | FileCheck %s
; Test that relocations within the CODE section correctly handle
diff --git a/lld/test/wasm/reloc-addend.ll b/lld/test/wasm/reloc-addend.ll
index 630bd868916..ceca9a65d57 100644
--- a/lld/test/wasm/reloc-addend.ll
+++ b/lld/test/wasm/reloc-addend.ll
@@ -1,5 +1,5 @@
; RUN: llc -filetype=obj %s -o %t.o
-; RUN: wasm-ld --check-signatures -r -o %t.wasm %t.o
+; RUN: wasm-ld -r -o %t.wasm %t.o
; RUN: obj2yaml %t.wasm | FileCheck %s
target triple = "wasm32-unknown-unknown-wasm"
diff --git a/lld/test/wasm/relocatable.ll b/lld/test/wasm/relocatable.ll
index bcbeca2dedb..b7323065c34 100644
--- a/lld/test/wasm/relocatable.ll
+++ b/lld/test/wasm/relocatable.ll
@@ -1,6 +1,6 @@
; RUN: llc -filetype=obj %p/Inputs/hello.ll -o %t.hello.o
; RUN: llc -filetype=obj %s -o %t.o
-; RUN: wasm-ld --check-signatures -r -o %t.wasm %t.hello.o %t.o
+; RUN: wasm-ld -r -o %t.wasm %t.hello.o %t.o
; RUN: obj2yaml %t.wasm | FileCheck %s
target triple = "wasm32-unknown-unknown-wasm"
diff --git a/lld/test/wasm/signature-mismatch-weak.ll b/lld/test/wasm/signature-mismatch-weak.ll
index fcf96469b27..a4148a2b4a7 100644
--- a/lld/test/wasm/signature-mismatch-weak.ll
+++ b/lld/test/wasm/signature-mismatch-weak.ll
@@ -1,8 +1,7 @@
; RUN: llc -filetype=obj %p/Inputs/weak-symbol1.ll -o %t.weak.o
; RUN: llc -filetype=obj %p/Inputs/strong-symbol.ll -o %t.strong.o
; RUN: llc -filetype=obj %s -o %t.o
-; RUN: not wasm-ld --check-signatures -o %t.wasm %t.o %t.strong.o %t.weak.o 2>&1 | FileCheck %s
-; RUN: wasm-ld -o %t.wasm %t.o %t.strong.o %t.weak.o
+; RUN: wasm-ld -o %t.wasm %t.o %t.strong.o %t.weak.o 2>&1 | FileCheck %s
target triple = "wasm32-unknown-unknown-wasm"
@@ -14,6 +13,6 @@ entry:
ret void
}
-; CHECK: error: Function type mismatch: weakFn
+; CHECK: warning: Function type mismatch: weakFn
; CHECK-NEXT: >>> defined as () -> I32 in {{.*}}signature-mismatch-weak.ll.tmp.o
; CHECK-NEXT: >>> defined as () -> I64 in {{.*}}signature-mismatch-weak.ll.tmp.strong.o
diff --git a/lld/test/wasm/signature-mismatch.ll b/lld/test/wasm/signature-mismatch.ll
index 602239ddd19..e7874c39a6d 100644
--- a/lld/test/wasm/signature-mismatch.ll
+++ b/lld/test/wasm/signature-mismatch.ll
@@ -1,10 +1,10 @@
; RUN: llc -filetype=obj %p/Inputs/ret32.ll -o %t.ret32.o
; RUN: llc -filetype=obj %s -o %t.main.o
-; RUN: not wasm-ld --check-signatures -o %t.wasm %t.main.o %t.ret32.o 2>&1 | FileCheck %s
+; RUN: not wasm-ld --fatal-warnings -o %t.wasm %t.main.o %t.ret32.o 2>&1 | FileCheck %s
; Run the test again by with the object files in the other order to verify
; the check works when the undefined symbol is resolved by an existing defined
; one.
-; RUN: not wasm-ld --check-signatures -o %t.wasm %t.ret32.o %t.main.o 2>&1 | FileCheck %s -check-prefix=REVERSE
+; RUN: not wasm-ld --fatal-warnings -o %t.wasm %t.ret32.o %t.main.o 2>&1 | FileCheck %s -check-prefix=REVERSE
target triple = "wasm32-unknown-unknown-wasm"
diff --git a/lld/test/wasm/stack-first.test b/lld/test/wasm/stack-first.test
index c0e186cff54..71d1e9dde85 100644
--- a/lld/test/wasm/stack-first.test
+++ b/lld/test/wasm/stack-first.test
@@ -5,7 +5,7 @@
RUN: llc -filetype=obj %p/Inputs/start.ll -o %t.o
-RUN: wasm-ld --check-signatures -z stack-size=512 --stack-first --allow-undefined -o %t.wasm %t.o
+RUN: wasm-ld -z stack-size=512 --stack-first --allow-undefined -o %t.wasm %t.o
RUN: obj2yaml %t.wasm | FileCheck %s
CHECK: - Type: GLOBAL
diff --git a/lld/test/wasm/stack-pointer.ll b/lld/test/wasm/stack-pointer.ll
index 808f6261f72..ed366d6aecb 100644
--- a/lld/test/wasm/stack-pointer.ll
+++ b/lld/test/wasm/stack-pointer.ll
@@ -1,5 +1,5 @@
; RUN: llc -filetype=obj %s -o %t.o
-; RUN: wasm-ld --check-signatures --relocatable -o %t.wasm %t.o
+; RUN: wasm-ld --relocatable -o %t.wasm %t.o
; RUN: obj2yaml %t.wasm | FileCheck %s
target triple = "wasm32-unknown-unknown-wasm"
diff --git a/lld/test/wasm/strip-debug.test b/lld/test/wasm/strip-debug.test
index 5a74ac8920c..be5ba700e25 100644
--- a/lld/test/wasm/strip-debug.test
+++ b/lld/test/wasm/strip-debug.test
@@ -1,5 +1,5 @@
RUN: llc -filetype=obj %p/Inputs/start.ll -o %t.start.o
-RUN: wasm-ld --check-signatures --strip-debug -o %t.wasm %t.start.o
+RUN: wasm-ld --strip-debug -o %t.wasm %t.start.o
RUN: obj2yaml %t.wasm | FileCheck %s
# Check that there is no name section
diff --git a/lld/test/wasm/symbol-type-mismatch.ll b/lld/test/wasm/symbol-type-mismatch.ll
index 16e0f4dc8d5..641782d808f 100644
--- a/lld/test/wasm/symbol-type-mismatch.ll
+++ b/lld/test/wasm/symbol-type-mismatch.ll
@@ -1,6 +1,6 @@
; RUN: llc -filetype=obj %s -o %t.o
; RUN: llc -filetype=obj %p/Inputs/ret32.ll -o %t.ret32.o
-; RUN: not wasm-ld --check-signatures -o %t.wasm %t.o %t.ret32.o 2>&1 | FileCheck %s
+; RUN: not wasm-ld -o %t.wasm %t.o %t.ret32.o 2>&1 | FileCheck %s
target triple = "wasm32-unknown-unknown-wasm"
diff --git a/lld/test/wasm/undefined-entry.test b/lld/test/wasm/undefined-entry.test
index 7906ec9bb17..3adb785a587 100644
--- a/lld/test/wasm/undefined-entry.test
+++ b/lld/test/wasm/undefined-entry.test
@@ -1,10 +1,10 @@
RUN: llc -filetype=obj %p/Inputs/ret32.ll -o %t.ret32.o
-RUN: not wasm-ld --check-signatures -o %t.wasm %t.ret32.o 2>&1 | FileCheck %s
+RUN: not wasm-ld -o %t.wasm %t.ret32.o 2>&1 | FileCheck %s
CHECK: error: undefined symbol: _start
-RUN: not wasm-ld --check-signatures -entry=foo -o %t.wasm %t.ret32.o 2>&1 | FileCheck %s -check-prefix=CHECK-CUSTOM
+RUN: not wasm-ld -entry=foo -o %t.wasm %t.ret32.o 2>&1 | FileCheck %s -check-prefix=CHECK-CUSTOM
CHECK-CUSTOM: error: undefined symbol: foo
-RUN: wasm-ld --check-signatures -entry=foo --allow-undefined -o %t.wasm %t.ret32.o
+RUN: wasm-ld -entry=foo --allow-undefined -o %t.wasm %t.ret32.o
diff --git a/lld/test/wasm/undefined-weak-call.ll b/lld/test/wasm/undefined-weak-call.ll
index fed3ecc20f7..96073e67cd4 100644
--- a/lld/test/wasm/undefined-weak-call.ll
+++ b/lld/test/wasm/undefined-weak-call.ll
@@ -1,5 +1,5 @@
; RUN: llc -filetype=obj %s -o %t.o
-; RUN: wasm-ld --check-signatures --no-entry --print-gc-sections %t.o \
+; RUN: wasm-ld --no-entry --print-gc-sections %t.o \
; RUN: -o %t.wasm 2>&1 | FileCheck -check-prefix=CHECK-GC %s
; RUN: obj2yaml %t.wasm | FileCheck %s
diff --git a/lld/test/wasm/undefined.ll b/lld/test/wasm/undefined.ll
index a74dd6d66de..bdbb11c3034 100644
--- a/lld/test/wasm/undefined.ll
+++ b/lld/test/wasm/undefined.ll
@@ -1,17 +1,17 @@
; RUN: llc -filetype=obj %s -o %t.o
-; RUN: wasm-ld --check-signatures --allow-undefined -o %t.wasm %t.o
+; RUN: wasm-ld --allow-undefined -o %t.wasm %t.o
; Fails due to undefined 'foo' and also 'baz'
-; RUN: not wasm-ld --check-signatures --undefined=baz -o %t.wasm %t.o 2>&1 | FileCheck %s
+; RUN: not wasm-ld --undefined=baz -o %t.wasm %t.o 2>&1 | FileCheck %s
; CHECK: error: {{.*}}.o: undefined symbol: foo
; CHECK: error: undefined symbol: baz
; Succeeds if we pass a file containing 'foo' as --allow-undefined-file.
; RUN: echo 'foo' > %t.txt
-; RUN: wasm-ld --check-signatures --allow-undefined-file=%t.txt -o %t.wasm %t.o
+; RUN: wasm-ld --allow-undefined-file=%t.txt -o %t.wasm %t.o
; Succeeds even if a missing symbol is added via --export
-; RUN: wasm-ld --check-signatures --allow-undefined --export=xxx -o %t.wasm %t.o
+; RUN: wasm-ld --allow-undefined --export=xxx -o %t.wasm %t.o
target triple = "wasm32-unknown-unknown-wasm"
diff --git a/lld/test/wasm/version.ll b/lld/test/wasm/version.ll
index 3b20b395c37..ffa2654c115 100644
--- a/lld/test/wasm/version.ll
+++ b/lld/test/wasm/version.ll
@@ -1,5 +1,5 @@
; RUN: llc -filetype=obj %s -o %t.o
-; RUN: wasm-ld --check-signatures -o %t.wasm %t.o
+; RUN: wasm-ld -o %t.wasm %t.o
; RUN: llvm-readobj -file-headers %t.wasm | FileCheck %s
target triple = "wasm32-unknown-unknown-wasm"
diff --git a/lld/test/wasm/visibility-hidden.ll b/lld/test/wasm/visibility-hidden.ll
index 530649be42a..30f87b311e7 100644
--- a/lld/test/wasm/visibility-hidden.ll
+++ b/lld/test/wasm/visibility-hidden.ll
@@ -1,7 +1,7 @@
; RUN: llc -filetype=obj -o %t.o %s
; RUN: llc -filetype=obj %S/Inputs/hidden.ll -o %t2.o
; RUN: llvm-ar rcs %t2.a %t2.o
-; RUN: wasm-ld --check-signatures %t.o %t2.a -o %t.wasm
+; RUN: wasm-ld %t.o %t2.a -o %t.wasm
; RUN: obj2yaml %t.wasm | FileCheck %s
; Test that hidden symbols are not exported, whether pulled in from an archive
diff --git a/lld/test/wasm/weak-alias-overide.ll b/lld/test/wasm/weak-alias-overide.ll
index 22522989297..a4021fbbac1 100644
--- a/lld/test/wasm/weak-alias-overide.ll
+++ b/lld/test/wasm/weak-alias-overide.ll
@@ -1,6 +1,6 @@
; RUN: llc -filetype=obj -o %t.o %s
; RUN: llc -filetype=obj %S/Inputs/weak-alias.ll -o %t2.o
-; RUN: wasm-ld --check-signatures %t.o %t2.o -o %t.wasm
+; RUN: wasm-ld %t.o %t2.o -o %t.wasm
; RUN: obj2yaml %t.wasm | FileCheck %s
; Test that the strongly defined alias_fn from this file is used both here
diff --git a/lld/test/wasm/weak-alias.ll b/lld/test/wasm/weak-alias.ll
index d59f0e15766..0cc5a07a586 100644
--- a/lld/test/wasm/weak-alias.ll
+++ b/lld/test/wasm/weak-alias.ll
@@ -1,6 +1,6 @@
; RUN: llc -filetype=obj -o %t.o %s
; RUN: llc -filetype=obj %S/Inputs/weak-alias.ll -o %t2.o
-; RUN: wasm-ld --check-signatures %t.o %t2.o -o %t.wasm
+; RUN: wasm-ld %t.o %t2.o -o %t.wasm
; RUN: obj2yaml %t.wasm | FileCheck %s
; Test that weak aliases (alias_fn is a weak alias of direct_fn) are linked correctly
@@ -144,7 +144,7 @@ entry:
; CHECK-NEXT: Name: call_direct_ptr
; CHECK-NEXT: ...
-; RUN: wasm-ld --check-signatures --relocatable %t.o %t2.o -o %t.reloc.o
+; RUN: wasm-ld --relocatable %t.o %t2.o -o %t.reloc.o
; RUN: obj2yaml %t.reloc.o | FileCheck %s -check-prefix=RELOC
; RELOC: --- !WASM
diff --git a/lld/test/wasm/weak-symbols.ll b/lld/test/wasm/weak-symbols.ll
index 7ecb900b2e2..c1a5a0c64f1 100644
--- a/lld/test/wasm/weak-symbols.ll
+++ b/lld/test/wasm/weak-symbols.ll
@@ -1,7 +1,7 @@
; RUN: llc -filetype=obj %p/Inputs/weak-symbol1.ll -o %t1.o
; RUN: llc -filetype=obj %p/Inputs/weak-symbol2.ll -o %t2.o
; RUN: llc -filetype=obj %s -o %t.o
-; RUN: wasm-ld -no-gc-sections --check-signatures -o %t.wasm %t.o %t1.o %t2.o
+; RUN: wasm-ld -no-gc-sections -o %t.wasm %t.o %t1.o %t2.o
; RUN: obj2yaml %t.wasm | FileCheck %s
target triple = "wasm32-unknown-unknown-wasm"
diff --git a/lld/test/wasm/weak-undefined.ll b/lld/test/wasm/weak-undefined.ll
index ce68e54f29e..98c6d2655ad 100644
--- a/lld/test/wasm/weak-undefined.ll
+++ b/lld/test/wasm/weak-undefined.ll
@@ -1,5 +1,5 @@
; RUN: llc -filetype=obj -o %t.o %s
-; RUN: wasm-ld --check-signatures -strip-debug %t.o -o %t.wasm
+; RUN: wasm-ld -strip-debug %t.o -o %t.wasm
; RUN: obj2yaml %t.wasm | FileCheck %s
; Test that undefined weak externals (global_var) and (foo) don't cause
diff --git a/lld/wasm/Config.h b/lld/wasm/Config.h
index 115acea816e..3ade61c08dd 100644
--- a/lld/wasm/Config.h
+++ b/lld/wasm/Config.h
@@ -19,7 +19,6 @@ namespace wasm {
struct Configuration {
bool AllowUndefined;
- bool CheckSignatures;
bool Demangle;
bool ExportTable;
bool GcSections;
diff --git a/lld/wasm/Driver.cpp b/lld/wasm/Driver.cpp
index 60bd71ce4c8..deaa95cbc31 100644
--- a/lld/wasm/Driver.cpp
+++ b/lld/wasm/Driver.cpp
@@ -282,11 +282,11 @@ void LinkerDriver::link(ArrayRef<const char *> ArgsArr) {
errorHandler().ErrorLimit = args::getInteger(Args, OPT_error_limit, 20);
Config->AllowUndefined = Args.hasArg(OPT_allow_undefined);
- Config->CheckSignatures =
- Args.hasFlag(OPT_check_signatures, OPT_no_check_signatures, false);
Config->Demangle = Args.hasFlag(OPT_demangle, OPT_no_demangle, true);
Config->Entry = getEntry(Args, Args.hasArg(OPT_relocatable) ? "" : "_start");
Config->ExportTable = Args.hasArg(OPT_export_table);
+ errorHandler().FatalWarnings =
+ Args.hasFlag(OPT_fatal_warnings, OPT_no_fatal_warnings, false);
Config->ImportMemory = Args.hasArg(OPT_import_memory);
Config->ImportTable = Args.hasArg(OPT_import_table);
Config->OutputFile = Args.getLastArgValue(OPT_o);
diff --git a/lld/wasm/Options.td b/lld/wasm/Options.td
index d1810bf1b8e..1a396480b8b 100644
--- a/lld/wasm/Options.td
+++ b/lld/wasm/Options.td
@@ -96,10 +96,6 @@ def allow_undefined_file: J<"allow-undefined-file=">,
def allow_undefined_file_s: Separate<["-"], "allow-undefined-file">,
Alias<allow_undefined_file>;
-defm check_signatures: B<"check-signatures",
- "Check function signatures",
- "Don't check function signatures">;
-
defm export: Eq<"export">,
HelpText<"Force a symbol to be exported">;
diff --git a/lld/wasm/SymbolTable.cpp b/lld/wasm/SymbolTable.cpp
index 153b507f89d..54e04ab4cd8 100644
--- a/lld/wasm/SymbolTable.cpp
+++ b/lld/wasm/SymbolTable.cpp
@@ -83,16 +83,13 @@ static void checkFunctionType(const Symbol *Existing, const InputFile *File,
return;
}
- if (!Config->CheckSignatures)
- return;
-
const WasmSignature *OldSig =
cast<FunctionSymbol>(Existing)->getFunctionType();
if (OldSig && *NewSig != *OldSig) {
- error("Function type mismatch: " + Existing->getName() +
- "\n>>> defined as " + toString(*OldSig) + " in " +
- toString(Existing->getFile()) + "\n>>> defined as " +
- toString(*NewSig) + " in " + toString(File));
+ warn("Function type mismatch: " + Existing->getName() +
+ "\n>>> defined as " + toString(*OldSig) + " in " +
+ toString(Existing->getFile()) + "\n>>> defined as " +
+ toString(*NewSig) + " in " + toString(File));
}
}
OpenPOWER on IntegriCloud