summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEugene Leviant <evgeny.leviant@gmail.com>2016-10-19 09:35:19 +0000
committerEugene Leviant <evgeny.leviant@gmail.com>2016-10-19 09:35:19 +0000
commit74c1b6c54849b02918b7c6290e2be987738be2f5 (patch)
treebcc94f2e39d579eadeaa1b06ce24cf505b6da09a
parentb2ca2505ccc9877657239e54ba274b4811a02e0f (diff)
downloadbcm5719-llvm-74c1b6c54849b02918b7c6290e2be987738be2f5.tar.gz
bcm5719-llvm-74c1b6c54849b02918b7c6290e2be987738be2f5.zip
[ELF] Add "error" and "warning" prefixes to linker messages
Differential revision: https://reviews.llvm.org/D25729 llvm-svn: 284575
-rw-r--r--lld/ELF/Error.cpp6
-rw-r--r--lld/test/ELF/copy-rel-corrupted.s4
-rw-r--r--lld/test/ELF/entry.s8
-rw-r--r--lld/test/ELF/linkerscript/diagnostic.s4
4 files changed, 11 insertions, 11 deletions
diff --git a/lld/ELF/Error.cpp b/lld/ELF/Error.cpp
index 729888e195e..06aa28120ef 100644
--- a/lld/ELF/Error.cpp
+++ b/lld/ELF/Error.cpp
@@ -30,11 +30,11 @@ void elf::warn(const Twine &Msg) {
if (Config->FatalWarnings)
error(Msg);
else
- *ErrorOS << Msg << "\n";
+ *ErrorOS << "warning: " << Msg << "\n";
}
void elf::error(const Twine &Msg) {
- *ErrorOS << Msg << "\n";
+ *ErrorOS << "error: " << Msg << "\n";
HasError = true;
}
@@ -43,7 +43,7 @@ void elf::error(std::error_code EC, const Twine &Prefix) {
}
void elf::fatal(const Twine &Msg) {
- *ErrorOS << Msg << "\n";
+ *ErrorOS << "error: " << Msg << "\n";
exit(1);
}
diff --git a/lld/test/ELF/copy-rel-corrupted.s b/lld/test/ELF/copy-rel-corrupted.s
index 774334c7468..f714eab1dc6 100644
--- a/lld/test/ELF/copy-rel-corrupted.s
+++ b/lld/test/ELF/copy-rel-corrupted.s
@@ -1,9 +1,9 @@
// RUN: llvm-mc %s -o %t.o -filetype=obj -triple=x86_64-pc-linux
// RUN: llvm-mc %p/Inputs/copy-rel-corrupted.s -o %t2.o -filetype=obj -triple=x86_64-pc-linux
// RUN: ld.lld %t2.o -o %t2.so -shared
-// RUN: not ld.lld %t.o %t2.so -o %t.exe 2>&1 | FileCheck %s
+// RUN: not ld.lld %t.o %t2.so -o %t.exe 2>&1 | FileCheck %s --match-full-lines
-// CHECK: cannot create a copy relocation for symbol x
+// CHECK: error: cannot create a copy relocation for symbol x
.global _start
_start:
diff --git a/lld/test/ELF/entry.s b/lld/test/ELF/entry.s
index 3a41c1b162d..09cf19a0f01 100644
--- a/lld/test/ELF/entry.s
+++ b/lld/test/ELF/entry.s
@@ -2,9 +2,9 @@
# RUN: ld.lld -e foobar %t1 -o %t2 2>&1 | FileCheck -check-prefix=WARN %s
# RUN: llvm-readobj -file-headers %t2 | FileCheck -check-prefix=NOENTRY %s
-# RUN: ld.lld %t1 -o %t2 2>&1 | FileCheck -check-prefix=WARN2 %s
+# RUN: ld.lld %t1 -o %t2 2>&1 | FileCheck -check-prefix=WARN2 %s --match-full-lines
-# RUN: ld.lld -shared -e foobar %t1 -o %t2 2>&1 | FileCheck -check-prefix=WARN %s
+# RUN: ld.lld -shared -e foobar %t1 -o %t2 2>&1 | FileCheck -check-prefix=WARN --match-full-lines %s
# RUN: ld.lld -shared --fatal-warnings -e entry %t1 -o %t2
# RUN: ld.lld -shared --fatal-warnings %t1 -o %t2
@@ -19,8 +19,8 @@
# RUN: ld.lld %t1 -o %t2 -e 0777
# RUN: llvm-readobj -file-headers %t2 | FileCheck -check-prefix=OCT %s
-# WARN: entry symbol foobar not found, assuming 0
-# WARN2: entry symbol _start not found, assuming 0
+# WARN: warning: entry symbol foobar not found, assuming 0
+# WARN2: warning: entry symbol _start not found, assuming 0
# NOENTRY: Entry: 0x0
# SYM: Entry: 0x11000
diff --git a/lld/test/ELF/linkerscript/diagnostic.s b/lld/test/ELF/linkerscript/diagnostic.s
index c0aaa9f4d64..7d2b57d5a1f 100644
--- a/lld/test/ELF/linkerscript/diagnostic.s
+++ b/lld/test/ELF/linkerscript/diagnostic.s
@@ -52,7 +52,7 @@
# RUN: FileCheck -check-prefix=ERR6 %s < %t.log
# ERR6: line 1:
# ERR6-NEXT: UNKNOWN_TAG {
-# RUN: grep '^^' %t.log
+# RUN: grep '^error: ^' %t.log
## One more check that text of lines and pointer to 'bad' token are working ok.
# RUN: echo "SECTIONS {" > %t.script
@@ -63,4 +63,4 @@
# RUN: FileCheck -check-prefix=ERR7 %s < %t.log
# ERR7: line 4: malformed number: .temp
# ERR7-NEXT: boom .temp : { *(.temp) } }
-# RUN: grep '^ ^' %t.log
+# RUN: grep '^error: ^' %t.log
OpenPOWER on IntegriCloud